Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/spectral/delay-pitch-shifter transposes general stereo audio with two sweeping delay taps per channel; it needs no pitch detector. The ratio is 2^(semitones / 12) and each channel's tap phase advances by (1 − ratio) / windowFrames per sample. A second tap reads half a cycle away, and the two are crossfaded with weights sin²(π × phase) and its complement. It reads caller-owned rings before writing, outputs wet only, and slews the ratio through a 30 ms one-pole.

Parameters

configureDelayPitchShifter(state, leftShift, rightShift, windowMs, delayMs, phaseDegrees, smooth); non-finite values take the fallback.

ArgumentRange as codedFallbackUnit
leftShift, rightShift−25 to +250semitones
windowMs20 to 10050 (the init window)ms
delayMs0 to 30, added to a 2-frame minimum tap0ms
phaseDegrees0 to 180; offsets the right tap phase0degrees
smoothfalse jumps the ratios to their targetsflag

Lifecycle

Outside realtime, initDelayPitchShifter(sampleRate) (rate clamped to 8 to 192 kHz, 48 kHz for a non-finite rate) and two caller-owned fractional delay rings, each holding window + offset + 2 frames. Then configureDelayPitchShifter → delayPitchShifterTick(state, ringLeft, ringRight, left, right) per frame, reading outLeft and outRight → resetDelayPitchShifter, which resets phases and snaps the ratios to their targets; the caller resets or clears the rings.

When to use it

Transposing chords, drums or other material a pitch detector cannot follow, and opposite detune between channels (algorithm inventory).

Limits

  • Stereo frame tick; the state owns no storage. Non-finite inputs write 0.
  • No fixed latency: taps sweep. At zero shift and reset phase the delay is window/2 + offset (1202 frames for 50 ms at 48 kHz); the caller fades phase edits.
  • Wet only. A partial mix against the undelayed input can comb-filter.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

Dependents

Used by