MIDI Quantization: What Happens to Note Ends?
Quantizing MIDI starts corrects when notes begin; quantizing ends can also change how long they last and whether they overlap. After audio-to-MIDI conversion, keep a raw copy, fix obvious false notes, then try start-time correction on a short phrase. Before applying it to the whole file, check whether your editor moves the entire note or leaves its end fixed. Those two operations produce different durations.
This page answers a specific cleanup question: why did a melody become clipped, detached, or more overlapped after its timing looked tidier? The downloadable four-note experiment below separates three editing rules with exact tick positions. It is a constructed MIDI test, not a recording, a listening study, or a benchmark of any DAW.
Three operations that can hide behind a quantize command
- Move starts and preserve duration. Move each note as a block. Its end moves by the same amount as its start. Individual lengths survive, but the gap to the next note can change.
- Move starts and leave ends fixed. Only the onset changes. Moving it earlier lengthens the note; moving it later shortens it. A sufficiently large move could pass the end, so an editor needs a policy for that case.
- Snap both edges independently. Round the start and end to grid positions. This can simplify rhythm, but a short note may have both edges land at the same tick.
Read your editor's controls instead of assuming which rule it uses. The Ardour manual exposes separate start and end options, plus threshold and strength. Logic Pro's documentation describes Classic and Smart Quantize as different approaches; Smart considers groups of events and their relative order. Our simple independent-note arithmetic does not implement either product's full behavior.
Reproduce the four-note timing experiment
We generated four notes at 480 ticks per quarter note and 120 BPM. The grid is 120 ticks, a sixteenth note. One tick lasts about 1.042 ms at this tempo. Pitches and velocities remain identical across all four files. The raw input is deliberately constructed to include a small overlap, a gap, and a short note. It does not represent errors measured from a real musician.
| Note | Raw | Starts, keep length | Starts, fixed ends | Both edges, guarded |
|---|---|---|---|---|
| A | 12–252 (240) | 0–240 (240) | 0–252 (252) | 0–240 (240) |
| B | 247–463 (216) | 240–456 (216) | 240–463 (223) | 240–480 (240) |
| C | 487–518 (31) | 480–511 (31) | 480–518 (38) | 480–481 (1) |
| D | 726–1002 (276) | 720–996 (276) | 720–1002 (282) | 720–960 (240) |
The raw A-to-B gap is −5 ticks: the notes overlap. Preserving durations while moving starts changes that gap to 0. Keeping ends fixed changes it to −12 ticks, increasing the overlap. Snapping both edges also makes it 0. Thus even the duration-preserving choice does not promise to preserve legato relationships.
For note C, rounding both 487 and 518 to the nearest 120-tick point gives 480. That would create a zero-length note. Our script deliberately applies a minimum length of one tick, producing 480–481 instead. This is our safeguard, not a claim about what your DAW does. At the test tempo it leaves roughly 1.042 ms of MIDI gate time; the audible result depends on the instrument's envelope and playback engine.
All four generated files are 69 bytes. Equal file size does not mean equal articulation. The duration list changes from 240/216/31/276 to 240/240/1/240 in the both-edges version. Use the event positions, not the byte count, to judge this edit.
Download the inputs, outputs, and code
- Raw MIDI and raw note data
- Starts moved, durations preserved
- Starts moved, original ends retained
- Both edges snapped with a one-tick minimum
- Python reproduction script and full numeric results
Save the script in an empty directory and run python experiment.py using Python 3; no extra package is required. It writes the four MIDI files and two JSON files into that directory, replacing files with those names if they already exist. The rounding rule is nearest grid point, with exact halfway positions rounded later. Note-off events sort before note-on events at the same tick. The files use one track, Format 0, and a 120 BPM tempo event.
A practical check on your converted melody
- Keep the original audio and raw MIDI. Duplicate the MIDI region before editing. If the file does not open, use the MIDI file export check first.
- Check the grid against the phrase. Align a clear beat and inspect the later notes. If the grid drifts away from the performance, resolve that relationship before snapping events. A straight grid also cannot describe every triplet, swing, or free-time phrase.
- Choose a short passage with an obvious transition. Include a connected pair and a short note. Inspect start and end positions before applying your command.
- Apply start correction and compare lengths. If the start moves 10 ticks earlier, does the end move 10 ticks earlier too? If it stays put, the note has grown by 10 ticks. This single check identifies an important difference in behavior.
- Try end correction only on the duplicate. Check for collapsed short notes and changed gaps or overlaps. Listen with the same instrument and settings, then compare with the original audio. Undo if the articulation is worse.
- Edit exceptions by hand. An unwanted pitch, duplicated note, or missed note is not repaired merely by moving it to a grid. Return to the audio-to-MIDI guide when the draft itself needs improvement.
What this test does and does not establish
It establishes exact changes for four known notes under three explicitly coded transformations. It does not measure transcription accuracy, perceived groove, synth sound, controller handling, sustain pedal behavior, or compatibility across DAWs. No audio-to-MIDI model was run in this experiment. Real recordings may need different subdivisions or local edits; a cleaner-looking piano roll is not sufficient evidence of a better musical result.
Strength, range, and groove controls can make edits more selective. The MIDI Association's quantization guidance emphasizes selective correction and listening in musical context. There is no single percentage that this experiment can recommend for every performance.
Quick answers
Does quantization fix wrong pitches?
Timing quantization changes event times. It does not establish which pitch was intended. Correct transcription mistakes separately.
Will starts-only quantization keep every note length?
Only if the operation moves the end along with the start. Verify that behavior in your editor; a fixed end means a changed duration.
Should I quantize note ends for sheet music?
Readable notation may need simpler durations, but inspect short notes, overlaps, and rests first. Work on a separate copy so the playback-oriented draft remains available. See the MIDI-to-sheet-music guide for the next step.
Experiment run: October 22, 2026. Constructed examples; no product-performance claims.