Drop the same track into Rekordbox, Serato, and Mixed In Key, and there's a good chance you'll get three different keys back. Not wildly different. Usually a near miss: one says F minor, the next says A flat major, the third slides a step over and calls it something else. Three tools, three confident answers, one track.
The easy assumption is that two of them are broken. They're not. Working out a track's key is a genuinely hard problem, and electronic music is one of the hardest places to do it. Here's why it's so slippery, and how we work it out inside Ora DJ, in plain terms.
Why a key is hard to hear
- No clear home note (tonal center). Lots of electronic music rides a bass note, a riff, and drums for bars at a time, with little harmony to grab onto.
- The bass drowns the signal. Kick and sub-bass are the loudest things by a mile, so a detector leans toward whatever the low end is doing, which isn't always the key.
- Relative major and minor share every note. A minor and C major use the same seven notes, so a detector flips between them; on the Camelot wheel (more below) they differ only by a letter, 8A vs 8B.
- The perfect fifth pulls it sideways. The fifth is so loud that a track in C gets read as G, one slot off and close enough to miss.
- Tracks don't hold still. The key shifts from intro to breakdown to drop, so "the key" of a seven-minute track is already a simplification.
- Production smears the picture. Reverb and delay blur one note into the next; a track pitched or sped up drifts off the A=440 reference so its notes land between the slots; and drum intros, risers, and diced vocal chops carry no pitch at all.
- Even the humans disagree. Two trained listeners label the same track differently, which is why key scoring gives partial credit instead of demanding one exact answer.
How Ora DJ works out a key
Our approach is deliberately old-fashioned. No model guessing in the dark, no black box. It's plain signal processing you can follow from one end to the other, and that matters more than it sounds like it should. I'll come back to why.
It goes in five steps.
Listen to the whole track. Not a ten-second sample, the whole thing. First we flatten it to mono and downsample it, which is a fancy word for deliberately throwing away audio detail we don't need. For key you don't want hi-fi, just the broad strokes of which notes keep ringing out, and the lighter signal is quicker to work through.
Measure pitch like a piano, not a ruler. Most audio tools chop the frequency range into evenly spaced steps. That's tidy for physics and clumsy for music, where the notes climb unevenly, each octave sitting twice as high as the one below. So we use something called a constant-Q transform. The name is a mouthful; the idea is simple. It spaces its measurements to match music instead of physics, so every semitone gets the same fair, equal-sized slot, like reading a piano keyboard rather than a tape measure.
Tally the twelve notes. Now ignore octaves: a low C and a high C both just count as "C." Fold the whole track down into twelve buckets, one per note name, and count how much of each shows up. That tally is called a chromagram, and it's really just the track's note-mix written as twelve numbers.
This is also where we handle the bass. Before counting, we turn the loudest moments down and give each slice of time an equal vote, so one thunderous kick can't run away with the whole tally. It sounds like a footnote. It was one of the most important things we changed, and I'll come back to it.
Match it against the 24 keys. Every major and minor key has a typical note-mix shape, a kind of fingerprint. Twelve major keys, twelve minor, so twenty-four shapes in all. We hold the track's fingerprint up against all twenty-four and keep the closest match. Those reference shapes aren't guesses, by the way; they're built by studying piles of real music. How closely the track matches its best shape becomes a confidence score, so a clearly tonal track reads high and a murky one reads low.
See the two tracks below, one with a clear tonal center and one far more ambiguous:
Translate it to Camelot. The Camelot wheel is the clock-face of keys DJs mix by: a number from 1 to 12 and a letter, A or B. Neighbours on the wheel sound good together, and so do the two keys that share a number. We hand you the answer there, as 8A or 9B, so it drops straight into harmonic mixing. If the file already carries a key tag from somewhere else, we read that too.
Hover or tap a key to see what mixes with it.
The boring work that actually moved the needle
The honest version of "how we detect key" is a list of things we tried, kept, or threw out. A method you can read top to bottom is a method you can actually fix, which is the real reason we stayed away from a black box.
The biggest single win was taming the bass. Turning the loudest parts down and giving each moment an equal vote, together, measurably lifted our score on a standard electronic-music benchmark (GiantSteps). Neither change did much on its own. Together they fixed exactly the low-end bullying that shoves detectors toward the relative key or the fifth.
We tried several research-grade sets of those 24 reference shapes and kept the one that fit electronic music best. We even built a filter to strip the drums out before counting, felt sure it would help, measured it, and found it made things slightly worse. So it's off. That one stung, but the measurement won.
Some changes were pure speed. Starting the analysis an octave higher and taking bigger steps through the track made the whole thing several times faster while landing on the same answers, because a global key estimate doesn't need sub-bass detail or fine timing.
Where it lands
It won't be right every time. Key is partly a matter of taste, the "correct" answer is genuinely contested, and some tracks simply don't sit in one place. We'd rather tell you that than pretend otherwise. What we can stand behind is a method that's legible: every step, from the note tally to the fingerprint match to the confidence score, is something we can look at when it's wrong and tune when we find something better. And it comes out where you need it, on the same Camelot wheel you already use to decide what mixes into what.