Static ReadonlymajorKrumhansl-Kessler major weights, the default profile (KEY_PROFILES.krumhansl.major).
Static ReadonlyminorKrumhansl-Kessler minor weights, the default profile (KEY_PROFILES.krumhansl.minor).
StaticdetectDetects the most likely key based on an array of notes.
Each note counts once, or by its duration when durations is given (as in the original
Krumhansl-Schmuckler algorithm). Notes outside 12-TET count for the nearest 12-TET pitch class.
The notes to analyse.
Optionaldurations: readonly number[]Optional duration of each note, in any unit (only proportions matter).
profile: which key profile to correlate with (default Krumhansl-Kessler); modes: also read church modes.
Array of possible keys sorted by confidence (Pearson correlation coefficient).
Pearson correlation with the profile, -1 to 1.
Key name with a capitalized mode: 'C Major', 'Eb Minor'; with modes, the first may be a church mode ('D Dorian').
StaticdetectDetects the most likely key from a pitch class histogram (index 0 = C, 1 = C#/Db, … 11 = B), e.g. total durations per pitch class accumulated over a piece.
12 non-negative weights.
profile: which key profile to correlate with (default Krumhansl-Kessler); modes: also read church modes.
Array of possible keys sorted by confidence; empty when all weights are 0.
Pearson correlation with the profile, -1 to 1.
Key name with a capitalized mode: 'C Major', 'Eb Minor'; with modes, the first may be a church mode ('D Dorian').
Key Detection Module Implements correlation key finding (Krumhansl-Schmuckler) with a choice of key profiles.