The root pitch class (0..11).
The chord quality.
A copy of the semitone offsets above the root.
The slash-chord bass pitch class, or undefined in root position.
A copy of the underlying plain chord object.
The carried key context, if any.
StaticofBuild a chord from a root and quality.
Root as a note name (e.g. 'Eb') or a pitch class.
The chord quality.
Optionalbass: number
Optional slash-chord bass pitch class.
The chord (without key context).
StaticfromStaticparseParse a lead-sheet chord symbol (e.g. 'Cmaj7', 'F#m7b5', 'C/G').
The chord symbol.
The chord (without key context).
StaticdetectIdentify the chords matching a set of pitches, best interpretation first.
MIDI pitches or bare pitch classes.
Optionalopts: DetectChordOptionsRanked chord interpretations (may be empty).
StaticdetectThe single best chord interpretation of a pitch set.
MIDI pitches or bare pitch classes.
Optionalopts: DetectChordOptionsThe top-ranked chord, or null when nothing matches.
The chord's sorted, deduplicated pitch classes.
Pitch classes ascending in [0, 11].
The chord's Roman numeral in a key.
Optionalkey: Key
Key to analyze in; falls back to the carried context.
The Roman numeral string.
The chord's harmonic function (tonic / subdominant / dominant) in a key.
Optionalkey: Key
Key to analyze in; falls back to the carried context.
The harmonic function.
Full functional analysis: function, borrowing, and Roman numeral.
Optionalkey: Key
Key to analyze in; falls back to the carried context.
The chord analysis.
Whether the chord is borrowed from the parallel mode (modal interchange).
Optionalkey: Key
Key to analyze in; falls back to the carried context.
True if the chord is borrowed.
The origin of a non-diatonic chord (parallel mode or Neapolitan), or null.
Optionalkey: Key
Key to analyze in; falls back to the carried context.
The borrowing source, or null.
The chord rendered as a lead-sheet symbol (e.g. 'Cmaj7', 'F#m7', 'C/G').
Optionalopts: { flats?: boolean }
Set flats: true to spell the root/bass with flats.
The chord symbol.
Realize the chord as one MIDI pitch per voice, ascending.
Optionalopts: VoicingOptions
Voicing options; defaults to four SATB voices.
MIDI pitches, ascending, one per voice.
Realize the chord as a single styled voicing (close, drop2, drop3,
shell, or rootless), optionally constraining the top voice.
Optionalopts: StyledVoicingOptions
Styled-voicing options; defaults to a close-position voicing.
MIDI pitches, ascending.
The n-th inversion: a copy whose bass is the chord tone n steps above the
root in the interval template (invert(1) puts the third in the bass).
n wraps around the template length; negative values count backwards.
invert(0) (and any n that wraps to it) is root position, so it carries
no slash bass and equals the original chord.
The inversion number.
The inverted chord, keeping any key context.
The named scales that fit over this chord, best fit first, rooted on the chord root.
The matching scales.
The available tensions (usable non-chord, non-avoid scale tones) of a scale over this chord.
A named scale, rooted on the chord root.
Tension pitch classes, ascending in [0, 11].
The avoid notes (scale tones a semitone above a chord tone) of a scale over this chord.
A named scale, rooted on the chord root.
Avoid-note pitch classes, ascending in [0, 11].
Start a progression with this chord followed by others, carrying this chord's key context (if any).
The chords following this one.
The progression.
Whether another chord has the same root, quality, intervals, and bass. Key context is not compared.
The chord to compare.
True if the chord data is identical.
The plain chord data, for JSON serialization.
A copy of the underlying plain chord object.
An immutable chord: a root pitch class, quality, interval template, and optional slash bass, optionally carrying a Key context. Analysis methods (
roman,function,analyze, ...) use an explicitly passed key first and fall back to the carried context.Example