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.
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#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.
true