music21.analysis.enharmonics¶
ChordEnharmonicScoreRules¶
EnharmonicScoreRules¶
EnharmonicSimplifier¶
- class music21.analysis.enharmonics.EnharmonicSimplifier(pitchList, ruleClass=<class 'music21.analysis.enharmonics.EnharmonicScoreRules'>)[source]¶
Takes any pitch list input and returns the best enharmonic respelling according to the input criteria and rule weightings. Those criteria and rule weightings are currently fixed, but in future the user should be able to select their own combination and weighting of rules according to preferences, with predefined defaults for melodic and harmonic norms. Note: EnharmonicSimplifier itself returns nothing.
EnharmonicSimplifier methods
- EnharmonicSimplifier.bestPitches()[source]¶
Returns a list of pitches in the best enharmonic spelling according to the input criteria.
>>> pList1 = [pitch.Pitch('C'), pitch.Pitch('D'), pitch.Pitch('E')] >>> es = analysis.enharmonics.EnharmonicSimplifier(pList1) >>> es.bestPitches() (<music21.pitch.Pitch C>, <music21.pitch.Pitch D>, <music21.pitch.Pitch E>) >>> pList2 = ['D--', 'E', 'F##'] >>> es = analysis.enharmonics.EnharmonicSimplifier(pList2) >>> es.bestPitches() (<music21.pitch.Pitch C>, <music21.pitch.Pitch E>, <music21.pitch.Pitch G>)
- EnharmonicSimplifier.getAlterationScore(possibility)[source]¶
Returns a score according to the number of sharps and flats in a possible spelling. The score is the sum of the flats and sharps + 1, multiplied by the alterationPenalty.
- EnharmonicSimplifier.getAugDimScore(possibility)[source]¶
Returns a score based on the number of augmented and diminished intervals between successive pitches in the given spelling.