Skip to content

Scales

The scales module computes note sets for six scale types: 'major', 'chromatic', 'pentatonic-major', 'pentatonic-minor', 'blues', and 'harmonic-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.

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#

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