Audio to MIDI Converter

Voice to MIDI: what a single-line converter can and cannot follow

The short answer: monophonic mode commits to exactly one pitch per frame, and it re-decides that pitch every 11.610 ms — a 256-sample hop at 22 050 Hz, or about 86 frames a second. It will follow a solo vocal line anywhere between 55 Hz and 1800 Hz, which is MIDI 33 (A1) to MIDI 93, a shade above A6 (1760 Hz). It will not follow two pitches at once, so harmony, overdubs and a backing track collapse into one wandering line. It drops any note shorter than 58.05 ms at the default settings, and it breaks a held note whenever the singer takes a breath longer than 81.27 ms. Wide vibrato and fast slides come out as a stream of repeated notes rather than one line. Every number on this page comes from this converter's own analysis code, not from a general description of pitch tracking.

What "single line" means in this converter's code

Audio arrives in 2048-sample windows, Hann-weighted, stepped forward 256 samples at a time. That fixes two constants: one FFT bin is 10.7666 Hz wide, and one frame lasts 11.610 ms. After that, monophonic mode does something specific — it does not look for notes, it looks for one fundamental.

For every candidate fundamental on the grid it adds up the energy at that candidate's harmonics, weighting each one by 1/k0.7, and keeps whichever candidate scores highest. Two details of that sum matter for voice:

The result of this pass is one frequency per frame, which is then rounded to the nearest MIDI note number. One number per frame: that is the whole definition of "single line" here.

The pitch window: MIDI 33 to 93

The search never looks below 55 Hz or above 1800 Hz. Because candidates live on the bin grid, the band actually searched is snapped outward slightly: from bin 5 (53.83 Hz) to bin 168 (1808.79 Hz). A fundamental above A6 is outside the window and will not be found at all — not mis-detected, simply never considered.

One FFT bin is 10.7666 Hz wide. The last column is how many bins apart two adjacent semitones sit at that pitch — below 1.0, a whole semitone is narrower than a single bin.
PitchFrequencyMIDIOne semitoneIn bins
E282.4 Hz404.90 Hz0.455
A2110.0 Hz456.54 Hz0.608
C3130.8 Hz487.78 Hz0.722
F#3185.0 Hz5411.00 Hz1.022
C4261.6 Hz6015.56 Hz1.445
A4440.0 Hz6926.16 Hz2.430
C5523.3 Hz7231.11 Hz2.890
C61046.5 Hz8462.23 Hz5.780
A61760.0 Hz93104.66 Hz9.720

Read the low end of that table carefully. At 82.4 Hz two neighbouring semitones are only 0.455 bins apart, so the raw grid cannot separate them — the harmonic refinement described above is doing that work. The practical reading is that the bottom of a low voice is the least resolved part of the range, while everything from F#3 upward has more than a bin of separation per semitone before refinement.

Four things a voice does that this tracker cannot follow

Two pitches at once

One fundamental per frame means a second simultaneous pitch has nowhere to go. A singer doubled at the octave, a harmony part, a drone, or a voice over a guitar all resolve to whichever single fundamental scores best in that frame — and because the decision is made independently 86 times a second, the winner can swap between the voice and the accompaniment several times inside one bar. The output is not a wrong note; it is one note moving where two things were sounding.

Notes shorter than 58.05 ms

The "Shortest note" control defaults to 60 ms, but the code works in frames: it requires round(60 / 11.610) = 5 frames, and 5 frames is 58.05 ms, not 60. Anything shorter is discarded before it reaches the MIDI file. That puts a hard ceiling of roughly 17 notes per second on the result. A run at 12 notes per second leaves 83.3 ms per note and survives; the same run sung at 18 notes per second leaves 55 ms per note and vanishes completely.

Slides and vibrato that cross a semitone

A note ends the moment the rounded MIDI number changes — there is no glide, pitch bend or portamento in the output. Two consequences follow:

Breath, consonants and whispering

