Why key finders disagree (and which answer to trust)
Key finders disagree because they estimate a key by matching a track's pitch content against templates of the 24 major and minor keys, and many tracks fit two or three templates almost equally well. Most disagreements are between relative keys (A minor and C major), keys a fifth apart (C and G), or the same tonic in major and minor (C and C minor). Modes, drums, distorted bass, key changes, detuned recordings and different notation make it worse.
How does a key finder work?
Most key detectors, the open-source ones and the ones inside DJ software alike, follow the same basic recipe:
- Measure how much energy the track has at each of the 12 pitch classes (C, C sharp, D and so on), folding every octave together. This is called a chromagram; Essentia's version is the HPCP, the harmonic pitch class profile.
- Compare that 12-number summary against a template for each of the 24 major and minor keys.
- Report whichever key fits best.
The templates are where tools start to differ. The classic ones come from Carol Krumhansl and Edward Kessler's listening experiments in the early 1980s, where people rated how well each note fitted a key. Later researchers built templates from musical scores or from large sets of electronic dance music. Essentia alone ships a whole menu of profiles. Two tools with different templates can look at the same chromagram and pick different winners, especially when the top two are close.
So a key finder never "hears" the key the way you do. It measures which notes are loudest and most frequent, then makes a statistical best guess. Usually the guess is good. When it isn't, the mistake almost always falls into one of a few patterns.
What are the most common key detection mistakes?
Here are the usual confusions, using C major as the example.
| Confusion | C major mistaken for | Why it happens |
|---|---|---|
| Relative key | A minor | Exactly the same seven notes, different home note |
| Fifth above | G major | Shares six of seven notes (only F vs F sharp differs) |
| Fifth below | F major | Shares six of seven notes (only B vs B flat differs) |
| Parallel key | C minor | Same tonic, and the tonic dominates the chromagram |
These are common enough that MIREX, the long-running research benchmark for music analysis, scores key detection with partial credit for exactly these neighbours: half a point for a fifth, 0.3 for the relative key and 0.2 for the parallel key. If the researchers grading the algorithms treat these as near misses, you can too.
The practical upshot: when two tools disagree, check the relationship between their answers first. If one says A minor and the other says C major, they've both found the same scale and differ only on the home note. You can settle that by ear in about ten seconds. The method is in how to find the key of a song, and the full list of pairs is in relative major and minor keys.
Why do modes confuse key detectors?
Most detectors only have templates for major and minor. Plenty of music doesn't sit in either.
- A tune in D Dorian uses the notes of C major but treats D as home. It sounds minor with a bright sixth. Detectors tend to call it D minor or C major, and neither is quite wrong.
- A tune in G Mixolydian also uses the notes of C major, with G as home. Lots of rock and funk lives here. You'll see G major and C major in the results.
- E Phrygian, again the notes of C major with E as home, turns up in some metal and flamenco-influenced music. Expect E minor, A minor or C major.
In all three cases the tool is being asked to force a mode into a major/minor box. Different templates force it into different boxes.
Do drums and bass affect key detection?
Yes, more than people expect. Drums are mostly noise spread across every pitch class, which blurs the chromagram and lowers the contrast between the right key and its neighbours. Tuned kicks, toms and long 808s aren't noise, though. They pile a lot of energy onto one or two notes, and if an 808 spends the track on the fifth of the key, it can drag the answer towards the dominant.
Distortion makes it stranger. A distorted bass note produces strong harmonics. The third harmonic of A is an E (an octave and a fifth up), which strengthens the fifth. The fifth harmonic is a C sharp (two octaves and a major third up), which can nudge an A minor track towards A major. Heavily saturated basslines are one of the reasons parallel major/minor mistakes happen at all.
What if the song changes key?
A single key per file assumes the track stays put. When the last chorus jumps up a tone, or a bridge moves to the relative minor, the tool reports whichever key dominates overall, or a key that splits the difference. Two tools weighting sections differently will split it differently. keyandbpm reports one key per file and doesn't detect key changes within a track, so if you suspect one, trim the sections and check them separately.
Can tuning make key finders disagree?
It can. A record that runs 40 or 50 cents sharp sits almost halfway between two keys. A tool that assumes A440 will round the notes to whichever semitone is nearer, and two tools can round different ways. Older records, sped-up or slowed-down edits and anything played from vinyl at slightly wrong speed are the usual suspects (background in why old records sound out of tune).
The keyandbpm analyser measures the recording's own tuning first, shows it as Hz of A4 and cents from 440, and reads the key against that tuning. A detuned record still gets the key it's actually played in.
Sometimes they agree and just write it differently
Before assuming a disagreement, check the notation. A few things that look different but aren't:
- Enharmonic spellings: D flat major and C sharp major are the same pitches, as are E flat minor and D sharp minor.
- Camelot codes: 8A is A minor and 8B is C major. See the Camelot wheel explained for the full table.
- Open Key notation, used by some DJ software: 1m is A minor and 1d is C major.
keyandbpm itself shows plain key names and no Camelot codes, so if you're comparing it against a DJ app, convert first.
What does the key strength figure mean?
keyandbpm shows a strength figure from 0 to 1 next to the key. Think of it as how well the track's pitch content matches the best key template. A high figure means a clear fit; a low one means the track matches its best key only loosely, which usually means other keys are close behind.
How I use it: with a high figure I trust the answer and move on. With a low one I assume the right answer might be one of the neighbours in the table above, starting with the relative key the analyser lists, and I check by ear. Short loops, drum-heavy tracks and modal tunes tend to score lower. In those cases the low number is an honest reading of ambiguous music.
Which key finder should I trust?
My opinion: trust your ear for the final call and use any detector to narrow it down. When two tools disagree, the answer is nearly always one of their two results, and they're nearly always related by one of the patterns above.
For DJing, the stakes are lower than they look. Relative keys share every note, so a mix between an A minor track and a C major track works whichever label is "right". More on that in harmonic mixing for DJs. For producing over a sample, get it right by ear, because you'll be writing notes against it.
Questions people ask
Why does Rekordbox say a different key than another key finder?
Different tools use different pitch analysis and key templates, so close calls go different ways. Check whether the two answers are relative keys, a fifth apart, or the same tonic in major and minor; that's almost always the case.
Which is right if one tool says A minor and another says C major?
Both have found the same notes. The right answer is whichever note the song treats as home, which you can hear by humming the note the track resolves to.
Can a key detector tell if a song changes key?
Most return one key per file, including keyandbpm. Trim each section and analyse it separately if you think the key changes.
Is a low key strength a bad result?
It's a warning, not a failure. It means the track fits several keys nearly as well as its best one, so check the relative key and the key a fifth away by ear.
Does a Camelot code mean a different key from a plain key name?
Not necessarily. Camelot codes are another way of writing the same 24 keys, so 8A is simply A minor. Convert to the same notation before comparing.