Audio to MIDI Converter

Why MP3 to MIDI loses notes that WAV keeps

The short answer: an MP3 does not lose your high notes — it costs you the low ones. Pitch detection measures frequency in fixed slices, and at the analysis settings this converter uses one slice is 10.77 Hz wide. A semitone is only 5.95% of a frequency, so below 181 Hz (about F#3) two neighbouring semitones fall inside the same slice. The only thing separating them is an interpolation that reads the relative loudness of nearby slices. MP3 coding noise disturbs exactly that measurement, which is why an MP3 and a WAV of the same take can come back with different note names in the bass and identical ones up top.

What a pitch detector actually measures

Before talking about codecs, it helps to know what the conversion is doing. This converter resamples your audio to 22 050 Hz, then reads it with a 2048-point FFT stepped forward 256 samples at a time. Two numbers follow directly from that:

A note is not found by reading off the loudest bin. For a single line, the detector scores every candidate fundamental by summing its harmonics — up to 8 of them, weighted by 1 / k0.7 — and then refines the winner with a parabolic interpolation across three neighbouring bins. That interpolation is what turns a 10.77 Hz grid into a usable pitch estimate, and it is the part that is sensitive to noise.

The 181 Hz dividing line

A semitone is a fixed ratio, 21/12, which means the gap in Hz grows with pitch: it is always 5.9463% of the frequency. Set that equal to one 10.7666 Hz bin and you get 181.06 Hz — MIDI note 53.63, roughly F#3. Below that pitch, two adjacent semitones are closer together than one bin.

Semitone spacing measured in FFT bins, at this converter's 22 050 Hz / 2048 settings.
NoteMIDIFrequencySemitone gapGap in bins
A13355.00 Hz3.270 Hz0.304
E24082.41 Hz4.900 Hz0.455
A245110.00 Hz6.541 Hz0.608
F353174.61 Hz10.383 Hz0.964
C460261.63 Hz15.557 Hz1.445
A469440.00 Hz26.164 Hz2.430
A581880.00 Hz52.328 Hz4.860
A6931760.00 Hz104.655 Hz9.720

Read the last column. At A6 a semitone spans nearly ten bins, so a small error in the peak position changes nothing. At A1 a semitone spans under a third of a bin, so the same absolute error moves you a whole note. This is not a flaw specific to one tool — it is arithmetic that any FFT-based detector on these settings has to live with.

Where the MP3 comes in

MP3 is a lossy codec. It spends bits on what a listener is likely to hear and discards the rest, and the residue shows up as coding noise spread across the spectrum. Three things follow:

  1. Harmonic ratios get noisier. The harmonic-sum score depends on the relative magnitudes of a fundamental and its overtones. Noise perturbs those magnitudes, so the winning candidate can shift to a neighbouring one.
  2. Parabolic interpolation drifts. It estimates the true peak from three bin heights. Perturb the heights and the estimated peak moves. Above 181 Hz that drift is smaller than a semitone; below it, it is not.
  3. Stereo handling changes the signal. Joint and intensity stereo encode some of the image rather than two independent channels. Since the analysis step averages the channels to mono, anything the codec did to the channel relationship survives into the mono signal.

Note what is not on that list: high-frequency cutoff. Low-bitrate MP3 does low-pass the top end, which matters for listening. It barely matters here, because single-line detection only searches 55 Hz to 1800 Hz and polyphonic peak detection only goes up to 4000 Hz. A codec that trims above 15 kHz is cutting outside the region being examined. That is why "MP3 sounds fine to me" and "MP3 converts worse" are both true at once.

How to test it on your own file

You do not have to take the above on faith, and you should not trust any published accuracy figure you cannot reproduce. This takes about two minutes:

  1. Start from a WAV you own. Export an MP3 from it at the bitrate you normally use.
  2. Convert both files here with identical settings — same mode, same sensitivity, same shortest-note value.
  3. Download the .csv for each. The columns are index,midi_note,note_name,start_sec,end_sec,duration_sec,velocity.
  4. Diff the note_name columns row by row.
  5. Sort the mismatches by pitch. If the pattern above holds, they cluster below MIDI 54.

That last step is the one worth doing. A raw mismatch count tells you little; a mismatch count that sits almost entirely in the bass tells you the cause is resolution, not the converter.

What actually helps

Questions

Is WAV always better than MP3 for this?

For conversion input, yes — a lossless file gives the detector a cleaner harmonic structure to score. Whether the difference is audible in your result depends on the material: sparse bass lines show it most, dense mid-range material often shows none.

Does a higher MP3 bitrate fix it?

It reduces the noise rather than removing it. Above roughly 256 kbps the remaining differences are usually smaller than the ones caused by reverb, room tone, or a busy arrangement.

Why does the converter resample to 22 050 Hz?

It keeps the analysis cheap enough to run entirely in your browser, and it still leaves a Nyquist limit of 11 025 Hz — well above the 4000 Hz ceiling used for peak detection. Resampling is not what costs you bass accuracy; the bin width that follows from the window size is.

Can I just transpose the result up and convert that?

No. Transposing the audio up before conversion moves the material into a region where semitones are further apart in Hz, which can produce a cleaner read — but you then have to transpose the MIDI back down, and any note that was misread is still misread.

Convert a file now — runs in your browser, nothing is uploaded.