ComfyUI Node

(SP) PitchShift

Shift pitch without the chipmunk problem

By c0ffymachyne·Created 2 years ago·Updated about a year ago· 22
(SP) PitchShift
  • audio_input
  • output_audio
pitch_shift_factor2

Sometimes you just need the same performance an octave down, without the whole thing speeding up or slowing down. (SP) PitchShift does exactly that: it changes the pitch of your audio while leaving the tempo alone. It's the "make the pad darker," "turn this vocal into a bass," and "add a sub layer under the lead" node.

The engine is torchaudio's pitch_shift implementation, which uses a phase-vocoder-style resample-and-interpolate approach. It's not magic - it's the standard DSP trick - but it's a lot better than the naive "resample and speed up everything" that gives you chipmunks. Time stays constant; only pitch moves.

The one knob

  • pitch_shift_factor - an INT in semitones, from -48 to +48, default 2. Yes, the default is positive, so out of the box it nudges you up a whole step. Each step is one semitone: 12 = an octave up, -12 = an octave down, -24 = two octaves down. It's an integer, so you can't get fine microtonal detune out of it - for a subtle detune you'd pair it with a mixer and offset copies, not fight this widget.

One output_audio output (yes, that's its real name) carries the shifted result.

Honest expectations

Keep shifts moderate. A single octave down on a vocal or pad sounds great; two octaves down (or up) starts to show the phase-vocoder's warbly, artificial side, especially on sustained notes with lots of high-frequency content. If you're building a bass from a vocal, -12 semitones plus a lowpass in (SP) Filter is a classic combo that hides the artifacts. If you're going for extreme transform (pitch and massive time stretch), that's PaulStretch's job, not this node's.

Two small things worth knowing. First, like every processor in this pack, it measures your input's LUFS loudness and normalizes the output back to the same level, so a shift won't change your perceived volume - good for honest A/B. Second, the shift happens on GPU if one's available and the audio gets moved back to CPU afterward, so it's fast even on longer clips.

Installing it

ComfyUI Manager → "Install Custom Nodes" → search ComfyUI Signal Processing, or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/c0ffymachyne/ComfyUI_SignalProcessing

then restart ComfyUI. Dependencies come from the pack's requirements.txt (scipy, pyfar, numpy, torch, torchaudio, pyloudnorm, cupy-cuda11x) - Manager installs them, or run pip install -r requirements.txt yourself. The repo is a work in progress, and because the pack imports the CuPy-based Limiter at startup, a CUDA/cupy mismatch is the usual reason the whole pack (PitchShift included) won't show up. Fix that first and this is one of the friendlier nodes in the set.

CategorySignal Processing

Inputs (2)

NameTypeDefaultDescription
audio_inputAUDIO
pitch_shift_factorINT2-48–48

Outputs (1)

NameTypeDescription
output_audioAUDIO