Expand description
Public interval parsing, naming and transposition helpers.
Structs§
- Chromatic
Interval - A signed number of semitones, fractional for microtonal intervals.
- Diatonic
Interval - A quality and a generic interval together:
M3,-P5,dd7. - Generic
Interval - A directed interval counted in scale steps:
3is a third up,-3a third down,1a unison. Zero is not an interval. - Interval
- A directed musical interval with diatonic spelling and chromatic size.
Enums§
- Interval
Direction - Direction of a directed interval.
- Specifier
- An interval quality, numbered as music21 numbers its
Specifierenum.
Functions§
- absolute_
higher_ pitch - The pitch that sounds higher: music21’s
getAbsoluteHigherNote. Enharmonic equals return the first. - absolute_
lower_ pitch - The pitch that sounds lower: music21’s
getAbsoluteLowerNote. Enharmonic equals return the first. - convert_
diatonic_ number_ to_ step - The step letter and octave of a diatonic note number, counting
C0as1: music21’sconvertDiatonicNumberToStep, so15isCin octave2,0isBin octave-1, and-19isDin octave-3. - convert_
generic - music21’s
convertGenericfor a number: the number itself, since the sign already carries the direction. - convert_
semitone_ to_ specifier_ generic - The simplest quality and generic size for a semitone count: music21’s
convertSemitoneToSpecifierGeneric, so6is a diminished fifth and-14a descending major ninth. - convert_
semitone_ to_ specifier_ generic_ microtone - Like
convert_semitone_to_specifier_genericfor a fractional semitone count, returning the leftover in cents as well: music21’sconvertSemitoneToSpecifierGenericMicrotone, so2.5is a major second and fifty cents, and-2.5a descending minor third and fifty. - intervals_
to_ diatonic - Reads the quality off a generic and a chromatic interval together:
music21’s
intervalsToDiatonic, so a third of four semitones is major. - notes_
to_ chromatic - The semitone distance from one pitch to another: music21’s
notesToChromatic. - notes_
to_ generic - The generic interval from one pitch to another, counted by staff
position: music21’s
notesToGeneric. - parse_
specifier - Parses an interval quality from its prefix or spelled-out name: music21’s
parseSpecifier, so"P","perfect"and"Perfect"all giveSpecifier::Perfect. - staff_
distance_ to_ generic_ number - music21’s
convertStaffDistanceToInterval: a signed count of staff steps as a signed generic interval number, so0is a unison,2a third and-1a descending second. - written_
higher_ pitch - The pitch written higher on the staff, whatever it sounds like: music21’s
getWrittenHigherNote, soC4overB#3. Ties in staff position are settled by sound, and a complete tie returns the first. - written_
lower_ pitch - The pitch written lower on the staff: music21’s
getWrittenLowerNote, soB#3underC4.