MP3 to MIDI: can clipping change note lengths without adding octaves?
Why can the same audio phrase return the same number of MIDI notes with different lengths? The note count does not determine note length: a converter estimates each note’s start and end separately, and eight events can have eight different durations. First check what changed. If the exported end ticks changed, the difference is in transcription or a MIDI edit. If the ticks match but playback seconds change, check the MIDI tempo map and DAW tempo. If the MIDI note-offs match but sound continues after them, check the instrument’s release or effects. Matching counts alone cannot distinguish these cases. Our clean/clipped pair demonstrates the first case, but does not isolate why this particular waveform change altered the detected endings.
Convert your MP3 · Inspect the complete results
Execution and review: two new CLI transcriptions were run on 21 November 2026, Beijing time, using our production worker operations with FFmpeg decoding instead of WebAudio. No online browser execution is claimed. Current-ten comparison and the 30% information-increment requirement remain unverified; the files and event tables alone do not establish exclusivity.
Why checking only for extra octaves can miss a problem
To find why equally counted conversions have different lengths, compare three things in order: raw note boundaries, tempo mapping, then the receiving sound. A changed note-off tick with a changed onset-to-off interval is an exported-event difference; equal event ticks played under a different tempo map can last different numbers of seconds; equal event timing with a longer audible tail points to playback release or effects rather than a longer MIDI note. For a constant tempo, duration in seconds is durationTicks × 60 / (BPM × PPQ); across tempo changes, sum the tick spans under each tempo segment. This triage tells you which layer to investigate before quantizing or shortening notes. It does not identify the internal cause of our clean/clipped result.
What makes the detector end a note?
In the installed Basic Pitch1.0.1 postprocessor, onset candidates are selected from onset peaks, while note endings are found by scanning frame activity for the same pitch. The scan counts consecutive frames below the frame threshold, resets that counter when activity rises, and backs the end up by the accumulated low-activity frames. It rejects notes shorter than the minimum length; a later residual-energy pass can also add events. The count of surviving events therefore does not uniquely specify their endings. This is a reading of the implementation, not an isolated diagnosis of these two outputs. Spotify source; the exact installed1.0.1 file inspected here. This public mechanism is credited, not exclusive.
Choose the repair after identifying the layer
For changed raw boundaries, compare the audio at the affected onset and offset and inspect conversion settings before editing that note. For a tempo mismatch, check the file’s tempo events and the DAW’s import/tempo-follow behavior; cutting note lengths can hide the timing-map problem. For an audible release tail, inspect the instrument envelope and effects before moving MIDI note-offs. Keep the original export so each change can be reversed. None of these checks guarantees the cause in an uninspected project.
The exact source construction
We generated two new five-second,44,100Hz mono16-bit WAV files, then encoded each with libmp3lame at128kbit/s. Both contain eight196Hz sine bursts, with starts0.35,0.85,1.35,1.85,2.35,2.85,3.35 and3.85seconds. Each authored burst lasts0.300seconds with a5ms attack and25ms release. The clean source coefficient is0.8. The second source clamps that same waveform to−0.2…+0.2 before PCM quantization. The generator counted85,040 saturated samples. This is not the number of transcription errors.
The quantized WAV peaks were0.7999572754 and0.1999816895; RMS levels were−8.437052 and−17.780877dBFS over the complete WAVs, including silence. These are pre-encoding measurements, not decoded MP3 levels. The pair is deliberately not level matched; clipping and level changed together. It cannot distinguish waveform effects from level effects or other interactions. Each encoded MP3 is81,127bytes; equal size does not mean equal content.
What actually came back
Both fresh runs returned eight MIDI note55 events (G3),480PPQ,120BPM, and two raw MTrk chunks. Both inventories contain eight note-ons and eight note-offs, with no pitch bends or SysEx. No returned note lies above55. These are observations about the retained files; they do not prove a general octave-error rate or recognition accuracy.
clean: all actual exported notes
| Note | Key | Start tick | Duration ticks | End tick | Velocity |
|---|---|---|---|---|---|
| 1 | 55 | 368 | 223 | 591 | 69 |
| 2 | 55 | 847 | 234 | 1081 | 67 |
| 3 | 55 | 1326 | 212 | 1538 | 71 |
| 4 | 55 | 1828 | 213 | 2041 | 68 |
| 5 | 55 | 2264 | 256 | 2520 | 64 |
| 6 | 55 | 2776 | 223 | 2999 | 69 |
| 7 | 55 | 3222 | 256 | 3478 | 63 |
| 8 | 55 | 3735 | 213 | 3948 | 69 |
MIDI: 150 bytes; SHA256 f618bac94fa0d5a3ce4ca6d2558f2fc08e68797217a7616910167a54f2d6a46e.
clipped: all actual exported notes
| Note | Key | Start tick | Duration ticks | End tick | Velocity |
|---|---|---|---|---|---|
| 1 | 55 | 334 | 334 | 668 | 93 |
| 2 | 55 | 802 | 346 | 1148 | 93 |
| 3 | 55 | 1293 | 346 | 1639 | 95 |
| 4 | 55 | 1783 | 469 | 2252 | 76 |
| 5 | 55 | 2253 | 334 | 2587 | 95 |
| 6 | 55 | 2721 | 346 | 3067 | 92 |
| 7 | 55 | 3222 | 334 | 3556 | 93 |
| 8 | 55 | 3702 | 324 | 4026 | 93 |
MIDI: 149 bytes; SHA256 57336db3523a7bf8ef6b71a35ba9e91af09b872846f7933555c0ded06af42b86.
Recompute the boundary difference
At120BPM a quarter note lasts500ms. Dividing by480PPQ gives1.041666667ms/tick. Clean fourth duration:213×500/480=221.875ms. Clipped fourth duration:469×500/480=488.541667ms. Its start1783 plus duration469 gives end2252; the next start2253 leaves1tick,1.041667ms. These are MIDI event boundaries, not audible release tails. The authored fourth burst lasts300ms; matching the authored count does not certify its timing.
The first start also differs:368/960=0.383333seconds clean,334/960=0.347917seconds clipped. We have not repeated either condition to estimate variability and have not swept thresholds. We do not attribute the difference to normalization, harmonic detection or a specific internal stage.
What to check on your own recording
- Keep the original input and export. Compare pitch inventory first, then inspect every onset and note-off against the source.
- If a processed and unprocessed source return the same keys, compare durations and gaps anyway. A matching count can conceal changed boundaries.
- When testing a suspected cause, add separately controlled and level-matched conditions rather than treating this two-file example as a causal result.
- Audition with a short-release patch, then inspect raw events. Long synth release is a separate playback property; it is not the note-off time.
Credited public guidance and pending comparison
Jukeblocks describes editable pitch and timing; Songscription describes note,velocity and timing workflows; Spotify Basic Pitch describes audio-to-MIDI and pitch-bend detection. General advice to inspect/edit MIDI and use clear input is credited shared information, not claimed exclusive. The candidate reader addition is the worked distinction between an unchanged octave inventory and changed exported boundaries. It must still be checked against current search pages; unique hashes alone do not make an information difference.
Original inputs, outputs and reproduction
- clean: MP3 · authored WAV · actual MIDI · original conversion report.
- clipped: MP3 · authored WAV · actual MIDI · original conversion report.
- Construction parameters and input hashes · generator · CLI adapter · independent verifier · all results.
In the supplied project layout run the generator with your FFmpeg executable path. Then run node convert-cli-evidence.mjs PATH_TO_FFMPEG public/examples/clipping clean and the same command ending in clipped; run the verifier from the project root. Dependencies and model operations are recorded in the scripts and reports. Basic Pitch1.0.1, TensorFlow.js WASM3.21.0,onsetThreshold0.5,frameThreshold0.3,minNoteFrames11 and22,050Hz model input were used, with the production Fill-kernel compatibility patch. FFmpeg resampling replaces browser WebAudio, so equivalence is untested. The verifier independently checks SHA256 and all16 raw MIDI note events against the reports.
Did clipping add octave notes here?
No. Both retained runs returned eight note55 events. This single pair is not a guarantee for other sources.
Does the matching count prove the conversion is correct?
No. The event tables show different starts,durations and velocities. Compare these against the original audio too.
Should I clip an MP3 before conversion?
This test establishes no recommendation. It is not level matched and does not isolate a causal mechanism or a best processing setting.