Nodes/OmniNodes/Audio Pitch Shift 🎼
ComfyUI Node

Audio Pitch Shift 🎼

Two Octaves of Transpose, No librosa Required

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Audio Pitch Shift 🎼
  • audio_samples
  • audio
  • summary
β—„semitones0.0β–Ί
β—„fft_size2048β–Ί
β—„hop_length512β–Ί
β—„preserve_formantsfalseβ–Ί

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) and hop_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. When preserve_formants is 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.

CategoryTensorVizion/Audio

Inputs (5)

NameTypeDefaultDescription
audio_samplesAUDIOβ€”
semitonesFLOAT0.0-24–24β€”
fft_sizeINT2048512–8192β€”
hop_lengthINT51264–2048β€”
preserve_formantsBOOLEANfalseβ€”

Outputs (2)

NameTypeDescription
audioAUDIOβ€”
summarySTRINGβ€”