Note: This post contains some gruesome details about software development. If you’re only interested in what this means for you as a Chronotron user, feel free to jump to the end of the article.
Chronotron currently relies on Spleeter AI to allow you to separate audio tracks into stems; in other words, to unmix music into individual tracks like bass, drums, vocals, and so on. If you want to know how to use this app feature, please feel free to check my previous post on music source separation.
Spleeter is not the only tool available for that purpose, though. Other software achieve similar and sometimes better results, depending on the audio material and the specific model selected.
While many of these models are available to end users as open-source projects under generous license terms, most of them require you to have a minimum knowledge of the Python environment and a fair amount of command-line prompt proficiency.
The demucs project from Facebook Research (Meta) is one such Python software package with excellent music separation capabilities. I thought it would be great to turn it into a standalone command-line executable that runs on Windows, and in this post, I’m going to show you how I did it.
So, without further ado, here’s my contribution to the demucs community!
Creating the demucs Executable Step by Step
Our goal is to create a standalone Windows executable, which I will name demucs_cli.exe, that allows you to separate audio tracks into stems by typing commands in the Windows Command Line prompt. For examples of demucs command-line usage, check the Separating Tracks section on the project website.
First off, let’s talk about the prerequisites: you should install Python 3.9, Git, and the Visual C++ runtime. When figuring out how to get there, I used a clean Windows 11 Virtual Machine, but you can try this on your main system if you’re brave enough.
Let’s now go for the beef. Open a command prompt and create a working directory for the mess you’re about to make:
md \work
cd \work
As a first step, clone the demucs project repository, by running the following command:
git clone https://github.com/facebookresearch/demucs.git
Once done, navigate to the project directory and install the software packages required by the project:
cd demucs
pip install -r requirements.txt
The above commands will take a while to complete. Be patient. Go grab a cup of tea or whatever.
The next step is really important. The “numpy” library needs to be downgraded to version 1.x, otherwise demucs will still compile, but fail at runtime, so run the following command:
pip install "numpy<2"
We aren’t quite there yet, but stick with me. Now, you will have to create two text files named launch_demucs.py and demucs_cli.spec with some specific content. Let’s do it via the command line just for fun, but you can use any text editor instead.
Create launch_demucs.py:
copy con launch_demucs.py
Paste the following content into the command line (yes, paste all lines in one go), press Ctrl+Z and then press Enter to save the file:
import sys
import os
# Add the demucs directory to Python path if needed (PyInstaller handles this)
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from demucs.separate import main
if __name__ == '__main__':
# Pass command-line args (e.g., demucs.exe myfile.mp3 --two-stems=vocals)
sys.exit(main(sys.argv[1:]))
Let’s now create demucs_cli.spec:
copy con demucs_cli.spec
Like for the previous file, paste the following content into the command line, press Ctrl+Z and then press Enter to save the file:
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['launch_demucs.py'],
pathex=[],
binaries=[],
datas=[
('demucs/remote/*', 'demucs/remote')
],
hiddenimports=[
'pkg_resources.py2_warn',
'torch',
'torchvision',
'torchaudio',
'torch.nn',
'torch.distributed',
'demucs.separate'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='demucs_cli',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
We’re almost there! Now we can build the actual executable:
pip install pyinstaller
pyinstaller demucs_cli.spec
The above commands will also take quite a while to finish, but once done you should see that demucs_cli.exe has been created under the dist directory. Hurray! Give it a try to see if it works:
dist\demucs_cli.exe --help
Try separating an actual audio file. Here I will assume that you have a WAV file named test.wav under your C:\Temp directory (otherwise, just adapt the command to your actual media location):
dist\demucs_cli.exe c:\temp\test.wav -o c:\temp\output -n mdx_extra_q
Note: if you want to process M4A or other types of media files directly with demucs, you should copy both ffmpeg.exe and ffprobe.exe to the same directory where demucs_cli.exe is. You can find a Windows build of the ffmpeg package on the Internet.
Side Notes and Caveats
I relied on Grok and Copilot to figure out these steps, including most of the .spec file content and the CLI wrapper script. Interestingly, although maybe unsurprisingly for many of you, neither of the two AI assistants alone led to a working solution. Still, they do help tremendously if you’re willing to go the extra mile and are aware of their shortcomings.
The resulting demucs_cli.exe requires the Visual C++ runtime to be installed, but that’s a common component that may be already deployed on your PC as part of other software packages.
Another caveat is that demucs_cli.exe cannot be readily used offline. The music separation AI models, which are large data files, are not included in the executable, but downloaded as required. By default, they’re kept in your user profile at %USERPROFILE%\.cache\torch\hub\checkpoints.
What All This Means for Chronotron Users
You guessed it. I’m considering including demucs_cli.exe in Chronotron as an alternative backend for music source separation. No single AI model works perfectly with every song, so having choices is always a good thing.
Moreover, Chronotron’s unique approach to music separation would bring a ton of user-friendliness to demucs: imagine downloading a YouTube video, isolating the vocals and instruments, and producing a video clip file that can be played on your standalone DVD player, where selecting an instrument or vocal track is as easy as switching the video language.
What do you think? Would adding demucs to Chronotron be helpful? Let me know in the comments.

A quick note on how to run demucs_cli.exe offline:
1-Download the .ht files for the models you’re planning use. One easy way to get them is by processing a sample music file and let demucs download the required .ht files, which you can then grab them from the local cache at %USERPROFILE%.cachetorchhubcheckpoints
2-Download the .yaml files corresponding to your model. They can be found on the Github repository.
3-Copy the .yaml and .ht files all together to a folder on your PC, and pass that directory to demucs_cli.exe via the –repo command line switch.