Skip to content

Scales

The scales module computes note sets for 7 scale types: major, chromatic, pentatonic-major, pentatonic-minor, blues, harmonic-minor, and melodic-minor. Each type is described by a SCALE_DEFINITIONS entry that records its label and how its notes are derived.

getScaleNotes(root, scaleType) is the general-purpose entry point - it accepts any ScaleType and returns the corresponding notes for a given root. getScaleDegrees(scaleType) is its numeric parallel, returning the active scale-degree numbers instead of note names.

getScaleDegree(root, scaleType, note) returns the 1-based position of a note within a scale, or null if the note is absent. isNoteInScale(root, scaleType, note) is its boolean shorthand - both work across every ScaleType.

getMelodicMinorNotes(root) returns the ascending melodic minor scale. getMelodicMinorModeNotes(root, mode) returns any of its 7 modes - Dorian b2, Lydian augmented, Lydian dominant, Mixolydian b6, Locrian nat2, and Altered, alongside melodic minor itself.

getHarmonicMinorModeNotes(root, mode) returns harmonic minor’s modes - currently just Phrygian dominant, alongside harmonic minor itself.

getBebopScaleNotes(root, type) returns one of 3 bebop scale variants - dominant, major, or dorian - each an 8-note scale with a chromatic passing tone.

getBluesNotes

getBluesNotes(root: Note): Note[]

Returns the six-note blues scale for a root.

ResultA, C, D, D#, E, G

getHarmonicMinorNotes

getHarmonicMinorNotes(root: Note): Note[]

Returns the seven-note harmonic minor scale for a root.

ResultA, B, C, D, E, F, G#

getPentatonicNotes

getPentatonicNotes(root: Note, type: PentatonicType): Note[]

Returns the five notes of a major or minor pentatonic scale for a given root.

ResultC, D, E, G, A

getScaleNotes

getScaleNotes(root: Note, scaleType: ScaleType): Note[]

Returns the notes for any scale type - major, blues, pentatonic, harmonic minor, and chromatic.

ResultA, B, C#, E, F#
FlatA, B, Db, E, Gb
EnharmonicA, B, Db/C#, E, Gb/F#

getScaleDegrees

getScaleDegrees(scaleType: ScaleType): number[]

Returns the active scale degrees for a given scale type.

Result[1, 2, 3, 4, 5, 6]

getScaleDegree

getScaleDegree(root: Note, scaleType: ScaleType, note: Note): number | null

Returns the 1-based scale degree of a note within a scale, or null if the note is not present.

Result3

isNoteInScale

isNoteInScale(root: Note, scaleType: ScaleType, note: Note): boolean

Returns true if the note is present in the given root + scale type.

Resulttrue

getMelodicMinorNotes

getMelodicMinorNotes(root: Note): Note[]

Returns the seven notes of the ascending melodic minor scale for a root.

ResultC, D, D#, F, G, A, B

getMelodicMinorModeNotes

getMelodicMinorModeNotes(root: Note, mode: MelodicMinorModeName): Note[]

Returns the seven notes of a melodic minor mode for a root.

ResultC, C#, D#, E, F#, G#, A#

getHarmonicMinorModeNotes

getHarmonicMinorModeNotes(root: Note, mode: HarmonicMinorModeName): Note[]

Returns the seven notes of a harmonic minor mode for a root.

ResultC, C#, E, F, G, G#, A#

getBebopScaleNotes

getBebopScaleNotes(root: Note, type: BebopScaleType): Note[]

Returns the eight notes of a bebop scale variant for a root - a diatonic scale plus one chromatic passing tone.

ResultC, D, E, F, G, A, A#, B