Audio to MIDI from a clipped take: the notes survive, the velocity does not.
Clipping does not add wrong notes and does not move the octave. On the same six-note line, pushed from −6 dBFS up to the point where 66% of all samples were hard-clipped, this converter returned the identical six pitches every time: 57, 59, 60, 62, 64, 65. Not one extra note, not one shifted semitone.
The selected audio is decoded in your browser; it is not uploaded to a server.
Measured
Seven gain steps, one unchanged note list.
One synthetic six-note line (A3, B3, C4, D4, E4, F4), 0.30 s per note, 0.10 s of silence between, five harmonics each, 44.1 kHz mono. It was normalised to a 0.5 peak (−6.0 dBFS), then multiplied by a linear gain and hard-clipped to ±1.0 — the same thing a digital ceiling does to an over-hot file. Everything else stayed fixed. Sensitivity at Balanced throughout.
| Gain before clip | Samples clipped | File RMS | Notes out | Velocities |
|---|---|---|---|---|
| +0 dB | 0.0% | 0.1973 | 57 59 60 62 64 65 | 93 94 93 93 94 93 |
| +3 dB | 0.0% | 0.2787 | 57 59 60 62 64 65 | 112 113 112 112 113 112 |
| +6 dB | 0.0% | 0.3937 | 57 59 60 62 64 65 | 120 ×6 |
| +9 dB | 9.6% | 0.5263 | 57 59 60 62 64 65 | 120 ×6 |
| +12 dB | 21.4% | 0.6400 | 57 59 60 62 64 65 | 120 ×6 |
| +18 dB | 47.3% | 0.7537 | 57 59 60 62 64 65 | 120 ×6 |
| +24 dB | 65.9% | 0.8341 | 57 59 60 62 64 65 | 120 ×6 |
A control run sat at peak 0.99 without clipping at all (RMS 0.3907). It returned the same six notes as every row above, which rules out “louder is the variable”: the note list is set by the period of the signal, and the period of a symmetric limiter's output is unchanged.
Test conditions. Signal synthesised in code, not recorded; five harmonics and an exponential decay, no noise, no reverb, no vibrato, monophonic. One timbre only. Gain applied as a linear multiply, then clamped sample by sample to ±1.0 — a hard digital clip, not an analogue preamp's soft saturation. Sensitivity level 2 of 3. Detector taken from the live converter.js, not re-implemented. Full console output in clipping-2026-11-17.txt.
Provenance: harness run-clipping.js@55d3a4d5c3786400 driving detector-from-live.js@cecdb2c0fb5e48a9 · fixture synth-clip-gain-sweep-v1 · detector 77a9dd6b9f15af65 · re-run node run-clipping.js.
The mechanism
Clipping keeps the period, and the period is the whole decision.
The detector works frame by frame: 1,024 samples per frame, a hop of 256, and inside each frame it searches a lag range from 31 to 512 samples. For every candidate lag it sums the product of the frame against itself shifted by that lag, keeps the lag with the largest sum, converts that lag to hertz (sampleRate / lag), and rounds the result to the nearest MIDI number. Nothing in that chain reads the absolute height of the waveform.
A hard clip at ±1.0 is a symmetric nonlinearity. It flattens the tops and bottoms of the wave, which adds odd harmonics and raises the RMS, but it does not shift a peak in time. So the lag that maximises the correlation stays where it was, and the rounded MIDI number with it. Across all seven steps the winning lag never moved by a single sample — which is why the note list is byte-for-byte the same shape at 0% and at 66% clipped samples.
This also explains the opposite result people expect. Distortion sounds catastrophic to a listener because the ear is sensitive to added harmonics; the detector is not listening for harmonics at all, it is measuring repetition. A square wave and the sine it came from repeat at the same rate. The same code path is why a bass string below the detector’s search floor collapses onto one wrong pitch, covered in bass to MIDI.
The mechanism
Velocity is a straight line from frame RMS to a ceiling at 120.
What dies earlier and quieter is dynamics. Every note's velocity hit the 120 ceiling at +6 dB of input gain — at that step not a single sample was clipped yet. So if a hot recording comes back with everything at the same velocity, the cause is level, not distortion. The pitch information survived 66% clipping; the loudness information was gone before the waveform ever touched the ceiling.
Velocity is not measured from the waveform shape either. In this build, each note's velocity is min(120, 48 + round(frameRms × 170)), taking the loudest frame the note contains. Two consequences fall straight out of that formula:
- The mapping saturates at a frame RMS of about 0.42 (72 ÷ 170). Everything above that number is the same velocity, 120.
- By the time a file actually clips, its frame RMS is far above 0.42, so clipping can never be the reason dynamics disappeared — they were already gone.
The measurement matches the arithmetic. At +3 dB the six notes sit at 112–113; at +6 dB they are all 120 while the clipped-sample count is still 0.0%. Whole-file RMS is 0.3937 there, but a single frame's RMS runs higher than the file average, which is why the ceiling arrives at +6 dB rather than +7.5 dB. From that row onward, no further gain changes any velocity, because there is no larger value to reach.
If you convert a take where every note reads 120, the recording was already at or past that level before conversion. Nothing about the converter flattened a range that existed in the file.
The one thing that moved
One onset arrived 5 ms early. That is one hop, not a new note.
At +18 dB and +24 dB, the third note (C4, MIDI 60) started at 784 ms instead of 789 ms. Five milliseconds. The analysis hop is 256 samples at 44.1 kHz, which is 5.8 ms — the same order as the reported shift, and the smallest change the frame grid can express.
The direction is consistent with what clipping does to an attack: a note with a slow, quiet beginning now spends its first few milliseconds at full scale, so the frame that crosses the amplitude gate arrives one hop earlier. Onsets in this tool are quantised to the frame grid anyway, so a 5 ms difference is inside the resolution you are already accepting. Pitch, note count and note order were untouched at every gain step, including the two where nearly half and then two thirds of the samples were flat-topped.
What to do with a hot take
Do not normalise it to fix the notes. The notes were never the problem.
Two reflexes are worth dropping. The first is re-recording because the waveform looks like a solid block: on this detector, a clipped monophonic line converts exactly like the clean one. The second is “normalising” before converting to help the tool: peak normalisation raises everything until the loudest peak touches the ceiling, which pushes the frame RMS past 0.42 and pins every velocity at 120 — you pay a whole file's dynamics for accuracy that was already there.
What actually helps is leaving room. If you are choosing a record level, aim for peaks a few dB below full scale so that the loudest frames stay under that 0.42 RMS bound; you keep the velocity ladder from 48 up to 120 instead of collapsing it onto the top rung. On the quiet end the same logic runs in reverse — the amplitude gate is 0.015 RMS at Balanced, and notes below it are not detected at all, which is measured separately on the recording prep page.
One honest caveat before you decide clipping is free: this test measured what a converter does with an already-clipped file. It says nothing about what a clipped microphone preamp or a clipped phone recording does to the source — intersample peaks, converter overload, and a clipped reverb tail are distortions upstream of this measurement, and none of them were in the signal path here.
The limits of this test
What these seven rows do not cover.
- One timbre, one instrument shape. Five harmonics with an exponential decay. A source whose spectrum sits mostly above the fundamental — a bright cymbal, a distorted electric guitar — was not tested, and clipping redistributes energy differently there.
- Synthetic, not recorded. No room, no noise floor, no vibrato, no pitch drift. A real clipped take carries all four.
- Monophonic. Nothing here says what clipping does to two notes sounding at once; this converter is a single-line detector and chords are outside what it promises.
- Hard digital clip only. A limiter with look-ahead, a tape machine's saturation, or a codec that clips after encoding can all behave differently.
- Velocity is this build's formula. The 48 + RMS × 170 mapping and the 120 cap are constants in the shipped
converter.js; a different build could map level differently, and then the row where the ceiling arrives would move.
FAQ
Clipping and audio to MIDI
Does a clipped recording produce wrong notes?
Not in the measurement on this page. A six-note line was pushed from −6 dBFS to the point where 65.9% of all samples were hard-clipped, and the converter returned the same six pitches (57, 59, 60, 62, 64, 65) at every step, at all three sensitivity levels. The pitch decision comes from the repetition period of the signal, and a symmetric clip does not change that period.
Why are all my notes at velocity 120?
Because the recording's frames are loud. Velocity here is min(120, 48 + round(frameRms × 170)), so anything above a frame RMS of about 0.42 reads 120. In the test that ceiling was reached at +6 dB of input gain, while the clipped-sample count was still 0.0% — the dynamics were gone before any distortion.
Should I normalise a quiet recording before converting?
Peak-normalising raises the whole file so the loudest sample touches the ceiling, which usually pushes frame RMS past 0.42 and flattens every velocity to 120. If the take is quiet, a modest gain is fine; if it is already loud, normalising costs you the dynamic range and buys no accuracy. The thing to protect is the space between the 0.015 RMS gate at the bottom and the 0.42 velocity ceiling at the top.
Will clipping create extra notes in the silence between notes?
Not by itself. Silence that is multiplied by gain stays silence. Extra notes in gaps come from something that is actually sounding there — mains hum, room noise, a reverb tail — and that is a different measurement: a 50 Hz hum at −15 dB added five phantom notes at MIDI 89 to a six-note line, while hard-clipping 66% of the same line added none.
Does clipping affect note timing?
It can move an onset by about one analysis hop. At +18 dB and +24 dB the third note started at 784 ms instead of 789 ms — 5 ms, against a hop of 5.8 ms at 44.1 kHz. Onsets are quantised to that frame grid anyway, so the difference is inside the resolution the tool already has.
Is the conversion done on my device?
Yes. The file is decoded with the browser's own audio decoder and the detection runs in the page; there is no upload step and no account. That is also why the 20 MB limit exists — it is a memory bound, not a paywall.
What actually ruins a take, then?
From the measurements on this site, in order of how much they cost: notes that sit below the amplitude gate (never detected), low notes under the detector's floor (a bass string can collapse to a single wrong pitch), a source with two notes at once, and level so high that every velocity pins at 120. Clipping itself is not on that list for a monophonic line.