Audio → MIDI

Audio to MIDI Converter

Video to MIDI: what happens to the part you cannot hear

The short answer: a video’s audio track is 48 kHz, and this converter brings everything down to 22,050 Hz with a plain linear interpolation and no anti-alias filter. Anything above half of 22,050 — that is, anything above 11,025 Hz — does not disappear. It folds back down, mirrored, into the exact range the note detector reads. The bright part of a video soundtrack is cymbals, sibilance, applause and synth air, which is precisely what lives up there. Measured on this converter’s own dsp.js: a band of noise with nothing below 11 kHz — nothing you could hum — converts into 35 notes at the default sensitivity, with velocities from 87 to 114. A four-second melody plus eight cymbal-like hits goes from 10 notes to 40, and 11 of those pitches were never played. The notes are not guesses. They are arithmetic: 48,000 → 22,050.

1. The whole conversion is one line of code

Inside dsp.js, the first thing that happens to any file is this: if its sample rate is above TARGET_SR = 22050, every output sample is a straight-line interpolation between the two nearest input samples.

if (sr > TARGET_SR) {
  ratio = sr / TARGET_SR;
  out[j] = mono[i0] * (1 - fr) + mono[i1] * fr;   // linear interpolation
}

There is no low-pass in that path. A resampler that decimates without filtering does not remove the frequencies above half the new rate — it mirrors them. For a target rate of 22,050 Hz, the mirror line sits at 11,025 Hz, and every component above it comes back at a lower frequency you can name:

fold = |f − 22,050|  for  11,025 < f < 22,050

A video container hands over 48 kHz audio, so the ratio is 48000 / 22050 = 2.1769 and the mirror is live on every video you convert. Nothing about this is a guess or a model: the same file run twice gives the same result, and you can read the two lines above in the page’s own source.

2. Measured: a tone in, a different note out

We put single tones into the converter at 48 kHz and read what came back. Each tone was two seconds long, amplitude 0.8, with a decaying envelope so the detection gate lets frames through; detection mode and sensitivity were the defaults.

One tone at a time, 48 kHz in, converted by this page’s own dsp.js. “Fold” is |f − 22,050|. Pitches are what the converter reported, with velocities.
Tone in (Hz)Fold (Hz)Reported, polyphonicVelocityReported, monophonic
12,00010,050nothing—nothing
14,0008,050nothing—nothing
16,0006,050nothing—nothing
18,5003,550A7101nothing
19,0003,050G#5, G7101nothing
19,5002,550E6, D#7101nothing
20,0002,050A#6, C7100nothing
20,5001,550G6, D7100G6
21,0001,050C6, F7100C6
21,500550C#5, G#7100C#5
22,00050B7100G#1
23,000950A#5, F#799A#5

Read the first three rows first. A 12 kHz, 14 kHz or 16 kHz component folds to 10,050, 8,050 or 6,050 Hz — all above the ceiling the converter looks at, so nothing is reported at all. The damage only starts when the tone is high enough that its mirror lands inside the note range. That window turns out to be narrow, and section 7 pins it down.

3. How much of the tone survives the fold

A mirror would be harmless if it were faint. It is not. Linear interpolation rolls off gradually, so a large share of the original amplitude arrives on the other side of the mirror line.

Amplitude of the folded copy, measured on the decimated signal with a single-bin DFT. Source amplitude of each tone was 0.1953 (peak-to-RMS-normalised as measured at the input).
Tone in (Hz)Fold (Hz)Folded amplitudeShare of source
12,00010,0500.158381%
14,0008,0500.146475%
16,0006,0500.133668%
18,5003,5500.116760%
19,0003,0500.113358%
19,5002,5500.109656%
20,0002,0500.106454%
20,5001,5500.102953%
21,0001,0500.099551%
21,5005500.096049%
22,000500.092848%
23,0009500.085844%

Between 44% and 81% of the tone’s amplitude crosses the mirror line. That is not a leak; it is a second copy of the signal, sitting in the middle of the band the detector is trying to read.

4. Why you sometimes get two notes from one tone

Half of the rows above report two pitches instead of one, and that is not noise. The interpolation error of this particular ratio is periodic, and its rate is a number you can work out from the two sample rates:

48,000 − 2 × 22,050 = 3,900 Hz

So the folded copy arrives with a mirror image of itself at 3,900 − fold. Check it against the measurements:

Every two-note row in section 2, explained by the 3,900 Hz sideband. Frequencies are the reported pitches converted back from MIDI numbers.
Tone inFoldFold as reported3,900 − foldSideband as reported
19,0003,050G7 (3,136 Hz)850G#5 (831 Hz)
19,5002,550D#7 (2,489 Hz)1,350E6 (1,319 Hz)
20,0002,050C7 (2,093 Hz)1,850A#6 (1,865 Hz)
20,5001,550G6 (1,568 Hz)2,350D7 (2,349 Hz)
21,0001,050C6 (1,047 Hz)2,850F7 (2,794 Hz)
21,500550C#5 (554 Hz)3,350G#7 (3,322 Hz)

