Tempo detection is a question about repetition, not about beats. Where the energy rises is an onset; the interval those onsets repeat at is the tempo. Load a song and the number comes with its grid: every beat on the waveform, the bar lines numbered, and a curve that shows where the playing pushed and where it pulled back.
The grid
Every 5 ms the spectrum is compared with the previous window and only the bins that got louder are counted. That is spectral flux, and it marks the start of notes far more reliably than a level meter, which cannot tell a new note from a sustained one.
The flux is autocorrelated across every interval between 60 and 200 BPM, weighted toward the tempos people tap, and the best interval becomes the tempo. The beats are then placed one at a time: each frame scores its own onset strength plus the best beat one interval before it, with a penalty for an interval that is not the tempo. The path with the highest score is the grid. A rushed fill or a slowing outro is followed rather than averaged away.
Beats are the short ticks at the foot of the waveform. Bar lines run the whole height and carry their number.
Half and double time
A steady pattern correlates with itself at half and at double the tempo, and both are musically valid readings. Drum and bass at 174 BPM is also 87 BPM to anyone counting on the half.
The candidate list shows the alternatives with their relative strength, and each is a button. The Tempo control’s ½ and ×2 do the same from the headline reading, and the grid is rebuilt from the file’s own onsets at the new tempo rather than scaled.
The one and the meter
Two cues say where the bar starts. The first beat of a bar usually carries the most energy, the kick and the bass landing together. The harmony usually changes there too, which the chromagram shows as a jump between one beat’s pitch classes and the next’s. Each beat gets a salience from the two, and the phase whose beats stand furthest above the rest is the one.
The same contrast decides between 3/4 and 4/4. Four is kept unless three wins by a quarter, because most music is in four and a waltz read as 4/4 is a smaller error than a 4/4 song read as a waltz. Either choice can be overridden, and The one is beat moves the bar lines by one beat at a time.
Steady or following
A drummer who played to a click sits within a few milliseconds of a constant grid for the whole song. A band in a room does not, and a grid that pretends otherwise puts the bar lines early in the chorus and late in the verse.
The tempo curve under the waveform shows which case this is: local tempo over eight beats, with the fitted tempo as a dashed line. Steady fits the line and regenerates the beats on it, which is right for a production made in a DAW. Follows keeps the beats where they were played. Auto chooses Steady when the playing stays within 25 ms of the line.
Tempo map
The MIDI file is the grid in the form a DAW imports as a tempo track: one tempo event per bar, computed from that bar’s own length, so every click lands at the second the song has it. Tick 0 is the start of the audio; the beats before the first one are a lead-in at their own tempo, and the time signature is written on the first one, where Reaper starts bar 1. Logic and Cubase read the tempo events too; a DAW that only changes meter on a bar line keeps its own bar 1, with the clicks still on the beats. A drum track given the same file plays a side-stick on every beat, accented on the one.
A steady grid writes a single tempo. A followed grid writes one per bar, so a live recording can be edited to its own grid rather than to a constant one.
Click track
A WAV of the song’s length, a click on every detected beat, the one accented and pitched a fifth up. Dropped onto a track beside the song it lines up from the first sample, and a listen settles the grid: a click that drifts against the drums is a wrong tempo, a click that lands on beat two is a wrong one.
Song with click mixes that click into a copy of the file, in the file’s own format, for checking on headphones or sending to a drummer who will play to the original.
Markers for Oxyd and Audacity
Download markers writes the bars and beats as text. The CSV opens in Oxyd as two marker lanes, Bars and Beats, so cuts and clips snap to the song’s grid in a multitrack project. The labels file opens in Audacity as a label track. JSON carries the same times for anything else.
Beat lengths
The table converts the tempo into the numbers other tools take.
At 128 BPM a beat is 468.8 ms, a 1/8 note is 234.4 ms, and a dotted 1/8 is 351.6 ms, which is the delay setting that makes a repeat land between the beats. The rate in hertz, tempo divided by 60, is what a tremolo or an auto-pan needs for one cycle per beat.
Where it fails
Rubato, a tempo change partway through, and a piece with no percussion produce either a low confidence or nothing at all. A sustained chord is rejected rather than read as a tempo: its spectrum ripples rather than spikes, and a ripple is turned away before any interval is scored. Very soft legato playing with no attacks can be turned away with it.
Odd meters are read as 3/4 or 4/4, whichever fits better. A song with a long rallentando is better served by Follows than by Steady, and the tempo curve will say so.