hum2midi
Hum a melody or beatbox a groove into your mic and get back a MIDI file you can drop straight into GarageBand.
The gap between having a melody in your head and having it in a DAW is
mostly typing. hum2midi closes it: hum the line, or beatbox the
groove, and it hands you a .mid file to import into GarageBand.
What it does
- Records from the mic in the browser, or takes a dropped
wav,m4a,mp3orwebmfile - Detects pitch with YIN, then segments the take into notes with start times, lengths and velocities
- Convert as Drum Kit maps a beatboxed take onto kit pieces instead of a melody, with a hat-bias control for takes that sit between a hat and a snare
- Tempo comes from tap tempo or from measuring an existing song file, and notes are quantised to a grid with adjustable strength
- Optional snapping to a key and scale, plus transpose in semitones
- Plays the result back through a built-in synth before you download it
What was interesting
Quantising is not free. Pulling every note to the nearest grid line at full strength flattens the feel that made the take worth keeping, so the grid has a strength rather than an on/off switch — 85% by default, which tightens the timing without turning it into a drum machine.
Scale snapping can do damage. Snapping to the wrong key does not produce a slightly-off melody, it produces a different one. So the sensitivity is exposed rather than guessed at, and snapping is opt-in.
Humming is not a clean signal. A hummed note drifts, slides between pitches, and carries breath noise at both ends. Deciding where one note stops and the next starts is the actual problem — pitch detection is the easy half.
How it's built
A single hand-written page — no framework — talking to a Python / FastAPI converter over a small JSON API. Audio capture uses MediaRecorder and the Web Audio API, with an AudioWorklet for the live meter; the page is served from Vercel and points at the converter's origin through one config value.
There is also a scratch deck hiding at the bottom of the page — a turntable with pitch, crossfader and cue — which has nothing to do with MIDI and stayed in anyway.