The two odd rows at the edges make sense the same way. At 18,000 Hz the fold is 4,050 Hz, which is just above the 3,994 Hz ceiling the converter searches, so only the sideband at 150 Hz survives — and it is reported as D3. At 22,000 Hz the fold is 50 Hz, which is below the 55 Hz floor, so again only the sideband at 3,950 Hz is left, reported as B7. Two tones 4 kHz apart produce the same note for the same reason.

5. A band with nothing in it you could hum

Single tones are easy to dismiss. So we built a signal that contains no pitch at all: a two-second band of noise between 11 kHz and 22 kHz, with a decaying envelope. Nothing in it is below 11 kHz.

Measured, the whole file sits at −14.00 dBFS. The same file pushed through an 11 kHz low-pass sits at −40.32 dBFS — meaning 26.3 dB of the file’s energy is above 11 kHz and there is effectively nothing underneath it. As a piece of music, this file is empty. Here is what the converter does with it:

The 11–22 kHz noise band, 2 seconds, converted at every sensitivity setting. The monophonic column is the same file in the other detection mode.
SensitivityPolyphonic notesVelocity rangeMonophonic notes
02198–1140
102597–1140
202895–1140
303093–1140
403192–1140
503291–1140
60 (default)3587–1140
703684–1140
803980–1140
904576–1140
1005268–1140

Two things are worth stopping on. First, even the strictest setting the interface offers — sensitivity 0, which makes all three internal thresholds as tight as they go — still returns 21 notes from a file with no musical content whatsoever, at velocities around 98–114. Second, monophonic mode returns zero notes at every setting, which is the one genuinely safe outcome here, and it happens for a reason covered in section 7.

6. What eight cymbal hits leave behind

Real material is music with bright content on top of it, so we built that too: a four-second melody of eight notes (A3 C4 E4 G4 D4 F4 A4 G4) at 48 kHz, plus a cymbal-like burst of 8–20 kHz noise with a 150 ms decay on each beat.

The same melody throughout, 48 kHz. “Pitches never played” counts distinct output pitches that are not one of the eight notes in the melody.
Bright content addedPolyphonic notesPitches never playedWhich ones
none (melody alone)100—
1 hit, at 0.3× level100—
1 hit, full level155F#7, F7, A#7, G#7, B7
4 hits, at 0.3× level100—
4 hits, full level248F#7, F7, A#7, G#7, B7, C7, A7, G7
8 hits (every beat), 0.3×100—
8 hits (every beat), full level4011E7, D7, D#7, F7, F#7, G7, G#7, A7, A#7, B7, C7

The melody converts cleanly on its own — ten notes, all of them on the eight pitches that were played. Add the cymbals at a level comparable to the music and the note count quadruples, and every extra pitch sits between roughly 2.1 and 3.3 kHz, which is exactly where an 18–20 kHz fold lands. Note also the level dependence: at 0.3× the bright content adds nothing. This is not a small-file curiosity that fires on everything; it needs the top of the band to be present at a real level.

A level sweep on a steady bright band, over the same melody, puts the threshold between −6 dB and −3 dB:

Melody plus a steady 11–22 kHz band, swept by level. “Never played” counts distinct pitches outside the eight melody notes.
Bright band levelPolyphonic notesPitches never played
−24 dB100
−18 dB100
−12 dB100
−9 dB100
−6 dB90
−3 dB134
0 dB2210

7. Which part of the video band can actually reach the notes

The fold is only visible when the mirrored frequency lands inside a window the converter searches. Those windows are not the whole spectrum:

That explains both surprising results from earlier. The 12, 14 and 16 kHz tones folded to 10,050, 8,050 and 6,050 Hz — above the ceiling, so the converter ignored them entirely and reported nothing. And the 11–22 kHz noise band returned zero notes in monophonic mode at every sensitivity, because most of its fold lands above 1,800 Hz, where that mode never looks.

The practical consequence is a boundary you can work with: the risk comes from roughly the top 4 kHz of a 48 kHz video’s audio — the 18–22 kHz region — plus, for 48 kHz material specifically, anything above 22,050 Hz, which folds down into 0–1,950 Hz, the middle of the musical range. A 44.1 kHz file cannot carry content above 22,050 Hz at all, so that last path is closed to it. Measured, a band of noise centred on 23 kHz came back as A#5 and F#7, sitting right on top of where a bass line or a low melody would be.

