Human-readable scale name (e.g. "C Major", "D Dorian").
The tuning system this scale operates in.
Step offset of the root note from A4 (= 0).
Intervals between consecutive scale degrees, in tuning steps. Must be non-empty with all values > 0.
OptionalpreferFlats: booleanOptional flat/sharp preference for note naming in getNotes().
When provided, overrides the root-name heuristic. Set by parseScaleSymbol using
preferFlatsForKey(root, scaleType) for mode-aware accuracy.
Human-readable scale name (e.g. "C Major", "D Dorian").
Optional ReadonlypreferOptional flat/sharp preference for note naming in getNotes().
When provided, overrides the root-name heuristic. Set by parseScaleSymbol using
preferFlatsForKey(root, scaleType) for mode-aware accuracy.
Step offset of the root note from A4 (= 0).
ReadonlystepIntervals between consecutive scale degrees, in tuning steps. Must be non-empty with all values > 0.
The tuning system this scale operates in.
Returns true if the given step (or its pitch class) belongs to this scale. Comparison is by pitch class - octave is ignored.
Returns the diatonic chord built on a single scale degree (1-indexed).
See getDiatonicChords for details on type and naming.
Returns the 1-indexed scale degree of the given step, or null if not in the scale.
Comparison is by pitch class - octave is ignored.
Returns the diatonic chords built by stacking thirds on each scale degree.
'triad' (default): three-note chord (root, 3rd, 5th).'seventh': four-note chord (root, 3rd, 5th, 7th).Chord names are canonical (e.g. Bm7b5, Caug), in 12-TET and in any tuning where every
degree stands for a 12-TET note (retune); otherwise a structural label is used
(e.g. "Step 3(0,5,11)").
Scales with fewer than 5 notes may not support 'seventh' on every degree.
Returns modal characteristics: brightness (relative to Ionian), the degrees that differ from the parallel major, traditional jazz avoid notes, and parent-family info.
characteristicDegrees/characteristicIntervals and avoidNotes are computed in 12-TET
and in any tuning where every degree stands for a 12-TET note; otherwise they are empty.
Brightness uses MODE_BRIGHTNESS; returns 0 if the mode is unknown.
Derives a mode from the current scale by rotating its step pattern.
1-indexed mode degree (e.g. 2 for Dorian if current scale is Major). Must be an integer.
Returns the notes of the scale across the given number of octaves.
The result always includes one extra note at the end: the root repeated one period above the last octave (e.g. 8 notes for a 7-note scale over 1 octave). This matches standard notation and is useful for display.
Number of octaves to span (default: 1).
Returns the parent scale of this mode (e.g. D Dorian → C major), or null if this scale is not a recognized mode of a known family.
Returns the pitch classes of the scale degrees as step offsets within one period
(0 to octaveSteps - 1), starting from the root pitch class.
Does not include the repeated octave note. A 7-note scale returns 7 pitch classes.
Returns the relative mode within the same modal family (e.g. D Dorian → F Lydian). Returns null if the target mode is in a different family or either mode is unknown.
The same scale in another tuning: each degree goes to the step of tuning that stands for
the same 12-TET note (TuningSystem.retuneStep). Name and flat/sharp preference are kept.
The scale in tuning, or null when one of its degrees stands for no 12-TET note
or tuning has no step for it.
Returns a new scale with the same pattern transposed by the given number of steps. Named with the new root and the same type ("C major" +2 → "D major"); the root takes the spelling of the key with fewer accidentals.
A scale: a root pitch plus an ordered pattern of step intervals within a tuning system.
stepPatterndefines the intervals between consecutive degrees in tuning steps (e.g.[2, 2, 1, 2, 2, 2, 1]for major in 12-TET). The pattern is relative - the same pattern at a differentrootStepgives the same scale type in a different key.