# MIDI Quantizer with Swing > Tighten the timing of a MIDI file to a grid, with strength, swing and a window that keeps the feel. 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. Part of usefulweb.app (https://usefulweb.app/). Part of [Tickwork](https://tickwork.usefulweb.app/) (ownerApp: tickwork). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://tickworkmidiquantizer.usefulweb.app/ (interactive tool at https://tickworkmidiquantizer.usefulweb.app/tool) - JSON API: POST https://tickworkmidiquantizer.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://tickworkmidiquantizer.usefulweb.app/api/v1/tool) - OpenAPI: https://tickworkmidiquantizer.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://tickworkmidiquantizer.usefulweb.app/mcp - tool `tickwork_midi_quantizer` ## Inputs - file (file): MIDI file (.mid) - Up to 4 MB. Leave empty to quantize a built-in, loosely played sample. - sample (select): Sample when no file is uploaded - grid (select): Grid - strength (number): Strength - 100 % puts notes exactly on the grid; 50 % moves them half way. - swing (number): Swing - Position of every second grid line inside a pair (50 = straight, 66 ≈ triplet feel). Ignored for triplet grids. - window (number): Window - Only notes within this share of half a grid step are moved; 100 % moves all notes. - ends (boolean): Quantize note ends too ## Method - 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. ## Limits - Quantizing changes the feel of a performance; keep the original file.