8. The fix, and its limit

The fold cannot happen if there is nothing above 11,025 Hz to fold. So the fix is a low-pass, applied before the file is handed over — either by exporting the video’s audio at 22.05 kHz (your DAW’s resampler does filter properly, unlike the two lines in section 1), or by putting a steep 11 kHz low-pass on the audio and exporting that.

Same material, converted before and after an 11 kHz low-pass. Detection defaults throughout.
MaterialRawAfter an 11 kHz low-pass
11–22 kHz band alone35 notes0 notes
Melody + 8 cymbal hits40 notes (11 never played)9 notes, all played pitches
Melody + bright band at full level18 notes5 notes, all played pitches

There is one honest limit, and it is worth knowing before you conclude the fix failed. If the file is nothing but high-frequency content, the low-pass does not remove the note — it only makes it very quiet. The detection gate is calculated from the file’s own loudest frame, so a file that has been reduced to a whisper still has a loudest frame:

A lone tone in a 48 kHz file, before and after an 11 kHz low-pass. Velocity is on the MIDI 1–127 scale.
Tone inRaw resultAfter the low-passFile level, raw → filtered
18,500 HzA7 at velocity 101A7 at velocity 1−14.0 → −105.7 dBFS
20,000 HzA#6, C7 at velocity 100A#6, C7 at velocity 1−14.0 → −108.3 dBFS
23,000 HzA#5, F#7 at velocity 99A#5, F#7 at velocity 1−14.0 → −117.2 dBFS

On a real video, where there is music under the brightness, the low-pass removes the phantom notes outright, because the music sets the gate and the folded copies fall below it. On a synthetic file that contains nothing but the fold, you get a velocity-1 ghost instead of a velocity-100 one — quiet enough to ignore, but not absent.

9. How to check your own video

  1. Look at the audio’s spectrum in your DAW or any analyser. If there is a lot of energy above 11 kHz, the fold is happening on your file. Cymbals, sibilance and applause all sit there.
  2. Convert the file once as it is, and note the note count. Then export the same audio at 22.05 kHz, convert again, and compare. If the count drops, you were converting folded content the first time.
  3. In the piano roll, look at where the suspicious notes are. Folded notes cluster in the 2.1–3.3 kHz region, and each one starts at the same instant as a bright hit — a cymbal, a consonant, an applause burst. Notes that follow your playing and sit in the instrument’s real range are the ones that were actually there.
  4. If the phantom notes are at velocity 1 after a low-pass, the file was almost entirely high-frequency content and there was nothing else to detect. That is not a failed conversion; it is an accurate one.

Questions people actually ask

Why do I get high notes around 2–3 kHz that nobody played?

That is the fold of the 18–22 kHz part of a 48 kHz soundtrack. Content up there mirrors down to roughly 0–4 kHz, and the region around 2–3 kHz is where most of it lands. Measured on this converter, eight cymbal-like hits added eleven pitches to a melody, every one of them between 2.1 and 3.3 kHz. If the notes appear exactly on the bright hits and nowhere else, that is what you are looking at.

Does the sensitivity slider remove them?

It reduces them, but it never removes them, and it costs you real notes. On the 11–22 kHz noise band — a file with no musical content at all — sensitivity 0 still returned 21 notes, the default of 60 returned 35, and 100 returned 52. Lower sensitivity tightens all three internal thresholds, so it is the right first move, but it cannot delete content that is genuinely in the band the detector is reading.

My audio-only files are 44.1 kHz and my videos are 48 kHz. Does the container matter?

Both fold, because both are above 22,050 Hz, and the mirror line is the same 11,025 Hz for both. What differs is what each format is allowed to carry. A 44.1 kHz file stops at 22,050 Hz, so its fold can never go below 0 Hz. A 48 kHz video can carry up to 24,000 Hz, and that top slice folds into 0–1,950 Hz — the middle of the musical range, on top of your bass and your low melody. Measured, a band of noise around 23 kHz came back as A#5 and F#7.

Will exporting the audio at 22.05 kHz fix it?

Yes, for anything that also contains music. A properly filtered 22.05 kHz export has no content above 11,025 Hz, so there is nothing left to fold: measured, a melody with eight cymbal hits went from 40 notes to 9, all of them played pitches. The one case where a phantom survives is a file that is nothing but high-frequency content, and there it comes back at velocity 1 instead of velocity 100.

Drop a file in and watch the piano roll — the Audio to MIDI Converter runs entirely in your browser, so every number above is yours to reproduce on your own video’s audio in a few seconds.

This tool opens a file, not a video link — save the audio track out of the video to a file first (MP3, WAV or M4A all work), then drop that file in. The converter only ever reads the decoded audio; it never follows a URL or plays the video itself.

Related guides