MIDI quantization: snapping onsets to a grid, measured.
Quantization moves every note onset to the nearest point on a rhythmic grid. Measured on this site's own test file, the seven onsets of a single low tone land within 0.18 seconds of a 120 BPM grid — but two pairs collide, at 2.000 s and 4.000 s, so seven onsets become five grid positions. Quantization removes timing jitter, and it also erases the two sub-200 ms gaps that were the only evidence those were separate events at all. Both effects are the same operation, and the tables below show them onset by onset.
Convert a clip and look at the onsetsSeven onsets, one grid, two collisions
The export of the site's 4.40-second multi-tone test file (/examples/midilace-mix-test.wav, MIDI below) contains seven A3 events. Their onsets, snapped to the nearest quarter note at 120 BPM — a 0.5-second grid — produce the table below. The file itself has no tempo event, so 120 BPM is the standard default a player would apply.
| Onset in the export | Nearest grid point | Correction applied | Note |
|---|---|---|---|
| 0.000 s | 0.000 s | 0.000 s | already on the grid |
| 0.986 s | 1.000 s | +0.014 s | 14 ms early |
| 1.823 s | 2.000 s | +0.177 s | collides with the next onset |
| 1.986 s | 2.000 s | +0.014 s | same grid point as 1.823 s |
| 2.985 s | 3.000 s | +0.015 s | 15 ms early |
| 3.821 s | 4.000 s | +0.179 s | collides with the next onset |
| 3.902 s | 4.000 s | +0.098 s | same grid point as 3.821 s |
Read the fourth column as the cost: quantization at this grid resolves seven onsets into five positions — 0.000, 1.000, 2.000, 3.000, 4.000 s. The two colliding pairs were 0.163 s and 0.081 s apart. Those gaps are the only thing distinguishing them from single events, and a grid that coarse wipes them out.
What a 0.500-second grid does to four measured takes
The mix file is synthetic, so the grid test was repeated on the site's real recordings — including the annotated ground truth of the 12-second guitar case. Every row is the same operation: snap every onset to the nearest 0.500 s point and count what survives.
| File | Onsets | Grid positions left | Largest correction | Colliding onsets |
|---|---|---|---|---|
| 4.40 s multi-tone mix (export) | 11 | 7 | 0.242 s | 2.000 s ×3; 3.000 s ×2; 4.000 s ×2 |
| 4.40 s hum take (export) | 32 | 9 | 0.247 s | nine grid points hold 2–5 onsets each |
| 5.0 s piano recording (WAV export) | 29 | 11 | 0.248 s | nine grid points hold 2–5 onsets each |
| 8.7 s voice recording (WAV export) | 46 | 16 | 0.247 s | fifteen grid points hold 2–6 onsets each |
| 12 s solo guitar (MP3 export) | 51 | 25 | 0.238 s | sixteen grid points hold 2–5 onsets each |
| 12 s solo guitar (annotated ground truth) | 44 | 24 | 0.240 s | fourteen grid points hold 2–4 onsets each |
The last row is the one to sit with: the human annotation is not on the grid either. The annotated notes of the 12-second guitar case were placed by ear against the recording, and snapping them to 0.500 s quarters would move some of them by up to 0.240 s. If a hand-made answer key does not live on a 0.5-second grid, a default quantize pass is not "correcting" the export toward the truth — it is imposing a meter the performance may not have.
What the grid fixes, and what it hides
It fixes real jitter. The corrections in the first table are up to 179 ms, which is far beyond musical timing — the annotated guitar case on this site found mean timing error of 15 to 17 ms on notes it did find, and treats 80 ms as its match window. Onsets sitting 98 to 179 ms off the grid are more likely estimation noise than played rubato, and quantization is the right tool for them.
It merges events that were separate. Two pairs above now share a grid point. If the export had split one gesture into two — the 0.081-second gap is a strong candidate — quantization makes the split permanent and invisible. Nothing in the file records that a merge happened.
It does not rejoin a chopped tone by itself. The seven A3 events are one continuous 219.8 Hz tone in the measured spectrum. Quantizing their onsets changes their start times; it does not shorten their count. Rejoining needs a second step — merge same-pitch events on the same grid point — and that step is a musical judgement, not a grid setting.
It cannot invent a meter. The grid assumes the music lives on your chosen grid. A swung feel, a rubato intro, or the irregular gaps measured here (0.986, 0.837, 0.163, 0.999, 0.836, 0.081 s) do not; quantizing them flattens exactly the detail you were trying to read.
How to quantize without lying to yourself
- Choose the grid from the recording, not the export. Tap the beat while listening. If the take swings, quantize at half the grid and check by ear, or do not quantize at all.
- Quantize a copy, keep the raw events. The measured export is the evidence; the quantized version is an interpretation. Comparing them is how you find what the grid erased.
- Merge same-pitch events that share a grid point — deliberately. On this file that is the two colliding pairs. Decide each one by ear: two chord tones of one gesture, or two real notes?
- Apply the 80 ms test to anything you keep. This site's annotated case calls a note found when it lands within 80 ms of the annotation. Events that only make sense inside 80 ms of each other are artefacts far more often than notes.
- Re-check the low lane last. The sustained-tone problem — a held note chopped into seven — is a duration problem, not an onset problem. Quantization never fixes it; merging does.
Used that way, quantization is a cleanup of estimation noise, measured here at up to 179 ms per onset. Used without the merge step and the listening checks, it quietly manufactures notes that were never played separately.
Questions about quantization
Does quantization make the MIDI more accurate?
More accurate to a grid. On the measured file it removed up to 179 ms of onset error per event, and in exchange it merged two pairs of onsets that were 0.163 s and 0.081 s apart. Accuracy to the grid and accuracy to the recording are different things, and only listening decides which one you needed.
What grid should I use?
The one the recording is actually on. 120 BPM quarters (0.5 s) is the default this file would be read at — it has no tempo event — and it resolved the seven measured onsets to five positions. A swung or rubato take needs a finer grid or none.
Will quantization fix a bass part chopped into seven notes?
No. That is a duration problem: the seven A3 events total 4.006 seconds against one continuous tone in the spectrum. Fix it by merging same-pitch events, not by snapping onsets.
What is the difference between quantize and merge?
Quantize moves onsets to grid points; merge joins events into one. The measured file needs both — quantize first, then merge the two colliding pairs, then check every merged event by ear.
Can I try it on my own track?
Yes. The converter on the home page runs in your browser with no account, processes the recording on your device, and exports standard MIDI that opens in any DAW for the quantize-and-merge steps above.