MIDI Quantizer with Swing
Tighten the timing of a MIDI file to a grid, with strength, swing and a window that keeps the feel.
How it works
Moves the notes of a Standard MIDI File toward a 1/4 to 1/32 or triplet grid. Strength below 100 % keeps part of the human feel, swing shifts every off-beat grid line, the window leaves notes far from the grid alone, and note ends can be quantized too. Controllers, pitch bends, programs and every other event are kept. You get the new MIDI file and a before/after timing report.
- Every note-on is paired with its note-off (same key and channel). Its grid target is the nearest grid line; with swing, every odd grid line sits at the swing share of a grid pair (MPC-style: 50 % = straight, 66 % ≈ triplet).
- A note is moved only when its distance to the target is within the window (a share of half a grid step); it then moves by strength × distance, rounded to whole ticks. Without “ends”, the length is kept; with it, the end moves toward its own grid line the same way (at least one tick long).
- All other events — controllers, pitch bends, program changes, SysEx, tempo and text — keep their exact times. The file keeps its resolution and is written with explicit status bytes.
Quantizing changes the feel of a performance; keep the original file.
Sources
- Standard MIDI Files 1.0 (RP-001) (MIDI Association)
Part of Tickwork
-
Tickwork MIDI step & piano-roll sequencer
Sequence synths and drums with a piano roll, chance, ratchets and parameter locks.
Related tools
- MIDI File Inspector – See what is inside a MIDI file: tracks, instruments, tempo map, notes, length and an estimated key.
- Euclidean Rhythm Generator (MIDI) – Spread k beats evenly over n steps for several drums at once and download the groove as a MIDI file.
How to use the MIDI Quantizer with Swing
Move the notes of a MIDI file toward a grid of sixteenths, eighths or triplets with adjustable strength, swing and capture window, and keep every controller and pitch bend.
What it is for
Notes played on a keyboard or drum pads never land exactly on the beat. Quantizing moves them toward a grid so the part sounds tight, or — at less than full strength — a little tighter without losing the human feel.
The MIDI Quantizer works on Standard MIDI Files. You choose the grid (1/4 to 1/32 and triplets), the strength, the swing of the grid, the capture window and whether note ends are quantized too. Every other event — controllers, pitch bends, program changes, tempo and meta events — is written back unchanged, and each note keeps its pitch, velocity and length. The algorithm is the same as the quantize function of the Tickwork sequencer app.
It does not detect tempo: the grid comes from the file's ticks per quarter note, so the file must have been recorded to a click or a tempo map.
Worked example
Choose the sample Loosely played groove — Tickwork's first-groove pattern with seeded timing errors of up to about ±40 ticks (one twelfth of a beat at 480 PPQ). With grid 1/16, strength 100 %, swing 50 % and window 100 %, the summary reads "36 of 39 notes moved to the 1/16 grid (mean shift 17.69 ticks); mean distance from the grid 17.69 → 0 ticks." Three notes were already on the grid, the largest move was 38 ticks.
Run it again with strength 50 % and swing 58 %. Now 35 notes move by half their distance to the swung grid: the mean distance drops from 17.59 to 8.74 ticks, and the off-beat sixteenths lean late. The distance before differs slightly from the first run because the swung grid lines are in other places.
How to read the result
- Grid ticks is the grid spacing in the file's own resolution: 120 ticks for sixteenths at 480 PPQ, 160 for eighth triplets.
- Moved counts notes whose start changed; mean shift and max shift say how far.
- Distance from the grid before and after is the mean distance of note starts from the nearest (swung) grid line. At 100 % strength and window it is always 0 afterwards.
- The per-track table shows where the work was done — a drum track that moved much more than the bass was probably played less tightly.
Tips and common mistakes
- Strength 50–80 % tightens a part but keeps its feel. 100 % gives a programmed sound.
- Window limits which notes are touched: at 40 % only notes within 40 % of half a grid step from a line are moved. Use it to fix sloppy notes while leaving deliberate flams and pushes alone.
- Swing 50 % is straight; 54–58 % is a light shuffle; 66 % is close to triplets. Swing moves the grid line of every second sixteenth (or eighth, for an eighth grid).
- Quantize ends snaps the note-off to the grid too, so every note lasts a whole number of grid steps — useful for step-sequencer imports, harmful for legato playing.
- Choose the grid of the finest notes in the part. Quantizing a sixteenth-note hi-hat to 1/8 pushes half the hits onto the neighbouring eighth.
FAQ
Will quantizing change my tempo or controllers?
No. Only note starts (and, if chosen, note ends) move; everything else is copied event by event.
What does the window do exactly?
The window is a share of half a grid step. At 1/16 and 480 PPQ half a step is 60 ticks, so a window of 50 % only moves notes that start within 30 ticks of a grid line.
Can I undo it?
The tool returns a new file and never changes your original, so keep the original to go back.
Does it work with format 0 files?
Yes. Format 0 files stay format 0; format 1 and 2 files are written as format 1. The resolution (PPQ) is kept.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://tickworkmidiquantizer.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://tickworkmidiquantizer.usefulweb.app/mcp· tool nametickwork_midi_quantizer
Example request
curl -s -X POST https://tickworkmidiquantizer.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"sample":"humanized-groove","grid":"1/16","strength":100,"swing":50,"window":100,"ends":false}'