MP3 to MIDI: Recording to a Click, and What Drift Costs

Whether to record to a click is a budget question. A click throws your accumulated timing error away on every beat; playing free lets it grow without limit. At 120 BPM a one percent tempo error spends the whole tolerance of a sixteenth-note grid in about six seconds.

Recording to a click, answered

  • For anything you intend to quantize, yes. A click bounds the error instead of letting it accumulate.
  • Drift is time, not a feeling. The offset is the tempo error times the elapsed time: one percent is 0.3 seconds after thirty seconds, 1.8 seconds after three minutes.
  • The tolerance of a grid is half a step. At 120 BPM that is 250 ms on quarters, 125 ms on eighths and 62.5 ms on sixteenths, so one percent spends it in 25, 12.5 and 6.25 seconds.
  • The click you played to is not in the file. A MIDI file stores a tempo value and, optionally, how often a metronome should click.

The tolerance of a grid is half a step

Quantizing moves every note to the nearest line, so a note lands on the wrong line as soon as its offset passes half a step. That tolerance is a fixed amount of time, set by the note value rather than the converter. At 120 BPM a quarter note is 500 ms, an eighth 250 ms and a sixteenth 125 ms, so the tolerances are 250, 125 and 62.5 ms.

Drift accumulates, so the length of the take matters

Play at a steady tempo off by a fraction of the target and the offset from the grid is that fraction times the elapsed time. Nothing has to feel loose: a confident, even performance one percent fast accumulates the same offset.

Elapsed time0.5% error1% error2% error
30 seconds150 ms300 ms600 ms
60 seconds300 ms600 ms1,200 ms
180 seconds900 ms1,800 ms3,600 ms

What a click changes is the shape of the error

A click does not make a player steadier; it makes the error sawtooth instead of linear. Every audible click discards the offset accumulated since the previous one, so the error can never exceed your local beat-to-beat accuracy, however long the take.

The click is not stored in the file

Nothing in a MIDI file records the click you monitored; what it records is a tempo and, optionally, how often a metronome should click. The tempo event, FF 51 03, holds microseconds per quarter note; the specification's own example, 500,000, is 120 BPM. The time-signature event, FF 58 04, carries a field defined as the number of MIDI clocks in a metronome click, and the same specification fixes a MIDI quarter note at 24 MIDI clocks. A click on every quarter note is written as 24, one on every eighth as 12.

One detected tempo splits the error

The jukeblocks Recreate page states that the tempo is detected from the recording and the project is set to it, so the notes land on a matching grid. One number cannot match a performance that drifts: a three-minute take drifting one percent accumulates 1.8 seconds in total, and the best a constant tempo can do is split it — exact in the middle, 900 ms out at each end, which is 7.2 sixteenth-note steps.

What to do

Reduce the question to a budget: decide which note value you want notated, halve it, and compare that with the drift your take accumulates. A steady player one percent off the target has about six seconds of sixteenth-note grid and twenty-five seconds of quarter-note grid before notes land on the wrong line.

If you use a click, record a count-in and keep it out of the recorded track: a fixed-interval broadband transient is the shape a note detector is built to find.

Related