Melody Sketcher
Hum or whistle into your mic and watch it become editable notes — then download a real MIDI file. Pitch detection, piano-roll editing, and synthesis, all in your browser.
Melody Sketcher
Got a tune stuck in your head? Hum it. Melody Sketcher listens through your microphone, tracks the pitch in real time on an oscilloscope-style display, and turns what it hears into notes on an editable piano roll. When it sounds right, export a standard MIDI file that opens in GarageBand, Ableton, Logic, or any other DAW. Everything — pitch detection, note segmentation, key analysis, MIDI encoding — runs locally in your browser; no audio is ever uploaded.
How to Use:
- Record — tap the red mic button and hum, whistle, or sing one note at a time (whistling gives the cleanest tracking). Tap again to finish, or let it stop at 30 seconds. No mic? Hit Load the demo melody to see the whole pipeline run on a synthetic hum
- Watch the trace — while recording, the live display shows your pitch curve, the nearest note name, the cents deviation (a built-in tuner), and your input level
- Edit on the piano roll — drag notes to move them in time or pitch (you’ll hear each change), drag a note’s right edge to stretch it, double-click to add or delete notes, and click the piano keys on the left to preview a pitch
- Shape the result — set the tempo with the BPM slider, snap timing with Quantize, choose a synth voice, and loop playback while you tweak
- Take it with you — Export MIDI downloads a
.midfile; Copy notes puts the note names on your clipboard
| Control | Effect |
|---|---|
| Mic button | Start / stop recording (max 30 s) |
| Demo melody | Runs a synthetic hum through the same detection pipeline |
| Play / Loop | Plays the notes with the built-in synth; loop repeats from the cursor |
| BPM | Playback tempo, also written into the exported MIDI (50–200) |
| Grid | Snap resolution for editing and quantizing: 1/16, 1/8, or free |
| Voice | Synth waveform: Soft, Pure, Reed, or Chip |
| Quantize | Snaps all note starts and lengths to the current grid |
| Export MIDI | Downloads the melody as a standard MIDI file (format 0) |
| Key badge | Estimated key of the melody, updated as you edit |
Keyboard shortcuts on the editor: space to play/stop, arrow keys to nudge the selected note (shift+↑/↓ jumps an octave), delete to remove it, ctrl+z to undo, and clicking the ruler moves the playback start marker.
How it works: the microphone feed is analyzed ~60 times a second with a normalized autocorrelation function (McLeod-style NSDF) that estimates the fundamental frequency between 70 Hz and 1.1 kHz. The resulting pitch track is median-filtered, then split into notes wherever the pitch jumps more than three quarters of a semitone or the sound breaks for ~90 ms. Each note’s pitch is the median of its frames, its velocity comes from loudness, and the sequence is snapped to the beat grid. The key badge uses the Krumhansl–Schmuckler algorithm — correlating a duration-weighted pitch-class histogram against major and minor key profiles. Export builds the MIDI file byte by byte (header, tempo meta event, variable-length delta times) and hands it to you as a download.