ihateaudio

BPM Detector

Drop a track in and read the number.

Drop an audio file here

or paste one from your clipboard

MP3 · WAV · M4A · AAC · OGG · FLAC and moreYour file stays on your device. Always.

How to use it

  1. Drop the track onto the page. Analysis starts as soon as it has decoded. There is no button to press and nothing to download afterwards.
  2. Read the tempo. The figure underneath it tells you in plain words how clear the beat was, which matters more than the number itself.
  3. If the reading looks wrong, drag a selection across a section with a steady, drum-led beat and switch on "Measure the selection only". Intros, breakdowns and applause all confuse the measurement.
  4. Check the half-time and double-time rows before you trust the answer. Autocorrelation cannot tell 87 BPM from 174 BPM, so pick whichever matches how you count the track.

How a computer finds a beat

A beat is not a thing in an audio file. There is no marker in the data saying "kick drum here". There is only a long list of sample values. Tempo detection has to infer the pulse from how the energy in those samples changes over time.

The first step is an onset envelope. The file is chopped into 10-millisecond frames, the energy of each is measured, and the difference between consecutive frames is kept only when it is positive. That last detail is what makes the method work: a drum hit is a sudden rise in energy, while the decay afterwards is a fall, so keeping only the rises turns a continuous waveform into something close to a list of attacks.

The second step is autocorrelation. The onset signal is compared against a copy of itself shifted forward in time, once for every plausible beat spacing. When the shift happens to match the real beat period, peaks land on peaks and the correlation score jumps. The best- scoring shift is the beat period, and 60 divided by it gives beats per minute. How far that best score stands above the average of all the others is what the confidence line reports.

Octave errors, and why 87 and 174 are the same answer

Autocorrelation has one structural weakness. If onsets repeat every half second, they also repeat every quarter second and every full second, so those shifts correlate strongly too. The algorithm has no musical opinion about which one you would call the tempo, all three describe the same grid. This is known as an octave error, and every tempo detector has it, including the ones inside professional DAWs.

The usual mitigation, used here, is to fold the answer into the range most music occupies, roughly 70 to 180 BPM. That is right far more often than it is wrong, and wrong in predictable places: drum and bass genuinely runs at 174, not 87, and a slow hip-hop track written at 140 is normally counted at 70. That is exactly why the half-time and double-time rows are shown next to the main figure rather than hidden. Pick the one that matches how you would tap your foot.

When the number is meaningless

Some material has no measurable tempo, and a detector that returns a confident figure anyway is lying to you. Solo piano with pedal, orchestral strings, ambient pads, spoken word and unaccompanied vocals all lack the sharp attacks the envelope depends on. So does anything with heavy applause or crowd noise, which fills the envelope with rises that have nothing to do with the beat.

Live recordings are a softer version of the same problem. A human drummer drifts by a percent or two across a song, so the correlation peak spreads out and the answer becomes an average rather than a value. If you need to match a tempo to a live recording, measure a short, steady section with the selection switch and treat the result as a starting point for thetempo changer rather than a fact.

Questions

How does it find the tempo?
It builds an energy envelope from 10-millisecond frames, keeps only the rises so that attacks count and decays do not, and then correlates that onset signal against a time-shifted copy of itself. The shift that lines the onsets up best is the beat period. Sixty divided by that period, in seconds, is the BPM.
Why did it report half or double the tempo I expected?
Because both answers are mathematically correct. If beats land every 0.5 seconds they also line up every 1.0 and every 0.25 seconds, so autocorrelation peaks at all of them. The detector folds its result into the 70–180 range where most music sits, which is right for pop and house and wrong for drum and bass or a slow ballad. The half-time and double-time rows exist so you can pick the one that matches how you actually count.
What counts as a good confidence reading?
Anything described as high confidence came from a clear, repeating peak and is usually exact on grid-locked electronic music. A fair reading is normally correct within a beat or so. An unclear reading means no single spacing stood out. Treat the number as a guess and re-run it on a selected section with obvious percussion.
Can it handle a track whose tempo changes?
Not as a single figure, no. The measurement assumes one steady tempo across whatever it is given and reports one number, so a track that speeds up halfway lands somewhere between the two. Select each section separately and measure them one at a time.
Does it find the downbeat or the time signature?
No. It measures the spacing between beats and nothing else, so it does not know where bar one starts, whether the track is in 4/4 or 3/4, or where the first kick lands. Those need a different kind of analysis. For beat-matching purposes the spacing is what you need anyway.
Why does a live or classical recording give a poor result?
Rubato, orchestral swells and human timing all smear the onset peaks that the method depends on. A string section has no sharp attack to detect, and a drummer who breathes with the music produces a spacing that wanders by several percent. Anything programmed to a grid measures cleanly; anything played to feel does not.
Is it accurate enough to beat-match a set?
For anything produced on a grid, the reading is normally exact or within a tenth of a BPM. For live-played material, verify by ear before you trust it. Nothing is uploaded either way, so you can run it over a promo you have not released yet.