Separating Stems from Any Track with Demucs
Learning objectives
- learner can separate any stereo track into stems from the CLI and from a Python script
- learner can choose an appropriate Demucs model variant for a speed/quality/stem-count trade-off
- learner can build a personal sample bank from separated stems while handling rescaling and clipping caveats
Capstone — one whole task that evidences the objectives
Take three released tracks and produce a curated sample bank: separate each into stems via the Demucs CLI and via the Python API, pick the right model variant per track, document the four-stem tensor layout you get back, and note where automatic output rescaling broke relative stem loudness in your bank.
Prerequisite modules
Every live coder eventually wants the isolated kick from a track that isn’t theirs, or a capella vocals to chop into a Strudel or Tidal set. This module builds toward exactly that whole task: turning released stereo mixes into a curated, performance-ready sample bank on your own machine — free, offline, no API key — using Demucs.
Start supported: with the concept of source separation in hand (“Music source separation splits a stereo mix into isolated stems”), run a single track through the one-line CLI (“Demucs separates any audio file from the command line with a single command”) and just listen to the four wavs that come back. That first win demystifies the tool. Next, deliberately re-run the same track with different model variants — default htdemucs versus the fine-tuned or six-stem versions — to hear the speed/quality/stem-count trade-off for yourself. Then move to scripting: “Demucs exposes a Python API” is your JIT pointer for wrapping separation in a batch pipeline, and the tensor-shape atom keeps you from the classic shape error when you drop below the friendly dict interface. Finally, assemble the bank, where the output-rescaling atom explains why your drums and quiet guitar suddenly peak at the same level.
The required atoms are exactly what the capstone cannot be done without: both invocation paths, the variant menu, the tensor layout you must document, and the rescaling caveat you must observe. The supporting atoms — SDR as a quality metric, why six-stem separation is harder, the hybrid waveform/spectrogram architecture, and the BagOfModels ensemble — deepen judgment about model choice but are not needed to ship the bank. Drill the CLI invocation until it’s automatic; it is the recurrent inner loop of every future sampling session.
Atoms in this module
Required — these gate the capstone
Supporting — enrichment, not gating
Part of curricula
- Audio-Visual Performer — integrated, synced live AV — Compose the whole (generative & AI-layered AV) optional
- Generative & AI AV Artist — real-time machine-driven performance — Orient the machine collaborator & ship a first ML AV artefact recommended
Unlocks — modules that require this one