Every frame has to clear two gates before it counts as sung. The first is loudness: the gate is placed between the quietest tenth of the file and its loudest frame, and how far up it sits is set by the sensitivity slider. The second is harmonicity — the ratio of the winning harmonic sum to the total magnitude of the spectrum. On a clean synthesised tone that ratio measures around 0.30–0.35; on broadband noise it collapses towards zero.

Both gates are recomputed from the sensitivity slider. A frame must be above the loudness gate and above the harmonicity threshold to count as a note.
SensitivityHarmonicity thresholdLoudness gate position
00.3500.320 of the way from the quietest tenth to the loudest frame
300.2750.230 of the way
60 — default0.2000.140 of the way
800.1500.080 of the way
1000.1000.020 of the way

Breath and fricatives are broadband, so they fail the harmonicity test and the frame is marked empty. Monophonic mode then does something helpful: if the same pitch comes back within 7 frames (81.27 ms), the gap is bridged and the note is kept whole. A breath longer than that splits the note in two. Whispered or unvoiced material has no harmonic series to sum at all, so there is nothing for the search to find — it comes back silent rather than wrong.

One side effect worth knowing: the loudness gate is measured against the loudest frame in the whole file. A loud intro, a shout at the end, or an accompaniment that peaks well above the voice all raise the top of that range and lift the gate with it, which is how quiet phrases drop out of an otherwise clean take.

Loudness becomes velocity — one number per note

Velocity is not a performance capture. It is computed from the RMS of each 2048-sample window expressed in dBFS, averaged across every frame the note spans, then mapped through round(20 + (dB + 60) × (100 / 54)) and clamped to 1–127.

What the velocity formula returns for a note's average RMS level. The scale tops out well below full scale.
Average levelVelocity
−60 dBFS20
−50 dBFS39
−40 dBFS57
−30 dBFS76
−20 dBFS94
−10 dBFS113
−5 dBFS122
−2.22 dBFS and louder127

Two things follow that matter for a vocal. A 40 dB dynamic range — already a wide one — only spans velocity 39 to 94, so the MIDI will feel flatter than the take did. And because the level is averaged over the note's frames, one number is written per note: a swell inside a long held note is flattened to a single value, no matter how it was sung.

How to check a vocal conversion on your own file

We have not published accuracy figures for vocal material, because we have not measured any that we would stand behind. What you can do instead is measure it yourself in about a minute, using the CSV export. Its header is index,midi_note,note_name,start_sec,end_sec,duration_sec,velocity, with times to four decimal places.

  1. Check the floor. Sort by duration_sec. Nothing should be shorter than 0.0581 s. If short notes you can clearly hear are missing, that is the note floor, not the pitch detection — drop "Shortest note" from 60 ms to 30 ms, which becomes 3 frames, or 34.83 ms.
  2. Check the gaps. Subtract each note's end_sec from the next start_sec. Any gap under 0.0813 s was bridgeable and was bridged; gaps just over that are what split a held note. If a line you sang in one breath comes back in pieces, this column shows exactly where it broke.
  3. Find the vibrato. Repeated notes on the same pitch with a gap of roughly 0.08–0.15 s, alternating by one semitone, are vibrato that crossed a semitone boundary — not repeated notes.
  4. Find the gate. Export three times at sensitivity 40, 60 and 80 and count the notes each time. The notes that appear or disappear are the ones sitting near the harmonicity threshold; everything present in all three is unambiguous to this analyser.
  5. Count the fastest run. Notes per second over your quickest passage. Above about 17 per second, the note floor is what is removing them and no sensitivity setting will bring them back.

All of that runs locally and re-runs instantly when you move a control, because the audio analysis is done once per file and only the note grouping is recomputed.

Settings that suit a vocal file

Sing a line into the converter and watch the piano roll as you move the controls — the Audio to MIDI Converter runs entirely in your browser, so every setting above is yours to test in a few seconds.