How the key is detected
The tool builds a chromagram: for every 0.74-second slice it measures the energy of each of the twelve pitch classes (C, C sharp, D…), across all octaves between 65 Hz and 2.1 kHz. Two corrections reduce classic errors:
- Tuning: the average offset of spectral peaks from A = 440 Hz is measured and compensated.
- Harmonics: a bass note also produces energy at the octave and the fifth. Each note therefore collects the energy of its first four harmonics, and notes that are probably just another note’s harmonic are attenuated. Without this step the tool would often answer the key a fifth above.
The resulting profile is compared with all 24 major and minor keys using the Krumhansl–Kessler profiles (1982), a classic reference in music cognition. The strongest correlation wins.
Reading the agreement score
The track is also cut into 30-second windows analysed separately. High agreement means the key holds from start to finish. Low agreement points to a modulation, a bridge in another key, or barely tonal music (minimal techno, percussion tracks) where key has little meaning.
Using the Camelot code to mix
The Camelot system places the 24 keys on a wheel numbered 1 to 12, with A for minor and B for major. Moving to a neighbouring number (8A to 7A or 9A), or switching between A and B on the same number, gives clash-free blends. The Camelot key converter lists every move from your result.
Limits
- Confusion with the relative key (same Camelot number) remains the most frequent error; it does not matter for harmonic mixing.
- Modal (Dorian, Mixolydian), highly chromatic or melody-free tracks give unreliable results.
- If you pitch a track in your software without key lock, the key you hear shifts by one semitone for roughly every 6% of pitch.