Audio Pitch Shift πΌ
Two Octaves of Transpose, No librosa Required
- audio_samples
- audio
- summary
Pitch shifting is the sound-design trick that makes a voice sound chipmunky, a generator's flat TTS read like an announcer, or a vocal sample fit a different key. Audio Pitch Shift does it with a phase vocoder implemented in pure NumPy - no librosa, no soundfile, no extra installs - over a range of Β±24 semitones (two octaves either way). semitones is the whole game: positive shifts up, negative shifts down, in half-step increments.
How it works, briefly
A phase vocoder does the classic trick: it first time-stretches the audio without changing pitch, then resamples it to restore the original duration - net result, pitch moved with length preserved. If that sounds like a lot of signal processing for a node, it is, but the code does the STFT, phase accumulation, and resynthesis itself. No model, no heavy dependency, just FFT math.
Two settings you mostly won't touch but should know exist:
fft_size(default 2048) andhop_length(default 512) - the analysis window and step. Bigger FFT frames are smoother but blur transients; the defaults are a sane middle for music and voice. If you're shifting a percussive track and hearing smearing, smaller frames help; if you're shifting sustained pads and hearing warble, bigger ones help.preserve_formants- off by default, and it's the honest catch. A straight pitch shift moves everything up or down, including the resonant formants that make a voice sound like the same person. Chipmunk voices are the result. Whenpreserve_formantsis on, the node tries to keep those formant frequencies anchored so a voice stays recognizable as the same voice at a different pitch - the difference between "chipmunk" and "that guy, but higher." It's a first-order attempt, not studio-grade formant shifting, but it's the difference between unusable and usable for voice work.
What to expect (the honest part)
This is a transpose, not a time-stretch - length is preserved, so it's not for "slow this down" jobs. And like all phase vocoders, big shifts on complex material (dense mixes, heavy reverb) get progressively more artifact-y. Shifting a clean vocal by +7 is easy; shifting a full mastered track by +12 is going to wobble. That's inherent to the technique, and this being a dependency-free implementation means it's comparable to mid-tier phase vocoders, not to paid plugins with years of artifact-suppression tuning.
The outputs are the shifted audio plus a summary string. Nothing exotic.
Install
ComfyUI Manager β search OmniNodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI; it's under TensorVizion/Audio. No extra dependencies is the actual headline here - a pitch shifter you don't have to pip install librosa for is a pitch shifter that just works on a fresh ComfyUI.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_samples | AUDIO | β | |
| semitones | FLOAT | 0.0-24β24 | β |
| fft_size | INT | 2048512β8192 | β |
| hop_length | INT | 51264β2048 | β |
| preserve_formants | BOOLEAN | false | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | β |
| summary | STRING | β |