Hummingtomidi

From MP3 to Playable Piano Score — A Step-by-Step Tutorial

You have an MP3 of a melody and you want to play it on piano. This tutorial walks through the full path: pick a clean single-instrument recording, convert it to MIDI in your browser, then open that MIDI as a piano score in notation software or a DAW piano roll.

Short answer: Open the converter on this site, drop in a single-instrument MP3 (a solo melody line works best), click Convert, and download the .mid file. Then open that file in MuseScore, Flat.io, or your DAW's piano roll to see and edit the notes as a piano score. The conversion happens entirely in your browser — the file is decoded with decodeAudioData and processed on your device's CPU. No upload, no login, no server roundtrip.

The rest of this page covers what kind of MP3 produces a usable piano score, what the MIDI file contains when you open it, and how to clean up the output so it is actually playable.

Step 1: Choose the right MP3

The converter on this site uses autocorrelation pitch detection — a method that finds one fundamental frequency per analysis window. This means it detects one pitch at a time. A solo melody line — a single voice, a single flute, a single synthesizer lead — converts cleanly. A full mix with drums, bass, chords, and vocals all playing at once does not. The detector locks onto whatever pitch is loudest in each window, which may not be the melody you want.

For a piano score, the ideal input is:

If your MP3 is a full song, you will not get a clean piano score from it. You will get fragments of the loudest pitch at each moment, with gaps where the detector found silence or noise. If you want to extract a melody from a mixed recording, you would need to isolate the melody track first using a stem separation tool, then feed the isolated vocal or instrument track into the converter.

Step 2: Convert the MP3 to MIDI

Go to the converter page and either drag your MP3 into the drop zone or click to browse. The tool accepts MP3, WAV, OGG, M4A, AAC, FLAC, and Opus files. When the file loads, the browser decodes it locally:

audioBuffer = await ctx.decodeAudioData(buf);

This call happens in your browser's AudioContext. The file data never leaves your device. There is no upload to a server, no API call, and no login requirement.

After decoding, you see a waveform preview and a Convert button. Click Convert. The tool runs the pitch detection pipeline, generates a Standard MIDI File, and gives you a download link for the .mid file. You also see a detected-note list showing each note's name (like C4, D#4, F4), start time, and duration.

What the MIDI file contains

The output is a Standard MIDI File (SMF) format 0 with PPQ=480 and BPM=120. Each detected note becomes a note-on event with velocity 90 and a corresponding note-off event. Notes are quantized to the tick grid: Math.round(startSec * tps) where tps = PPQ * BPM / 60 = 960 ticks per second. The frequency-to-MIDI mapping is Math.round(69 + 12 * Math.log2(f / 440)) — the standard MIDI note number formula that converts a frequency in Hz to the nearest semitone on the 12-tone equal temperament scale.

Step 3: Open the MIDI as a piano score

Once you have the .mid file, you can open it in any of these programs to see it as notation or a piano roll:

MuseScore (free, desktop)

Open MuseScore, go to File > Open, and select your .mid file. MuseScore imports the MIDI as standard notation. You will see each note on a staff with its pitch and duration. The MIDI file's tempo (BPM=120) is imported as the score tempo. Each note appears with the pitch the detector found and the duration it measured.

Because every note in the MIDI file has velocity 90, MuseScore will not show dynamic markings — the velocity value is uniform. You can add dynamics (crescendos, accents, staccato markings) manually in the score editor after import.

Flat.io (free, browser)

Go to flat.io, create a free account, and import the MIDI file. Flat renders it as sheet music in your browser. You can edit notes, adjust durations, and add expression markings directly in the browser interface.

Your DAW's piano roll

If you are producing music rather than reading notation, open the MIDI file in your DAW — Ableton Live, FL Studio, Logic Pro, Cubase, Studio One, Reaper, or Bitwig Studio all import SMF format 0 files. The notes appear in the piano roll, where you can drag them, change their lengths, adjust velocity, and reassign the instrument.

For a detailed walkthrough of importing MIDI into specific DAWs, see MP3 to MIDI Into Your DAW.

Step 4: Clean up the score

The converted MIDI is a starting point, not a finished score. The autocorrelation detector produces pitch and timing data that is accurate enough to recognize the melody, but it has known behaviors you need to correct:

Fix octave errors

The autocorrelation method can lock onto a harmonic of the fundamental frequency instead of the fundamental itself. This means a note might appear one or more octaves higher than what you hear in the original recording. If a passage looks right melodically but sits too high or too low on the staff, select those notes and transpose them by one or more octaves in your notation software.

Fix note durations

The detector steps through audio in hops of 0.023 * sampleRate samples with a window of 0.046 * sampleRate samples. This means note boundaries are detected at discrete hop positions. A note's reported start time is the hop boundary, not the exact onset moment. Additionally, notes shorter than 0.05 seconds are filtered out entirely — they do not appear in the MIDI file.

In practice, this means note durations in the score will not match the original performance precisely. Some notes may be too long (the detector held them across a hop boundary) or too short (the detector caught only part of the note). Adjust durations in the notation editor until the rhythm looks right.

Remove false detections

The detector uses an RMS threshold of 0.008 to reject silence, and an amplitude threshold of 0.2 to trim the edges of each analysis window. In noisy recordings or quiet passages, the detector may produce spurious notes — pitches that do not correspond to anything you hear in the original. Compare the score against the original recording and delete any notes that do not belong.

Add the key signature and time signature

The MIDI file does not contain a key signature or time signature in musical notation terms. MuseScore and Flat will attempt to detect these on import, but you should verify them. If you know the key of the original recording, set it manually. The tempo in the MIDI file is BPM=120 — if the original recording was at a different tempo, change the project tempo in your notation software or DAW before working with the score.

Step 5: Play and verify

After cleaning up, play back the score in your notation software or DAW. Compare it to the original MP3. If a passage sounds wrong, go back to the detected-note list on the converter page — it shows each note's name, start time in seconds, and duration in seconds. This list is the raw data behind the MIDI file, and it can help you identify which notes the detector got right and which ones need correction.

You can also use the MIDI to WAV converter on this site to render the cleaned MIDI back to audio. This lets you hear the result without opening a DAW, and it gives you a quick check on whether your edits improved the score.

What kind of melodies convert best

Based on how the detector works — autocorrelation with a frequency range of 0 to 2000 Hz (if(f > 0 && f < 2000)) — melodies that convert most cleanly to a piano score are:

What this tutorial does not cover

This tutorial covers converting a single melodic line to a piano score. It does not cover:

Summary: the full path

Step What you do What happens technically
1. Prepare input Choose a clean, single-instrument MP3 Avoid mixed recordings — autocorrelation detects one pitch per window
2. Convert Drop the file into the converter, click Convert, download .mid decodeAudioData decodes locally; autoCorrelate detects pitch; buildMidi writes SMF format 0, PPQ=480, BPM=120, velocity=90
3. Open as score Import the .mid into MuseScore, Flat.io, or a DAW piano roll Notation software reads SMF note-on/note-off events as notes on a staff
4. Clean up Fix octaves, durations, remove false notes, add key and time signatures Correct for hop-based timing, harmonic locking, 0.05s minimum duration filter
5. Verify Play back and compare to the original MP3 Use the detected-note list and MIDI to WAV to check your edits
Convert your MP3 to MIDI now →