How software detects tempo and key, why it reads half or double time and confuses relative keys, how to check the numbers yourself, and where they still matter.
@brdn

Labels charting on Beatport right now
Typical BPM ranges for house, techno, drum and bass, trance and more, plus how key and the Camelot wheel matter to DJs and labels.
ProductWhat Fabl measures when you upload a track: tempo, key, genre, mood and a mix report. Which parts use a trained model and which use fixed rules, where each one gets things wrong, and how to fix them.
IndustryWhy a few well-aimed demos beat a hundred sent blind, what a good demo looks like from the label's side, and the limits Fabl puts on sending to keep it that way.
Every DJ app, every store and every analysis tool shows a BPM and a key for your track. They look like facts, but they are estimates: an algorithm listened to the audio and made its best guess. Most of the time the guess is right. When it is wrong, it tends to be wrong in a few predictable ways.
This guide explains how tempo and key detection work, how they fail, how to check them yourself, and why it matters when you are looking for labels. For typical tempo ranges by genre, see BPM and key by genre.
A tempo detector doesn't know where your kick is. It looks at the audio for moments where the energy suddenly rises (an onset: a kick, a snare, a stab), then looks for the time gap that repeats most strongly between those onsets. That gap, turned into beats per minute, is the tempo.
Fabl uses one of the tempo algorithms in Essentia, an open source audio library, running in your browser. Steady four-on-the-floor music is the easy case: a kick on every beat gives the detector an obvious pattern. Things get harder with:
The most common error isn't a wrong number. It is the right pattern at half or double speed.
A 174 BPM drum and bass track has a snare on every second beat, so a detector can lock onto 87. A 140 BPM dubstep track feels like 70 and is often read that way. A busy hi-hat pattern at 120 can be read as 240.
Fabl applies a simple correction for electronic music: if the reading is below 90 BPM, it is doubled, and if it is above 180, it is halved, as long as the result lands between 90 and 180. That fixes most drum and bass and dubstep readings. It also means two kinds of track come out wrong:
If your track is outside 90 to 180, check the number and correct it.
When you write the tempo in a demo email, use the one a DJ would count. A drum and bass label expects 174, not 87.
A key detector listens for which of the twelve notes are strongest across the track. It builds what is called a chromagram: the energy in each pitch class (C, C sharp, D and so on, regardless of octave) over time.
It then compares that profile with templates for each of the 24 major and minor keys. A minor key template weights the root, the minor third and the fifth heavily, for example. The key whose template fits best is the answer. Fabl uses Essentia's key extractor, tuned to A = 440 Hz.
This works well on music with clear harmony: chords, a bassline that moves with them, a melody in the key. It is an estimate, and it gets less reliable as the harmony gets less clear.
The common errors, roughly in order of how often you will see them:
Different apps often disagree on the same track for these reasons. Neither is necessarily broken.
DJs often write keys as Camelot codes, a wheel of 12 numbers with A for minor and B for major. Keys next to each other on the wheel mix smoothly.
| Camelot | Key | Compatible keys |
|---|---|---|
| 8A | A minor | 7A, 9A, 8B |
| 8B | C major | 7B, 9B, 8A |
| 9A | E minor | 8A, 10A, 9B |
| 7A | D minor | 6A, 8A, 7B |
The rule is simple: the same code, one step either way with the same letter, or the same number with the other letter (the relative major or minor). Notice that the two most common detection errors, relative major and minor and a fifth away, are all neighbors on the wheel. A slightly wrong key often still mixes.
Fabl also shows a mood (Happy, Relaxed, Aggressive or Sad) and an energy value. These are not from a trained model. They are rough estimates from how loud and how bright the track is. Treat them as a loose description. Label matching doesn't search on them, and you can change them on the track page if they don't describe your track.
Fabl's label matching no longer searches on tempo and key. It compares how your track sounds with how each label's newest releases sound, which turned out to find the right labels far more often than any search on tempo, key and genre. How Fabl matches your track to labels by sound has the details and the test behind it.
Tempo and key still matter where people read them: in your demo email, on your share page and in a DJ's library. A drum and bass track listed at 87 BPM, or a track in A minor listed as C major, makes the reader wonder what else is off. If either is wrong, edit it on the track page.
How genre is detected, and where it slips, is covered in what Fabl's track analysis measures.