This version adds a song upload button.
The app flow is:
- Open the web app.
- Upload a song file.
- The Python server runs Demucs.
- Demucs splits the song into:
- vocals.wav
- drums.wav
- bass.wav
- other.wav
- The web app loads those stems.
- Hand tracking controls the stems.
- TouchDesigner receives the control values over UDP port 7000.
Open this folder in a terminal and run:
pip install -r requirements.txtOr:
pip install flask demucs torchcodecIf you see an error about torchcodec or Could not load libtorchcodec, install shared FFmpeg DLLs:
winget install --id Gyan.FFmpeg.Shared --exact --accept-package-agreements --accept-source-agreementsThen restart your terminal (or VS Code) so PATH updates take effect.
python server.pyOpen:
http://localhost:5050
- Click Choose File
- Select a song, like an mp3 or wav
- Click Upload + Auto Split
- Wait until it says the split is finished
- Click Play / Resume
- Click Start Hand Tracking
In TouchDesigner:
- Create a UDP In DAT
- Set the port to 7000
- Turn Active On
- Create a Constant CHOP named
controls - Create a DAT Execute DAT watching the UDP In DAT
- Paste the code from
touchdesigner_dat_execute.py
Auto splitting is not instant. It can take a few minutes, especially the first time, because Demucs may need to download model files.
For the cleanest demo, upload and split your song before judging starts, then use the hand tracking live during the demo.