Skip to main content

Module chordsymbol

Module chordsymbol 

Source
Expand description

Lead-sheet chord-symbol parsing.

Structs§

ChordAlteration
A chord-symbol alteration such as b5 or #11.
ChordStepModification
One degree added to, taken from or altered in a chord symbol: music21’s ChordStepModification, and MusicXML’s <degree>.
ChordSymbol
Parsed chord symbol.
ChordSymbolFigure
A chord named as a lead-sheet symbol, in the parts music21’s chordSymbolFigureFromChord writes it from: the root, the kind and its abbreviation, the bass where it is not the root, and the notes the kind does not account for.
ChordVoicing
A chord of one of music21’s kinds as music21 voices it: its pitches, and the root and bass music21 holds as objects of their own. Those move with the chord where it holds them and not where it does not, so they need not be the first note of their name, nor a note of the chord at all: Ab10/F# sounds F#2 Ab3 C#4 E4 over a root of A3.
Music21ChordType
A chord type from music21’s harmony.CHORD_TYPES table.

Enums§

ChordQuality
Tertian quality parsed from a chord symbol.
ChordStepModificationType
What a ChordStepModification does to the chord: music21’s modType.

Constants§

CHORD_KIND_ALIASES
The other names music21 takes for three of its kinds, as MusicXML writes them: music21’s CHORD_ALIASES.

Functions§

abbreviations_for_kind
Every abbreviation music21 accepts for a chord kind: music21’s getAbbreviationListGivenChordType, so dominant-seventh gives 7 and dom7. None for an unknown kind.
alter_to_chord_symbol_string
How a lead-sheet symbol writes an alteration of so many semitones: a b for each semitone down and a # for each one up, so -1 is b, 2 is ## and nought is nothing. music21’s alterToChordSymbolString.
chord_symbol_durations
How long each chord symbol of a stream is held: its position in Stream::leaves and the quarter length from it to the next symbol, the last to the end of the stream. This is the reading realize_chord_symbol_durations writes, for a caller that keeps something of its own beside each element.
chord_symbol_figure_from_chord
Names a chord as a lead-sheet symbol: music21’s chordSymbolFigureFromChord, so C E G B- is C7, E G C is C/E and a lone C is Cpedal. Notes the kind cannot account for are listed after add, and beside them the notes the kind expects but the chord lacks after omit, as music21 writes them. None when no kind fits, where music21 returns the sentence “Chord Symbol Cannot Be Identified”; an empty chord gives an empty string. The parts the figure is written from are ChordSymbolFigure.
chord_symbol_from_chord
A ChordSymbol read off a chord: music21’s chordSymbolFromChord, chord_symbol_figure_from_chord parsed back. None when no kind fits.
chord_symbol_kind_from_chord
The kind of chord a figure is written with: what music21 answers beside the figure when chordSymbolFigureFromChord is asked to include the chord type, so C E G is major and a lone C is pedal.
current_abbreviation_for_kind
The abbreviation music21 writes a chord kind with: its getCurrentAbbreviationFor, the first of abbreviations_for_kind.
inversion_is_valid_for_kind
Whether a chord of this kind can stand in this inversion: music21’s ChordSymbol.inversionIsValid, which reads the kind and not the notes — so a dominant seventh with a ninth added still inverts as a seventh.
known_chord_symbol_types
Returns every chord type this crate knows from music21’s harmony tables.
notation_for_kind
The scale-degree notation of a chord kind: music21’s getNotationStringGivenChordType, 1,3,5,-7 for dominant-seventh.
realize_chord_symbol_durations
Gives every chord symbol in a stream the time it holds for: music21’s realizeChordSymbolDurations.
resolve_kind_alias
The kind an alias stands for, or the kind itself where it is none.
sound_chord_kind
The pitches a chord of one of music21’s kinds sounds on a root, with a bass and chord-step modifications: music21’s ChordSymbol._updatePitches run over the state MusicXML hands it, rather than over a figure.
sound_chord_notation
The same with the kind’s notation handed over rather than looked up: music21’s table can be added to while a program runs (addNewChordSymbol), and a kind added there is sounded from the notation it was added with.
voice_chord_notation
The same, with the root and bass as music21 is left holding them: its _updatePitches in full.