Audio → MIDI

Audio to MIDI Converter

Vocal to MIDI: why a sung note comes back an octave up

The short answer: the most common vocal-to-MIDI failure is not a wrong note — it is the right note an octave up. Monophonic mode does not simply locate the loudest frequency. It adds up the energy at a candidate’s harmonics, weighting each one by 1/k0.7, and declares whichever candidate scores highest to be the fundamental. A vowel’s formants re-weight those harmonics, and when they push the second harmonic far enough above the fundamental, the sum for 2× the pitch beats the sum for the pitch itself — and the whole note jumps an octave. Measured on this converter’s own dsp.js, a sung A3 (220 Hz) jumps up to A4 when the second harmonic reaches just 1.70 dB above the fundamental. The same jump needs 9.79 dB at A2 and 9.43 dB at A4. The danger is concentrated in the middle of the range, exactly where most voices sit.

1. How the tracker picks a pitch — and why it can pick the harmonic

Monophonic mode never looks for “notes”. It looks for one fundamental per frame. For every candidate on the FFT grid it adds up the magnitude at that candidate and its whole-number multiples, weighting the k-th harmonic by 1/k0.7 and using harmonics 1 through 8 (up to min(8, floor(1023 / bin))). The candidate with the highest sum wins the frame.

That sum is what makes the octave jump possible. Consider a sung A3 at 220 Hz with harmonics at 440, 660, 880… Hz. The tracker evaluates both 220 Hz and 440 Hz as candidate fundamentals. At 220 Hz the score collects the 220, 440, 660… bins; at 440 Hz it collects the 440, 880, 1320… bins — a subset. Normally the 220 Hz candidate wins, because the fundamental itself is the single strongest component. But a vowel formant can sit on the second harmonic and lift it while leaving the fundamental quiet. Once the second harmonic rises far enough, the 440 Hz candidate — whose score no longer has to “waste” weight on a weak fundamental — overtakes it, and the frame is reported as A4.

This is not a bug in the FFT and not a rounding error. It is the direct, predictable consequence of the harmonic-sum design, and it is the single biggest reason a vocal line returns an octave too high.

2. The exact threshold, per note

To find where the jump actually happens we synthesised sustained tones — a fundamental plus harmonics 2 through 8 — and swept the second harmonic’s amplitude upward while holding the rest fixed, then read the segmented MIDI the converter returned. The table below is the amplitude ratio, in dB above the fundamental, at which the output note changes from the true pitch to one octave up.

Measured on dsp.js in monophonic mode (sensitivity 60, shortest note 60 ms). “Jump threshold” = the second-harmonic level, relative to the fundamental, at which the output MIDI switches to the octave above.
NoteFrequencyOctave-jump thresholdReading
A2110.0 Hz9.79 dBSafe — needs an unusually strong second harmonic
A3220.0 Hz1.70 dBFragile — a normal bright vowel can do this
A4440.0 Hz9.43 dBSafe — comparable to A2

The middle note is the outlier. At A3, a second harmonic barely louder than the fundamental is enough to flip the note an octave. That is well inside the range of what a singer’s vowel colour does naturally: formants reshape the harmonic balance from note to note and from vowel to vowel, so a phrase can jump an octave on one syllable and land correctly on the next. This is why the error shows up as a single wrong note in an otherwise clean line, not as a wholesale failure.

A note on honesty about these numbers: they are measured on synthesised tones whose harmonic balance we control exactly, not on real recordings of singers. Real voices are noisier and their formants move, which is precisely why the threshold is a range in practice, not a fixed line. The synthesised measurement is what pins down the mechanism; the last section gives you a way to spot the same jump in your own file.

3. Polyphonic mode does not jump — it doubles

Polyphonic mode handles the same situation differently, and the difference matters. Instead of summing harmonics and committing to one fundamental, it keeps up to six spectral peaks per frame and discards a peak only if it is an integer multiple — within 5% — of a stronger one. A strong second harmonic is a legitimate spectral peak in its own right, so the tracker keeps it as a separate note.

The result, measured on the same A3: once the second harmonic reaches 0 dB (equal to the fundamental), polyphonic mode returns two notes, A3 and A4, instead of one. The harmonic is not mistaken for the fundamental — it is reported alongside it. The octave error does not disappear; it changes shape, from “one note in the wrong place” to “the right note plus a ghost an octave up.”

