Keys & Modes
Compute scale notes for any root and diatonic mode, traverse key relationships, and look up note positions and scale degrees. Use the live playground to call any function and inspect its output immediately.
Live Playground
Section titled “Live Playground”getModeNotes(root: Note, mode: ModeName): Note[]Returns all notes in a diatonic mode for the given root.
C, D, E, F, G, A, BScale & Mode Functions
Section titled “Scale & Mode Functions”Scale and mode: getModeNotes, getParentScaleModes, and getModalRoot compute the note set and modal rotations for any root and mode combination.
Key relationships: getRelativeMinorKey, getRelativeMajorKey, getKeySignatureCount, and getCircleOfFifthsOrder find relative keys, sharp and flat counts, and traverse all 12 keys in fifth order.
Note utilities: getSemitoneDistance computes the ascending semitone gap between any two notes. For scale degree lookup and membership checks across all scale types, see getScaleDegree and isNoteInScale on the Scales page. See the Constants page for the full note and mode constant catalog.
Type guards: isNote, isModeName, parseNote, and parseModeName narrow untrusted strings - URL params, user input, or external data - to typed Note or ModeName values before passing them to engine functions. isNote and isModeName are case-insensitive; parseNote and parseModeName return canonical values.