How to isolate the drums from a song and turn them into MIDI
The short version
- Separate the drum stem out of the song with Demucs — free, open source, runs on your own machine.
- Trim that stem down to a 2–4 bar groove that starts on a downbeat, and put the tempo in the filename, e.g.
Break_BPM174.wav. - Drop the clip into CedarGrooveNET to get a Standard MIDI File back — General MIDI drum map, channel 10, quantised to 16ths, velocities preserved.
- Fix the cymbals by hand: kick, snare and toms come back reliably, hi-hat, ride and crash are where the model guesses wrong.
Two constraints worth knowing before you start: CedarGrooveNET transcribes drums only (there is no pitch detection at all), and it rejects any file longer than 45 seconds. That is exactly why the separation step and the trim step both exist.
Why you can't skip the separation step
The obvious thing to try is dropping the whole song into a drum transcriber and hoping. It does not work, and it fails in a specific, predictable way rather than just being a bit noisy.
CedarGrooveNET finds hits by looking for onsets — sharp increases in energy — and then classifying what kind of drum caused each one. In a finished mix, the drums are not the only thing producing sharp low-frequency energy. The attack of a bass note, an 808 slide, a palm-muted guitar chug and a synth stab all read as onsets, and the ones in the low band read as kicks specifically, because that is the frequency region a kick occupies. You get a MIDI file with a plausible-looking kick pattern that is really a transcription of the bassline.
It compounds at the other end of the spectrum too. Audio is downmixed to mono and resampled to 22,050 Hz internally, which puts the Nyquist limit at about 11 kHz — the very top of a cymbal's spectrum falls outside what the model sees, which is likely one contributing factor, so cymbals are already the hardest class to get right. Adding vocal sibilance and hi-hat-shaped noise from every other instrument in the mix on top of that does not help.
Separation removes the cause rather than working around it. Once the bass and guitars are gone, the only transients left in the file are drums, and the onset detector has nothing else to react to.
Step 1 — Separate the drum stem with Demucs
Demucs is an open-source music source separation model from Meta AI research, released under the MIT license. It splits a mixed track into four stems — drums, bass, vocals and everything else — and it is the best free option for the drums stem specifically. You need at least Python 3.10.
Install it, or run it without installing:
uv tool install demucs # permanent install
python3 -m pip install -U demucs # or via pip
uvx demucs MY_TRACK.mp3 # or run it without installing at all
Then point it at the song:
demucs my_song.wav
The default model is htdemucs (Hybrid Transformer Demucs). Separated tracks are written to separated/MODEL_NAME/TRACK_NAME/ — so with the default model, separated/htdemucs/my_song/. Inside you get four stereo WAV files at 44.1 kHz: drums.wav, bass.wav, other.wav and vocals.wav. The one you want is drums.wav.
Two flags worth knowing:
--two-stems=drumsseparates drums from the rest of the accompaniment instead of producing all four stems. It is the faster path when drums are the only thing you care about — which, here, they are.--mp3writes MP3 instead of WAV, with--mp3-bitrateto set the rate (320 kbps by default). For transcription you should stay on WAV; there is no reason to add a lossy generation.
A GPU makes it much faster but is not required — it will run on CPU, just slowly. If you would rather not install anything, the Demucs README links an official Google Colab notebook you can run in a browser; Colab's free tier needs a Google account.
The version currently published on PyPI is 4.1.0, from July 2026. The author has said he is no longer actively developing Demucs, so do not expect new models — but the project is still installable, still MIT-licensed, and still the strongest free separator for this job.
Spleeter as a lighter alternative
Spleeter, Deezer's TensorFlow-based separator, is still on PyPI (version 2.4.2, MIT-licensed) and is noticeably lighter and faster than Demucs. Deezer stopped actively developing it several years ago, and the trade-off is quality: its drum stem carries more bleed and its cymbals come out noticeably worse than htdemucs. Since cymbal classification is already the weakest part of the transcription step, feeding it a worse cymbal signal is the wrong place to save time. Use it if Demucs will not run on your machine, not as a first choice.
Step 2 — Trim the stem to a usable clip
You now have a drum stem the length of the whole song. It cannot go into CedarGrooveNET as-is: anything over 45 seconds is rejected with an error. That is a hard ceiling, not a soft one.
There is a second limit underneath it that matters more in practice: the transcriber analyses up to the first 8 bars of whatever you send. Both limits are real and they coexist — 45 seconds is the rejection threshold, 8 bars is the analysis window. A 40-second clip is accepted and then only its first 8 bars are transcribed, so submitting long clips wastes your time rather than getting you more MIDI.
What to cut:
- Two to four bars is the sweet spot. That is a whole groove with enough repetition to be useful as a loop, and it sits comfortably inside the analysis window.
- Start on a downbeat. Cut on a bar line, not wherever the waveform looks convenient. Everything downstream — the bar windowing, the 16th-note grid — assumes bar one starts at sample zero.
- Pick a groove, not a fill. Fills are dense, tom-heavy and often rubato; they are the hardest thing for the model and the least useful thing to have as MIDI. Grab the steady bar before or after the fill instead.
- Leave the tempo alone. Do not time-stretch to a round number. Stretching adds artefacts that blur the onsets, and it is unnecessary — see below.
Put the BPM in the filename
This is the part nobody else can tell you, because it is specific to how CedarGrooveNET works: the tempo is parsed out of the filename. Name the clip so a number sits next to the letters bpm, in either order, and it will be picked up:
Break_BPM174.wav
90bpm.wav
amen-break-136bpm.wav
Any value from 30 to 300 is accepted. If no BPM can be parsed from the filename, the transcriber falls back to 120 BPM — and if your song is not at 120, the MIDI comes back on a grid that does not line up with the audio, which looks like the transcription failed when actually only the tempo assumption did. Renaming the file is a two-second fix for the single most common cause of a bad-looking result.
Format-wise, the Demucs output needs no conversion. WAV, MP3, AIFF and FLAC are all accepted, at 22.05 kHz to 96 kHz, mono or stereo. A 44.1 kHz stereo WAV out of Demucs lands squarely in range; it is downmixed to mono and resampled to 22,050 Hz internally before inference.
Step 3 — Transcribe the clip to MIDI
Drop the trimmed clip into the drum to midi converter. There is no account, no signup and nothing to install — there is a short per-minute rate limit, but no daily quota, so you can iterate on a clip as much as you need to.
What comes back is a Standard MIDI File:
- General MIDI drum map, channel 10, so it drops straight onto any drum instrument in any DAW.
- 480 ticks per quarter note.
- Quantised to a 16th-note grid.
- Velocities preserved from the dynamics of the original audio, so ghost notes stay ghost notes.
- 11 drum classes: kick, snare, closed hi-hat, open hi-hat, low tom, mid tom, high tom, crash, ride, clap and rim.
One thing to be clear about, because plenty of tools are vague on it: the browser version transcribes on our server, not in your browser. Your audio is held in memory for the duration of the request and is never written to disk; only a sanitised filename and the byte size are logged. If you need the audio never to leave your machine at all, the macOS app runs the whole pipeline offline.
Step 4 — Fix what the model got wrong
Expect to do a small amount of cleanup, and expect it to be in the same place every time: cymbal and hi-hat confusion is the common error. Closed hi-hat gets read as ride, ride as closed hi-hat, open hi-hat as crash. They are broadband noise bursts with similar envelopes, and the 22,050 Hz internal sample rate clips off the top end that would most easily distinguish them.
Kick, snare and the toms are reliable. They have strong, well-separated pitched components and distinct envelopes, and they are what the transcription is mostly made of, so the file you get back is usually right in structure and wrong only in cymbal labelling.
The efficient way to clean it up is to ignore the notes you trust and audition only the ones you do not. In your DAW, solo these GM notes and listen against the original stem:
| Drum | GM note | Trust it? |
|---|---|---|
| Kick | 36 | Reliable |
| Snare | 38 | Reliable |
| Low / mid / high tom | 45 / 48 / 50 | Reliable |
| Closed hi-hat | 42 | Check |
| Open hi-hat | 46 | Check |
| Crash | 49 | Check |
| Ride | 51 | Check |
In most cases the timing of the cymbal hits is correct and only the class is wrong, so fixing it is a matter of transposing a run of notes from 51 to 42 rather than re-drawing anything.
Optional Step 5 — Extend the loop
Once the two or four bars are correct, you do not have to stop there. You can open the drum grid and continue the pattern in the same style, which turns a four-bar transcription of somebody else's break into a longer arrangement you can keep editing. It is optional and entirely separate from the transcription — the MIDI you exported in step 3 is already finished and usable on its own.
When this workflow won't work
Three situations where it is better to know up front than to spend an hour finding out:
- Heavy room bleed. Live recordings taken with room or audience mics come out of separation with long reverb tails and crowd noise still attached. Reverb smears the onsets, and smeared onsets are exactly what the detector cannot resolve. Separation cannot remove a room from a recording — it was never encoded as a separate source.
- You want notation, not MIDI. This produces a Standard MIDI File on a quantised grid. It is not a drum transcription in the sheet-music sense: no staff, no stickings, no rudiment names, no dynamics markings. You can import the MIDI into notation software as a starting point, but you will be doing real editing work there, and if readable notation is the actual goal a notation-first tool is a better use of your time.
- The source is longer than 45 seconds and you do not want to chop it. There is no way around this one. The 45-second limit is enforced at upload and a longer file is rejected outright. If you want a full song transcribed end to end in one pass, this is not the tool — and it is fair to say so rather than have you find out after the separation step.
Frequently asked questions
Do I need to pay for Demucs?
No. Demucs is released under the MIT license and is free to install and run on your own machine. The current release on PyPI is version 4.1.0, published in July 2026. Its author has said he is no longer actively working on it, but the project is still published, still installable, and still the strongest free drum separator available. There is no account, no credit meter and no upload — the separation happens locally.
Will this work on a live recording with room mics?
Partly. Demucs will give you a drums stem from a live recording, but room mics and audience noise leave bleed and reverb tails in it, and reverb tails smear the onsets the transcriber depends on. Close-miked studio drums separate cleanly; a phone recording of a room usually does not produce a usable transcription. If you have the individual drum microphone tracks, skip separation entirely and transcribe a rough mix of those instead.
What if my song is 3 minutes long?
Separate the whole song with Demucs, then cut a short section out of the drum stem before transcribing. CedarGrooveNET rejects any file longer than 45 seconds with an error, and it analyses up to the first 8 bars of whatever you send, so there is nothing to gain by submitting a long clip. Two to four bars of the groove you actually want is the right size. If the song has several distinct drum sections, export each one as its own clip and transcribe them one at a time.
Does the stem need to be at the original tempo?
Yes, leave the tempo alone. CedarGrooveNET reads the BPM out of the filename — both Break_BPM174.wav and 90bpm.wav are recognised, and any value from 30 to 300 is accepted. If it cannot find a number it assumes 120 BPM, and the MIDI comes back on a grid that does not line up with the audio. Time-stretching the stem to a rounder tempo only adds artefacts; rename the file instead.
Can CedarGrooveNET separate the drums for me?
No. CedarGrooveNET is a transcriber, not a source separator. It turns drum audio into MIDI and has no pitch detection at all, so piano, guitar, bass, vocals and melody are out of scope too. Separation is a genuinely different problem, and Demucs already solves it well and for free, which is why the two tools are used one after the other rather than as alternatives.
