What a free pitch shifter does to your drums
Our API can transpose the stems of a finished separation up or down by up to an octave. Before building it we measured the engines we could use, and we chose the one that measured worse. This is what it costs, so you can hear it coming rather than discover it.
What we compared
Two engines: librosa's phase vocoder, which is free and already in our stack, and Rubber Band, the well-known commercial-grade shifter, in its fast R2 and high-quality R3 modes. Each shifted the same 3-minute stereo test track by −5, −2, +2 and +5 semitones, three runs each, on 8 CPU cores. The test audio was synthesised from a recipe we could re-run at the shifted pitch, so the "correct" output was exact rather than a matter of taste.
| Engine | Pitch error (cents) | Speed | Punch kept |
|---|---|---|---|
| librosa phase vocoder (shipped) | 1.4 | 71× | 67–77% |
| Rubber Band R2 --fast | 1.8 | 38× | not measured |
| Rubber Band R3 --fine | 0.6 | 5.5× | 98–102% |
Pitch accuracy is not the problem
Every engine lands under 2 cents from the target pitch. Around 5 cents is roughly where a trained ear starts to notice, so all of them are, for tuning purposes, in tune. On sustained tonal material — pads, held chords, a sung note — they are within 0.6 dB of each other on spectral distance. If your stem is mostly that, the engine barely matters.
Transients are the problem
A phase vocoder processes sound in overlapping windows, and a drum attack is far sharper than those windows can follow. The attack gets smeared across the window. On our full test mix, librosa kept only 67–77% of the original transient punch; Rubber Band R3 kept 98–102%.
The smear runs backwards in time as well. On an isolated kick, the pre-echo ahead of the hit rose from −23.3 dB to −9.4 dB after shifting — a soft "ghost" of the kick you can hear arriving before the kick. It is worst on drum-heavy material and grows with the size of the shift.
No formant preservation
The other audible cost is on voices. A voice's formants — the resonances that make it sound like that person — move with the pitch in a plain shifter, so a vocal pushed up sounds thin and small, and pushed down sounds muffled. Rubber Band has a mode that holds formants in place; librosa does not.
Why we shipped the worse engine
Rubber Band is licensed under the GPL, with a paid commercial licence as the alternative. We chose not to buy one for now. That is a commercial decision, not a claim that the difference is inaudible — the table says it is not.
One counterintuitive upside: librosa is the fastest option, at 71 times realtime against R3's 5.5. The quality engine is the slow one, so the trade was never speed for quality; it was licence cost for transients.
How to get good results anyway
- Stay within ±2–3 semitones. This is where the phase vocoder holds up best.
- Expect the instrumental to suffer more than the vocal on drum-heavy tracks; the transient smear is a percussion problem.
- Listen to a large vocal shift before you commit to it. Beyond a few semitones the missing formant preservation is the thing you will notice first.
Limits
Every number here comes from synthetic test material. The transient finding is robust — theory and measurement agree, across four shift amounts, on isolated and mixed audio — but the exact percentages will not transfer one-for-one to a real record.
Try the vocal remover
Upload a song and hear a free 60-second preview of all six stems. No account needed.
Remove vocals free