Browser-based transcriber · a single melody line → Standard MIDI File

Audio to MIDI Converter

Turn a recording of one voice or one instrument into notes: the pitch is tracked every 20 ms, grouped into notes, snapped to a beat grid and written as a .mid file you can open in any notation or music program.

Recording

One melody line at a time, up to 5 minutes. Chords and several instruments at once will not come out right.

Drop a recording here or click to choose

.mp3, .wav, .m4a, .ogg, .flac, or a video

Note detection

Tempo and timing

Piano roll

The detected notes appear here.

The preview plays the notes with a plain triangle-wave synth, not the sound chosen for the file; that choice is a program-change message other software reads.

Audio to MIDI Converter

Operator: Abdulla Al Fahad. How tools are built and checked

A test melody of four steady tones, 440 Hz for half a second, 523.25 Hz, a quarter-second rest, 659.26 Hz and 329.63 Hz, comes out of this page as four notes: 69, 72, 76 and 64 (A4, C5, E5 and E4), each read within 3 cents of equal temperament. The recording is looked at 50 times a second, each frame's fundamental frequency becomes a note number, and frames that agree are merged into one note with a start, an end and a velocity.

That works for one line at a time: a voice, a flute, a bass, a single guitar string. It does not work for chords, a full mix or two singers, because a pitch tracker follows a single fundamental.

A MIDI file is a list of notes, not a recording, so nothing of the original sound is kept: open the result in a notation or music program and give the line any instrument you like.

Key features

  • YIN pitch tracking with a 0.15 threshold and parabolic interpolation, so a pitch is read to a fraction of a semitone instead of the nearest spectrum bin
  • Silence threshold from -60 to -20 dBFS, shortest note from 30 to 400 ms and a clarity filter from 40 to 95%, all re-applied at once without re-analysing the file
  • A tempo estimate from the note starts (60 to 180 bpm, with a regularity score), or your own tempo from 30 to 300 bpm
  • Snapping to quarter, eighth or sixteenth notes, or exact timing
  • A piano roll, a triangle-wave preview of the notes and the original recording side by side to compare

How pitch becomes notes, and what it cannot hear

The input can be any audio or video file the browser can decode, up to 5 minutes. The sound is mixed to mono and decoded at 16,000 Hz, which is plenty for fundamentals up to 1,000 Hz (just above B5) and keeps the analysis quick. The lowest pitch searched for is 65 Hz, C2.

The output is a Standard MIDI File, format 0, with one track called Melody, 480 ticks per beat, a 4/4 time signature, your tempo and a program-change message for the sound you pick (acoustic piano, nylon guitar, violin, trumpet, alto sax, flute or square lead). The four-note test melody makes a 91-byte file.

Velocities run from 20 to 127, taken from the loudest frame of each note, with -40 dBFS mapped to 30 and -8 dBFS to 120.

How it works

For every 20 ms step a 48 ms window is compared with itself shifted by lags up to about 15 ms, the period of the 65 Hz floor. YIN's cumulative-mean-normalised difference function dips towards zero at the lag that matches the pitch period; the first dip below 0.15 is taken, refined by a parabola through its neighbours, and 16,000 divided by that lag is the frequency. Windows quieter than -60 dBFS are skipped, and a frame needs the clarity you set (1 minus the dip depth) to count as pitched.

Pitched frames get a 5-frame median to remove one-frame octave jumps, then are grouped: a note continues until the pitch moves more than 0.65 semitone from its running average, or until silence lasts more than 60 ms. Notes shorter than your minimum are dropped. The first note's start becomes tick 0, so leading silence is not saved. The tempo estimate projects every note start onto a circle one eighth note long for each candidate tempo; the tempo with the tightest cluster wins.

Common use cases

  • Humming a 20-second tune into a phone, converting it at 120 bpm with sixteenth-note snapping and opening the .mid in a notation program to correct the three notes that sit between two pitches
  • Turning a 45-second solo flute passage at 96 bpm into notes, then giving the file the flute program (73) so a synth plays it with a flute patch
  • Pulling a 2-minute bass line out of a bass-only stem to get a MIDI part that a software instrument can replay an octave lower
  • Checking by eye that a vocal take stays within a 9-semitone range before a rehearsal, using the lowest and highest note names in the summary

