DUCKER

Finding the key and tempo of a track

Two songs at the same tempo can still clash badly. What decides it is the key — and the relationship between two keys is something you can read off a wheel.

How a machine finds a key

Key detection works by counting. The audio is cut into short windows, each window is turned into a spectrum, and the energy in that spectrum is folded down into twelve buckets — one per note name, ignoring which octave it came from. That twelve-number summary is a chroma vector, or pitch-class profile. Add them all up across the track and you have a picture of which notes it actually spends its time on.

Then the profile is compared against a template for each of the twenty-four keys — twelve major, twelve minor — and the closest match wins. The templates come from studies of what actual music does: in C major, C and G dominate, F and A appear often, and F♯ almost never.

Why it is sometimes wrong, and how to tell

If a reading looks wrong, check its relative first: the relative minor of a major key is three semitones down (C major → A minor), and the relative major of a minor key is three semitones up.

Tempo, and the half-time problem

Tempo detection looks for regular spikes in how fast the energy is rising — the onsets — and finds the interval that best explains them. It is more reliable than key detection, with one recurring failure: octave errors. A track at 140 BPM with a strong backbeat can read as 70, and a 70 BPM track with busy hi-hats can read as 140. Both readings describe the same music; they just disagree about which pulse is the beat.

The fix is to tap along. If the number you tap is half or double what the detector said, the detector was not wrong so much as reading a different layer, and you can use whichever fits the arrangement you are building.

The Circle of Fifths, as a mixing tool

Arrange the twelve keys so each is a fifth from the last, and neighbours turn out to share six of their seven notes. That is the whole reason the circle is useful: distance on the wheel is dissonance.

DJs often use Camelot notation — 8A, 8B and so on — which is the same circle with numbers instead of key names, so "one step around" becomes "add one" and you do not have to know any theory to use it.

When two tracks do not fit

Three ways out, in order of how well they usually work:

  1. Transpose one of them. Pitching a whole track by a semitone or two is nearly always cleaner than forcing the clash. Doing it the turntable way moves tempo along with pitch, which sounds completely natural but changes the BPM by about 6% per semitone; keylock holds the tempo and shifts pitch digitally, which is fine for a semitone or two and starts to smear past three.
  2. Bridge through a shared note. Hold a drone on a note both keys contain across the transition, and the ear follows it from one to the other.
  3. Cut on a break. If neither track has pitched material at the moment of the change, there is nothing to clash.

Doing it in the browser

Ducker's Mix page loads two tracks, reads the key and tempo of each, places them both on the Circle of Fifths and tells you plainly how far apart they are, what they share, and what to do about it — including which way to transpose and by how much to land somewhere compatible. It will also build a bridge undertone from the notes both keys contain.

The analysis runs in your browser on files you never upload.

Open Ducker and check two tracks → Free, no account. Load two files and read the answer off the wheel.

Common questions

How can I find the key of a song for free?

Load it into Ducker’s Mix page: it analyses the file in your browser and reports the key and tempo without uploading anything. If the answer looks wrong, check the relative major or minor, which shares all the same notes.

Why do two key detectors disagree about the same song?

Almost always because one chose the relative major and the other the relative minor. They contain identical notes, so the choice comes down to which one feels like home, and different algorithms weigh that differently.

What does the Circle of Fifths tell me about mixing two tracks?

How many notes they have in common. Neighbouring keys share six of seven and blend smoothly; keys three or more steps apart share very little and will clash. Relative major and minor share all seven.

Can I mix two songs in different keys?

Yes, if they are close on the circle. If they are not, transpose one of them toward the other, bridge the transition with a note both keys contain, or make the cut somewhere neither track has pitched material.

Why does my BPM read as half or double what it should?

Because both readings describe the same music at a different layer. Tap along; whichever pulse you naturally tap is the one to use for what you are building.