A GUI wrapper around Demucs and ADTOF that separates a song into its individual parts — drums, bass, vocals, the rest — transcribes the drums to MIDI and sheet music, and lets you adjust the speed so you can play along.
Runs as a local web server — everything happens on your own machine, fully offline, nothing leaves your computer.
- Play from your library — point DrumLab at your music folders to build a searchable, artist-grouped song library, then select tracks straight from the browser.
- Play queue — pick from the library, drag files in directly or use party shuffle for play-along convenience.
- Separate the track — runs Demucs (full
htdemucsseparation) to split the song into drums / bass / other / vocals. Pick which sources to isolate; the rest can be summed into a single backing track. - Extract drum MIDI — runs ADTOF over the audio to detect kick, snare, toms, hi-hat and cymbals, and turns them into MIDI. Per-instrument detection thresholds can be nudged on-the-fly — hits are re-picked instantly without re-running the model.
- Verify & adjust — listen back and decide for yourself whether you like the result. Make basic MIDI edits, loop a section, and dial in per-lane gain knobs, stereo level meters (dBFS), and a pitch-preserved playback-speed knob.
- Export — stems in FLAC / WAV / AAC / ALAC / AIFF / OGG, plus MIDI, quantized MIDI, and MusicXML. Optionally export at the current playback speed.
Everything installs into a single Python environment:
- Python 3.10+ — a dedicated
venvor conda environment is strongly recommended. - FFmpeg on your
PATH— audio decode, format conversion, and time-stretching. - PyTorch (
torch+torchaudio) — install a CUDA build for GPU acceleration (see Install). A CPU-only build works too, just much slower. - Demucs — source separation, invoked as
python -m demucs. - ADTOF-pytorch — the drum-transcription
model (imported as
adtof_pytorch). DrumLab uses it as an installed package, or finds a sibling checkout at../ADTOF-pytorch/src/adtof_pytorch. - FastAPI + Uvicorn + python-multipart + music21 — the web server and MusicXML export. These are pure-Python and don't touch torch.
The one thing to get right is PyTorch first, so GPU support sticks. Both Demucs and ADTOF list
torchas a dependency; if you let pip install them before torch (or runpip install -Uafterwards), pip can quietly swap your CUDA build for a CPU-only one. Everything still runs — just on the CPU. So: install torch, then everything else, then verify CUDA is still there.
-
Get the code (DrumLab and, optionally, ADTOF-pytorch side by side):
git clone https://github.com/DomekRomek/Drumlab.git git clone https://github.com/xavriley/ADTOF-pytorch.git # optional — pip-install alternative below cd Drumlab
-
Create and activate an environment:
python -m venv .venv .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
-
Install PyTorch with CUDA. Grab the exact command for your OS + CUDA version from the official selector. For example:
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu130
(Drop the
--index-urlfor a CPU-only build.) -
Install the rest
If you cloned ADTOF-pytorch as a sibling folder instead, you can skip the second command.
pip install demucs fastapi uvicorn python-multipart music21 pip install --no-deps git+https://github.com/xavriley/ADTOF-pytorch.git
--no-depsstops pip from reinstalling torch over the CUDA build from step 3. -
Verify CUDA (optional)
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"If this prints
True, you're set for GPU. If it flipped toFalse, you may want to try re-doing step 3. -
Install FFmpeg if you don't have it (download), and make sure
ffmpegis on yourPATH.
.venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
python app.pyThis starts the server on 127.0.0.1:8765 and opens it in your default browser.
| Flag | Effect |
|---|---|
--port N |
listen on a different port (default 8765) |
--host ADDR |
bind address (default 127.0.0.1; 0.0.0.0 to expose on your LAN) |
--no-browser |
don't open a browser window |
--preload |
download all Demucs models, then exit |
--library FOLDER |
index a folder for the song library / party shuffle (repeatable) |
Song library. The party-shuffle / up-next browser indexes folders you point it at. Pass
--library FOLDER(repeatable) to index one or more folders at startup — e.g.python app.py --library "D:\Music"— or start without it and pick a folder from the UI. With no library configured the browser just starts empty.
Single shared workspace. DrumLab is a single-user tool: the server keeps one global state (current song, stems, transcription). Every browser that connects — including a second tab or another device when you bind with
--host 0.0.0.0— sees and edits that same workspace. Loading a song on your phone replaces what's on your PC. This is by design; don't run two clients against one server expecting independent sessions.
app.py FastAPI server + pipeline orchestration + exports
adtof_worker.py ADTOF inference, run as a separate killable subprocess
requirements-extra.txt DrumLab's own (non-torch) dependencies
static/ single-page UI (index.html, app.js, style.css, score viewer)
static/vendor/ pinned local copies of WaveSurfer, Tone.js, OSMD (no CDN)
workdir/ runtime caches + generated downloads — safe to delete
This started from wanting a slick way to prep songs to play along to and slow them down to my skill level — on my own machine, without having to fiddle with my DAW every time. As an intermediate drummer I just wanted one tool that did exactly what I wanted, but after ironing wrinkles enough times it turned into something pleasant for me to use, so I figured I'd put it out there in case it's useful to someone else.
- DomekRomek — system architecture, testing, debugging, UI/UX.
- Claude — code writing.
Built on Demucs for source separation and ADTOF-pytorch for drum transcription, with music21 for MusicXML, FastAPI and Uvicorn running the server, and WaveSurfer.js, Tone.js, and OpenSheetMusicDisplay for the UI.
Thank you to the developers of these projects for making my life easier.
