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, including the spellings derived from any attached key.
The chord read structurally: the triad it is built on, its seventh, and the alterations, additions and omissions on top of them.
The reading comes from the tones themselves, so a chord no symbol names — a detected pitch set, a custom interval template — still describes itself; only a template with no structural reading at all falls back to the one its quality names.
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: string | number
Optional slash-chord bass, as a note name (e.g. 'Bb') or a
pitch class. A named bass keeps its own spelling.
The chord (without key context).
StaticfromStaticfromRebuild a chord from its Chord.toJSON output.
The key context is not serialized, so the result carries none; re-attach one with Chord.withKey.
The serialized chord.
The wrapped chord.
StaticfromThe chord a figured bass names: a bass note, the figures written under it, and the key that supplies every interval the figures leave unaltered.
The inverse of Chord.figuredBass, and a static because the figures
build a chord rather than read one. The result carries the given bass as
its slash bass, so an inversion reads as one wherever a bass is measured
against a root, and it keeps the letters the figures asked for. A moving
figure such as 4-3 yields the chord it resolves into.
No key context is attached — the key here decides what the figures mean, not how the chord is later analyzed — so use Chord.withKey to carry one on.
The chord the figures name (without key context).
If the figures are malformed or name no chord, if the key is not heptatonic, or if the figures sound a chord no ChordQuality names.
StaticparseParse a lead-sheet chord symbol (e.g. 'Cmaj7', 'F#m7b5', 'C/G').
A symbol is English unless a system is asked for: unlike Key.parse,
which reads the notation system off the name, 'B' here is always the B
natural until 'german' says otherwise.
The chord symbol.
Optionalopts: NoteNameOptions
system reads the root and bass in that notation system
instead of English.
The chord (without key context).
If the root or quality is not recognized. Use Chord.tryParse where failure is ordinary, such as a chord field read on every keystroke.
StatictryParse a lead-sheet chord symbol, reporting failure instead of throwing it.
The same reading as Chord.parse, for the callers where a symbol
that does not parse yet is the normal state of the input rather than a
fault: a chord field can show what is wrong with what has been typed so far
without a try around every keystroke.
The chord symbol.
Optionalopts: NoteNameOptions
system reads the root and bass in that notation system
instead of English.
The chord (without key context), or the error explaining why the text is not one.
StaticdetectIdentify the chords matching a set of pitches, best interpretation first.
MIDI pitches or bare pitch classes.
Optionalopts: DetectChordOptions
How to interpret the input; see DetectChordOptions.
Ranked chord interpretations (may be empty).
StaticdetectIdentify the chords matching a set of pitches, keeping each match's recognition metadata beside the chord.
Chord.detect discards the confidence signals a recognition UI needs — whether the set matched exactly, which chord tones were missing, which input notes were foreign, and which inversion the bass implies.
MIDI pitches or bare pitch classes.
Optionalopts: DetectChordOptions
How to interpret the input; see DetectChordOptions.
Ranked interpretations, each with its chord and its match record.
StaticdetectThe single best chord interpretation of a pitch set.
MIDI pitches or bare pitch classes.
Optionalopts: DetectChordOptions
How to interpret the input; see DetectChordOptions.
The top-ranked chord, or null when nothing matches.
A copy of this chord carrying the given key context.
Only a spelling the caller supplied (via Chord.parse, Chord.of with a
named root, or plain data carrying a hint) survives; a spelling that came
from a previously attached key is re-derived, so re-keying a progression
during a modulation does not keep the old key's letters and the order of
withKey calls does not affect the result.
The new chord.
The chord's sorted, deduplicated pitch classes.
A slash bass is one of them, because the chord sounds it.
Optionalopts: { includeBass?: boolean }
Set includeBass: false to enumerate the interval template
alone, leaving a slash bass out.
Pitch classes ascending in [0, 11].
Whether a pitch is one of the chord's tones, ignoring octave.
A slash bass counts, as it does in Chord.pitchClasses: the chord sounds it.
A MIDI pitch or a bare pitch class.
True when the pitch class belongs to the chord.
A pitch's harmonic role in the chord: root, third, fifth, sixth, or seventh.
The role follows the pitch's interval above the root, so it answers for the
chord's own template rather than for the interval alone: the diminished
fifth of a half-diminished seventh is its fifth, while the same interval
over a chord that already has a perfect fifth is a #11 tension and has no
basic role.
A MIDI pitch or a bare pitch class.
The chord-tone role, or null when the pitch is a tension or a foreign note.
The chord's Roman numeral in a key.
Optionalkey: KeyLike
Key to analyze in, as a key name, a plain key/scale, or a Key; falls back to the carried context.
Optionalopts: ChordToRomanOptions
Applied-numeral rendering options.
The Roman numeral string.
The chord's Roman numeral together with the reasoning behind it: the degree its root was read as, the quality that set the numeral's case and suffix, and what became of the bass.
The numeral is exactly the one Chord.roman gives for the same
arguments, so this is that method with its rationale attached — for
teaching material, and for any interface whose users argue with the
analysis. Ask for alternatives to see the numerals the other option
settings would have rendered, and why this one was rendered instead.
Optionalkey: KeyLike
Key to analyze in; a key name, a plain key/scale, or a Key. Falls back to the carried context.
Optionalopts: ExplainRomanOptions
The rendering options Chord.roman takes, plus
alternatives to collect the readings this one turned down; see
ExplainRomanOptions.
The numeral, its rationale, and the rejected readings.
The chord's harmonic function (tonic / subdominant / dominant) in a key.
The harmonic function.
Full functional analysis: function, borrowing, Roman numeral, and the rationale behind them.
Optionalkey: KeyLike
Key to analyze in, as a key name, a plain key/scale, or a Key; falls back to the carried context.
Optionalopts: AnalyzeChordOptions
Applied-numeral rendering options, plus alternatives to
collect the readings this analysis turned down; see
AnalyzeChordOptions.
The chord analysis.
The origin of a non-diatonic chord (parallel mode or Neapolitan), or null.
The borrowing source, or null.
The chord written as the figures a bass would carry under it: 6, 64,
7, 65, 43, 42, or nothing at all for a root-position triad, with an
accidental on any interval the key does not already give.
The bass the figures are measured above is the chord's own slash bass, or its root in root position.
The figures, as realizeFiguredBass reads them.
The chords that can stand in for this one in a key: its tritone substitute, the diatonic triads a third away that share two of its tones, the parallel-mode chords with its harmonic function, and its chromatic mediants.
Each candidate carries the relationship it realizes, its Roman numeral, and its harmonic function in the key.
Optionalkey: KeyLike
Key the substitution is read in; a key name, a plain key/scale, or a Key. Falls back to the carried context.
Optionalopts: SubstituteOptions
Set melodyPcs to the pitch classes a melody holds over this
chord, so only substitutions that keep every one of them a chord tone are
proposed.
The deduplicated candidates; the chords are plain data, spelled the way the key writes them.
The modal-interchange palette of the chord's key: the parallel mode's triads that the key itself does not contain, plus the Neapolitan, each with its Roman numeral and its borrowing source.
The palette belongs to the key rather than to this chord, so it is the same list for every chord in it; it is reachable here because a chord is where a caller looking for somewhere else to go already is.
The borrowed chords, spelled the way the mode they come from writes them.
The chord rendered as a lead-sheet symbol (e.g. 'Cmaj7', 'F#m7', 'C/G').
Optionalopts: ChordSymbolOptions
Set flats: true to spell the root/bass with flats, or
system to write them in another notation system.
The chord symbol.
Realize the chord as one MIDI pitch per voice, ascending.
A chord that carries a key passes it to the voicer, so the leading tone is
not doubled; an explicit opts.key overrides it.
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 negative-harmony mirror of the chord about the key's tonic–dominant axis (major becomes minor and vice versa).
The mirrored chord, keeping any key context.
The V7 that tonicizes this chord: a dominant seventh a perfect fifth above this chord's root.
The target is the chord itself, so no key is involved and a borrowed or
chromatic chord gets its dominant as readily as a diatonic one. A root
spelling this chord supplied moves with the root, so Eb gives Bb7.
The secondary dominant, keeping any key context.
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.
Transpose the chord by a number of semitones.
The quality and interval template are carried over, so a chord that a symbol round-trip could not express — a custom interval set, an inversion — survives. A carried key moves with the chord, so the transposed chord keeps the same degree and function inside the transposed key.
The signed semitone offset.
The transposed chord, in the transposed key when one is carried.
Transpose the chord by a spelled interval.
Unlike Chord.transpose, which picks letters from a semitone count, the interval's diatonic number decides them: a C chord up an augmented fourth is F#, up a diminished fifth Gb. As with the semitone form, the quality and interval template are carried over and a carried key moves with the chord.
An interval name (e.g. 'A4', '-m3'), plain interval
data, or an Interval; a descending interval moves down.
The transposed chord, in the transposed key when one is carried.
The named scales that fit over this chord, best fit first, rooted on the chord root.
Only the scales of NAMED_SCALES are ranked: chord-scale theory is a Western practice, so the scales of WORLD_SCALES are left out rather than offered as answers over a chord.
The matching scales.
The scales that fit over this chord, each with the tones it does not state sorted by what may be done with them: the ones to avoid outright, the ones a line may pass through, and the ones that may be added freely as color.
Chord.scales ranks the same scales in the same order; this is that ranking read as playing advice, so a caller does not have to pair it with Chord.avoidNotes and Chord.tensions once per scale.
Optionallimit: number
Greatest number of scales to report; all of them by default.
One entry per reported scale, best fit first; see ChordScaleReportEntry.
The available tensions (usable non-chord, non-avoid scale tones) of a scale over this chord.
A scale of NAMED_SCALES, or one of its aliases, rooted on the chord root. The scales of WORLD_SCALES are refused here as they are by Chord.scales: chord-scale theory is a Western practice, and a scale from another tradition offered over a chord would read as an answer while being a category error.
Optionalopts: AvailableTensionsOptions
Set resolvesTo to the plain chord this one resolves to, so a
dominant resolving down a fifth onto a minor tonic takes the tensions
that resolution makes available; see AvailableTensionsOptions.
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 scale of NAMED_SCALES, or one of its aliases, rooted on the chord root. The scales of WORLD_SCALES are refused here as they are by Chord.scales: chord-scale theory is a Western practice, and a scale from another tradition offered over a chord would read as an answer while being a category error.
Optionalopts: AvoidNotesOptions
Set use: 'melodic' to judge a line rather than a voicing, so
a tone a line may pass through is not counted; see
AvoidNotesOptions.
Avoid-note pitch classes, ascending in [0, 11].
Spell the chord tones with letter names, root first, in the key's spelling.
A chord that already knows how its root is spelled — one from
Chord.parse, or Chord.of with a named root — can spell itself with no
key at all; a key is only needed to choose a spelling for a bare pitch
class.
A slash bass outside the chord tones is appended, so the spelled notes are the notes the chord sounds — the same set Chord.pitchClasses reports.
Spelled octave-less notes in the chord's own (tertian) order, with any foreign slash bass last.
Start a progression with this chord followed by others, carrying this chord's key context (if any).
The chords following this one.
The progression.
The chord placed at a beat, as the ChordSpan the arrangement and generation functions take.
The interval template is recorded only when it departs from the one the quality names, so a standard chord yields the same span it always did while a custom template is not lost. Key context and spelling hints are not part of a span and are left behind.
Beat the chord starts on.
The span describing this chord at that beat.
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.
The chord symbol, so a template literal or a log line reads as the chord.
The symbol, e.g. 'Cmaj7'.
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