How to use this tool

  1. Drop a recording of one voice or instrument, up to 5 minutes. The analysis runs once and shows a progress bar you can cancel.
  2. Look at the piano roll. If notes are missing, lower the silence threshold or the clarity; if there are stray short notes, raise the shortest note.
  3. Check the tempo. Type the real one if you know it, or keep the estimate and read its regularity percentage.
  4. Choose the grid to snap to and the sound for the file, then play the MIDI preview and the original one after another.
  5. Click Download .mid.

Example

A melody at 120 bpm: A4 and C5 for half a second each, a quarter-second rest, then E5 and E4 for half a second each

Tempo 120 bpm (480 ticks per beat), first with the grid off, then snapped to sixteenth notes

Notes found, each as start tick + length in ticks

Grid off:        A4 0+480   C5 480+480   E5 1171+480   E4 1651+519
Sixteenth snap:  A4 0+480   C5 480+480   E5 1200+480   E4 1680+480
The first note is found 0.014 s into the file and becomes tick 0. E5 sounds at 1.25 s but is detected about 20 ms early, because the 48 ms analysis window sees the new pitch before it fully starts, so its start reads 1171 instead of 1200 until the snap puts it back. Velocity 113 for all four; the file is 91 bytes.

Tips for best results

  • A bend or slide wider than 0.65 semitone from the note's running average starts a new note. If a smooth glide turns into a staircase, raise the shortest note so the steps fall away, then fix the rest in the piano roll of a MIDI editor.
  • Singing with strong vibrato (more than about 65 cents either side) splits the note at each swing. Turn the clarity filter up a little and the shortest note up to 150 ms before concluding that the file is bad.
  • The first note is placed at tick 0. To line the MIDI up with a backing track, add the lead-in shown above the piano roll (for example 0.014 s) back in your music program.

Edge cases to watch

Breathy, noisy or very low sounds can make YIN land on an octave above or below the true pitch. A short jump is smoothed away; a long one stays in the file as a wrong note.

Any second sound, such as a backing track, room reverb that rings between notes, or a second voice, makes frames unclear and the notes patchy. Record dry, close up, one source.

Tempo comes only from note starts. A rubato performance gets a tempo with a low regularity score, and snapping to a grid will then move notes noticeably.

Common errors and how to fix them

The piano roll says no notes were found.
Nothing pitched rose above the silence threshold. Lower it towards -55 dBFS, lower the clarity needed, or check that the file is not a noisy or polyphonic recording.
A held note comes out an octave too high or too low.
YIN locked onto a harmonic or subharmonic, which breathy or very low sounds invite. Raise the clarity needed first; if the whole line is an octave off, open the .mid in MIDI Editor on this site and transpose the track by 12.
A recording is rejected as too long.
The limit is 5 minutes. Cut the part you need first, for example with Audio Cutter on this site, and load that.

Best practices

  • Fix the tempo before you pick the grid: the grid is a fraction of a beat, so a wrong tempo makes every snapped note land in the wrong place.
  • Switch between the MIDI preview and the original before downloading; a wrong octave is much easier to hear than to see.

Why it follows one note at a time

A pitch tracker answers one question per frame: what single period repeats here? A chord has several periods at once, and YIN's dip is then shallow and often lands on the lowest or loudest of them, which produces a line of unrelated notes. Polyphonic transcription needs a model trained on mixes, which this page does not have.

That is also why the settings are about confidence rather than detail. The clarity filter is the lever that decides whether an unsure frame counts as a note at all.

Frequently asked questions

Can it transcribe a guitar chord?

No. It tracks one pitch per frame, so a strummed chord becomes a short run of unrelated notes. Play the notes one at a time, or arpeggiate them.

Why does the MIDI file start with a note at tick 0 when my recording begins with silence?

The first detected note is moved to the start of the file. The page shows how many seconds that was, so you can add the gap back if you need the original alignment.

What tempo is used if the playing is not steady?

The estimate is still the best fit of a steady grid to the note starts, and the regularity percentage tells you how good the fit is. Type your own tempo to override it.