A copy of the underlying plain KeyScale.
The spelled tonic.
The tonic pitch class (0..11).
Whether the scale has a minor third and no major third.
StaticmajorA major key.
Tonic as a note name (e.g. 'Eb') or a pitch class; a numeric
root is spelled with whichever accidental side yields the fewest
accidentals across the scale.
The major key.
StaticminorA natural-minor key.
Tonic as a note name or a pitch class; a numeric root is spelled with whichever accidental side yields the fewest accidentals across the scale.
The minor key.
StaticnamedA key on a named scale (e.g. 'dorian', 'harmonicMinor').
The scale name, a key of the scale module's named-scale table.
Tonic as a note name or a pitch class.
The key.
StaticofThe scale's pitch classes in ascending scale-degree order (degree 0 first).
One pitch class per scale degree.
The spelled scale, one note per degree (e.g. C D E F G A B for C major).
Spelled octave-less notes in scale-degree order.
The spelled scale as letter-name strings.
One name per scale degree.
Build a chord on a scale degree, carrying this key as context.
With an explicit quality the quality's interval template is attached to the degree's diatonic root; without one the scale-correct diatonic triad is stacked (e.g. a diminished triad on the leading tone of a major key).
0-based scale degree of the chord root.
Optionalquality: ChordQuality
Optional chord quality.
The chord, with this key attached.
The diatonic triad on a scale degree, carrying this key as context.
0-based scale degree of the chord root.
The triad, with this key attached.
The diatonic seventh chord on a scale degree, carrying this key as context.
0-based scale degree of the chord root.
The seventh chord, with this key attached.
Build the chord denoted by a Roman numeral in this key (including applied
chords such as 'V7/V'), carrying this key as context.
The Roman numeral.
The chord, with this key attached.
Whether a pitch belongs to the scale.
A MIDI pitch, bare pitch class, or note.
True if the pitch class is a scale tone.
The plain key data, for JSON serialization.
Private class fields do not serialize, so an explicit toJSON keeps
JSON.stringify(key) from collapsing to {}. The result pairs the
KeyScale with the spelled tonic, enough to reconstruct the key via
Key.of.
The key/scale and its spelled tonic.
An immutable key/scale: a
KeyScale(root pitch class plus mode mask) paired with a spelled tonic that anchors letter-name spelling. Acts as the factory for key-aware chords.Example