Rehearsel
Neural stem separation and real-time pitch/tempo DSP, in one desktop app.
- Role
- Desktop & AI Systems Engineer
- Platforms
- macOS
- Year
- 2025
I wanted to learn a song well enough to post a cover of it, and the melodies were intricate enough that I could not pick them out by ear.
Getting there meant a YouTube download, a conversion to audio, Logic Pro to separate stems, hunting for the vocal or instrumental part I needed, then searching chord sites and trying them against the recording to find what actually matched, all before slowing anything down to practise. Too many disconnected tools for one goal: learn this song. Rehearsel is all of it in one app, a Tauri shell in Rust supervising a Python ML sidecar, with a Web Audio DSP graph doing pitch and tempo in real time. Demucs splits the mix into four stems; a BTC transformer reads the chords. I built it for myself and I still use it.
- 4
- neural-separated stems
- 50–200%
- tempo, pitch preserved
- ±12
- semitone transposition
- Tauri v2
- Rust
- Python
- FastAPI
- PyTorch
- Demucs
- Web Audio API
- SoundTouch
How it started.
The friction
I wanted to learn a song properly, well enough to post a cover of it. The melodies were intricate, and I could not pick them apart by ear.
What existed
So I did what you do. Download the video. Convert it to audio. Open Logic Pro and separate the stems. Hunt through them for the part I actually needed. Go looking across chord sites, try what they gave me against the recording, and work out which of it was right. Then slow the passage down to practise it, which drops the pitch, so that fights you too.
Where it broke
None of those steps were hard. There were just too many of them, and none of the tools knew about each other. Every one of them was built for something bigger than what I wanted, which was one thing: learn this song.
What I built
One application that does the whole path. A Tauri shell in Rust supervises a Python ML sidecar so the models ship inside the app rather than sitting in an environment you have to maintain. Demucs splits a mix into four stems, a BTC transformer reads the chord changes, and a Web Audio DSP graph decouples tempo from pitch, so a solo can run at half speed in its original key.
What it changed
It replaced the whole chain for me. I still use it, which is the only test I had in mind when I started.
How it fits together.
Shell
Tauri v2 Core
Rust · supervisor
Spawns & health-checks sidecar
Interface
React Workstation
Mixer · waveform · chords
Interface
Web Audio DSP
SoundTouch · Rubber Band
Pitch ⊥ tempo
Inference
FastAPI Sidecar
localhost:8420
Inference
Demucs
4-stem separation
Inference
BTC Transformer
Chord recognition
Storage
SQLite Library
Grids · markers · stems
How it was built.
Rust supervising a Python sidecar
- Problem
- The ML models are PyTorch: Demucs, a BTC chord transformer, Whisper. That is Python, unavoidably. But shipping a desktop app means the user double-clicks an icon and it works, with no environment to manage and no orphaned processes when they quit.
- Approach
- The Tauri Rust core spawns the Python FastAPI sidecar on localhost:8420, polls for socket health before routing any IPC, and tears the process down deterministically on window close. Shared type definitions across Rust, Python and TypeScript keep the three-language contract honest.
- Trade-off
- A native .dmg with the full ML pipeline embedded. The lifecycle code is genuinely fiddly (process supervision is where hybrid apps usually leak), but it is the part that makes it feel like an app rather than a dev environment.
Compute once at ingest, never at playback
- Problem
- Demucs separation and transformer chord inference are heavy. Running them during playback would make scrubbing impossible and pin the CPU.
- Approach
- Everything expensive runs once when a track is ingested. Stems land on disk as WAVs; chord grids, beat markers and sections go into SQLite. Playback reads precomputed data only.
- Trade-off
- Instant track switching and 60fps waveform rendering with no real-time inference. Ingest takes longer and uses disk. The right place to spend both.
Real DSP instead of playbackRate
- Problem
- The HTML5 audio element can change speed, but it shifts pitch with it. A solo slowed to half speed drops an octave and becomes useless for learning.
- Approach
- A custom Web Audio buffer-node graph running SoundTouch and Rubber Band time-stretching, decoupling tempo from pitch so each can move independently.
- Trade-off
- Slow a passage to 50% at original pitch, or transpose to a singable key at full speed. The two things a practising musician actually needs.
