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.
Live Playground
Section titled “Live Playground”getBluesNotes
getBluesNotes(root: Note): Note[]Returns the six-note blues scale for a root.
A, C, D, D#, E, GgetHarmonicMinorNotes
getHarmonicMinorNotes(root: Note): Note[]Returns the seven-note harmonic minor scale for a root.
A, 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.
C, D, E, G, AgetScaleNotes
getScaleNotes(root: Note, scaleType: ScaleType): Note[]Returns the notes for any scale type - major, blues, pentatonic, harmonic minor, and chromatic.
A, B, C#, E, F#A, B, Db, E, GbA, B, Db/C#, E, Gb/F#getScaleDegrees
getScaleDegrees(scaleType: ScaleType): number[]Returns the active scale degrees for a given scale type.
[1, 2, 3, 4, 5, 6]getScaleDegree
getScaleDegree(root: Note, scaleType: ScaleType, note: Note): number | nullReturns the 1-based scale degree of a note within a scale, or null if the note is not present.
3isNoteInScale
isNoteInScale(root: Note, scaleType: ScaleType, note: Note): booleanReturns true if the note is present in the given root + scale type.
truegetMelodicMinorNotes
getMelodicMinorNotes(root: Note): Note[]Returns the seven notes of the ascending melodic minor scale for a root.
C, D, D#, F, G, A, BgetMelodicMinorModeNotes
getMelodicMinorModeNotes(root: Note, mode: MelodicMinorModeName): Note[]Returns the seven notes of a melodic minor mode for a root.
C, 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.
C, 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.
C, D, E, F, G, A, A#, B