Lost In A Melody

Turn a song clip into a play-along piano guide: the notes fall onto an 88-key keyboard, and you play each one as it lands.

I can't read sheet music, so I built this to learn songs on my piano by ear. It pulls the tune out of a recording and shows it the way a rhythm game would. Here are two clips it processed. What you see is its raw output, with nothing corrected by hand.

Notes
Audio
0.0s

Reading the guide

How it works

  1. Separate. Demucs splits the clip into six stems: vocals, drums, bass, guitar, piano and everything else.
  2. Pick the stem that carries the tune. That's the one with the most signal: the voice in Amazing Grace, the piano in Greensleeves.
  3. Transcribe. Basic Pitch turns that stem into notes. The melody line is the highest note sounding at each moment.
  4. Line up with the beat. The notes are gently snapped to the detected tempo and saved as a short text file of notes in beats, easy to fix by hand.

It runs locally on a Mac with Apple silicon and doesn't need a GPU: a 30-second clip takes about ten seconds. This page plays clips that were processed ahead of time, so nothing runs on a server.

What it gets wrong

It does best when one voice or instrument clearly leads. A concert band, or a piano recording that the separator splits across two stems, comes out muddled, so those aren't shown here. Even in these two you'll spot slips: a brief F before many of the F♯s in Amazing Grace, where the singer slides up into the note, and a few low notes from the left hand in Greensleeves.

Credits