Accurate MP3 to MIDI: Do Note Lengths Match?
Not exactly in this one controlled run: all four target pitches were found, but the exported MIDI notes were 150–178 ms longer than their known source durations (160 ms mean absolute duration error). This is one synthetic fixture—not a general accuracy score or a ranking of converters.
Pitch and start-time checks do not tell you whether a MIDI note releases when the source note ends. To isolate that question, this test uses four non-overlapping notes with known gate lengths, then compares the MIDI event durations against those references.
Measured note lengths
The input is a 3.60-second, mono 44.1 kHz sequence of four sine notes. Each has an 8 ms linear edge, and the notes do not overlap. We encoded it as a constant 192 kbit/s MP3, decoded that MP3 to mono 44.1 kHz float PCM, and ran this site's unchanged detector and MIDI writer in Balanced mode. A target counts as matched only when the pitch is exact and the nearest onset is within 0.35 seconds; duration is then compared for matched events.
| Pitch | Known source length | MIDI length | Difference |
|---|---|---|---|
| C4 (60) | 240 ms | 418 ms | +178 ms |
| E4 (64) | 360 ms | 511 ms | +151 ms |
| G4 (67) | 500 ms | 650 ms | +150 ms |
| C5 (72) | 720 ms | 882 ms | +162 ms |
Mean absolute duration error is the average of the four absolute differences: (178 + 151 + 150 + 162) ÷ 4 = 160.25 ms, reported to the nearest millisecond as 160 ms. All 4 pitches matched; this run had 0 missed targets and 0 extra MIDI events. The detector's frame-based note ends make output lengths quantized, so these figures describe this one run and its analysis settings.
Download the exact files
- Download the 192 kbit/s MP3 input.
- Download the reference WAV with known note lengths.
- Download the unedited MIDI output.
- Open machine-readable measurements, matching rule, settings, and file hashes.
How to judge note-duration fidelity
- Use a short input whose note-on and note-off times are known; otherwise a long-looking MIDI note may simply reflect sustain in the source.
- Compare lengths only after defining how an output event matches a target pitch and onset. State that rule before reporting an average.
- Inspect each note as well as the average. Four similar overhangs can be easier to trim than one badly merged event, even when their mean looks close.
- Repeat with the instrument and articulation you actually need. Clean sine waves do not predict the behavior of piano, voice, guitar, reverb, or a full mix.
Scope and limitations
- This is one generated monophonic sine fixture, not a recording, song, vocal, chord passage, or commercial-converter comparison.
- The MP3 was decoded with FFmpeg rather than through the browser file-picker and AudioContext path.
- Duration is evaluated only for exact-pitch events whose onsets fall within the stated 0.35-second matching window.
- The result does not establish typical performance, a universal tolerance, or that every note in other audio will be longer.
For a broader look at matched, missed, and extra notes across two different inputs, see the two-input MP3-to-MIDI test. For MIDI event and file basics, read the MIDI file guide; to try a conversion, return to the MP3 to MIDI converter.