ChartAnalyzer

class mchartanalyzer.chartanalyzer.ChartAnalyzer[source]

Analyzes the charts, and calculates the desired data for display.

__weakref__

list of weak references to the object (if defined)

_analyzeArtist(artistData)[source]

Analyzes an artist. Returns an ArtistCalculations object.

_analyzeCharts(artistDataList)[source]

Perform analysis on song charts associated to certain artists.

_analyzeKey(chordList)[source]

Determines the song’s key by analyzing the chords in the current song. Returns a tuple with the analyzed key and key certainty. For example, (“G major”, 0.977538)

_convertChordListToGeneral(chordList, keyString)[source]

From a given key and chord symbol list, return a list of chord symbols in roman numeral notation. For example: ?????

_convertChordSymbolToGeneral(chordSymbol, m21Key)[source]

From a given key and chord symbol, return a chord symbol in roman numeral notation. For example: ?????

_convertKeyTextToMusic21(text)[source]

Converts a regular key string to a music21 key string. Music21 key strings use a lowercase tonic for minor keys, and use “-” as a flat accidental instead of “b”. For example, this method would convert “Bb Minor” to “b- minor”

_convertMusic21KeyToText(text)[source]

Converts a music21 key string to a regular one. Music21 key strings use a lowercase tonic for minor keys, and use “-” as a flat accidental instead of “b”. For example, this method would convert “b- minor” to “Bb Minor”

_convertToMusic21ChordSymbol(text)[source]

Converts regular chord symbols into ones that music21 understands. The main difference: the flat accidental is “-” on music21, not “b”. For example, this method would convert “Bbm7” to “B-m7”

_getBasicChartCalculations(chartData)[source]

Analyzes a chart. Returns an ChartCalculations object.

_getChordProgressions(chordList)[source]

Gets a series of four-chord progressions in the given chord list. Returns a dictionary with chord progressions as keys, and counts as values.

_getMostCommonChords(chordList)[source]

Gets the most common chord symbols in the given chord list. Returns a dictionary with chord symbols as keys, and counts as values.

analyzeAllCharts()[source]

Perform analysis on all artists.

analyzeFreshCharts()[source]

Perform analysis on artists with fresh data.