I learn songs by ear, and the loop is always the same: split the track somewhere, look up the chords somewhere else, then fight a tempo changer that shifts the pitch. I wrote Stemwise to keep that loop on my own machine.
What it does
Drop an audio file on a local page. Stemwise separates it into vocals, drums, bass, guitar, piano and other with Demucs htdemucs_6s, tracks beats and downbeats with beat_this, and estimates the chords and key. The page then opens a player where you can mute or solo any stem, loop a bar with L, slow the song down with the pitch held, transpose, and play along to a click that follows the song's own beat grid. The export menu gives you a backing track, the stems, a chord sheet and the beat grid as MIDI.
How the pitch stays put
The browser engine is an AudioWorklet that does WSOLA time stretching, with a cubic resampler for transposing. A unit test counts the zero crossings of a 440 Hz sine at 50, 70 and 150 percent speed and checks that the pitch doesn't move.
What I measured
stemwise bench runs the separation on a 2 minute 3 second song. On an RTX 5090 it takes 1.00 s, which is 122.5x realtime, best of 3 after one warmup run in fp32. On a Ryzen 5 7500F with 3 threads it takes 45.2 s, or 2.7x realtime.
The chords come from a CQT chroma model with templates, a bass bias and Viterbi smoothing. I tuned the constants on one clip in five of GuitarSet and scored the other 288. Root accuracy is 0.739 on strummed guitar and 0.265 on solos. Beats are reliable on the strummed parts. A solo of single notes carries little chord information, so the track is wrong there most of the time.
Limits
The key is one guess for the whole song. I've only run it on Linux, the package isn't on PyPI yet, and the live demo replays one separated song instead of processing your files. Only one song is processed at a time.
Try it
pip install git+https://github.com/Arthur031221/Stemwise
stemwise
The code is MIT licensed at https://github.com/Arthur031221/Stemwise and the demo is at https://arthur031221.github.io/Stemwise/. I built it with help from AI coding assistants. Which song should I try that would break the chord track?

Top comments (0)