For a single vocal line that is almost never what you want, which is why the settings section below recommends monophonic mode — but with the awareness that monophonic is the mode that jumps.

4. Wide vibrato does not split — it erases

There is a second vocal-specific failure that looks different but comes from the same design. A sung vibrato modulates the pitch a few times a second. Monophonic mode re-decides the pitch every 11.610 ms, so a vibrato that stays inside the note’s rounding cell is averaged into one pitch and survives. A vibrato that swings wider does not come out as a tidy alternation between two neighbouring notes — it comes out as nothing.

Measured on a 440 Hz tone at a natural 5 Hz vibrato rate, sweeping the depth:

Monophonic mode, A4 = 440 Hz, vibrato rate 5 Hz, 1.2 s tone. The note’s harmonicity score (salience) falls as the swing widens, and the frame stops passing the harmonicity gate (0.20 at sensitivity 60).
Vibrato depthOutput notesMid-note salience
±40 cents10 short notes0.208
±50 cents5 short notes0.186
±60 cents3 short notes0.166
±70 cents and wider0 notes0.150 or below

The mechanism is indirect but clear. As the pitch swings wider, the energy that the harmonic-sum needs spreads across more bins, the winning candidate’s score falls relative to the total spectrum, and the frame’s harmonicity — the ratio the code uses to separate a sung tone from breath or noise — drops below the gate. The whole note is then classified as non-tonal and discarded. A singer with a wide, slow vibrato can therefore vanish from the MIDI entirely, at exactly the moment the performance is at its most expressive. Raising the sensitivity lowers that harmonicity gate and can recover the note, but it brings back every other weak frame with it.

5. How to spot an octave jump in your own file

You do not need our synthesised measurements to catch this. Export the CSV (index,midi_note,note_name,start_sec,end_sec,duration_sec,velocity) and look at the note_name column against what you sang:

  1. Look for isolated +12. A single note that sits exactly 12 MIDI numbers (one octave) above where the melody was, surrounded by correct neighbours, is the harmonic-sum jump, not a performance mistake.
  2. Check whether it is always the same vowel. If the jump recurs on the same lyric syllable, that vowel’s formant is pushing your second harmonic over the line. Re-sing the syllable slightly darker or closer to the mic, or drop the note, and the jump should move.
  3. Compare modes. Convert once in monophonic and once in polyphonic mode. A note that is one octave too high in mono but appears as two notes (right note plus an octave ghost) in poly is the same harmonic being read two different ways.
  4. Find the erased vibrato. Sort by duration_sec. A long held note you clearly sang, but that is missing, is a vibrato that fell under the harmonicity gate — raise the sensitivity one step and re-run; if it reappears, that was the gate, not the pitch.

Every one of those checks runs locally and re-runs the moment you change a control, because the audio is analysed once per file and only the note grouping is recomputed.

Not every missing note is an octave jump, though. A vowel can also vanish while its neighbours survive, and a whole run of syllables can come back as a single note — why lyrics don't become notes cleanly measures those two failures separately, and explains why no lyric is ever written into the file.

6. Settings that suit a vocal file

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

Questions people actually ask

Why did my vocal melody come back an octave too high?

Because monophonic mode adds up a candidate’s harmonic energy and picks the winner, and a bright vowel that lifts your second harmonic above the fundamental makes 2× the pitch win the frame. On this converter’s code the flip needs as little as 1.70 dB at A3. It is the design, not a fault in your recording.

Why is it only ever one note that is wrong?

Formants move with the vowel and the note. One syllable pushes the second harmonic over the line, the next one does not, so the jump lands on a single note inside an otherwise clean line. That is the signature that distinguishes an octave jump from a badly tracked whole passage.

Why does the same note come back as two notes in polyphonic mode?

Polyphonic mode keeps spectral peaks instead of committing to one fundamental, and a strong second harmonic is a legitimate peak, so it is reported alongside the true note as an octave ghost. The same harmonic that jumps an octave in mono doubles into two notes in poly.

Why did my long held note disappear entirely?

If you sang it with a wide vibrato, the pitch swing spread the harmonic energy across too many bins and the frame’s harmonicity fell under the gate, so the note was classified as non-tonal and dropped. Measured at 440 Hz and 5 Hz, the note survives at ±60 cents but is erased at ±70 cents and wider. Raise the sensitivity one step and re-run; if it comes back, the gate was the cause, not the pitch.

Related guides