Skip to content
Tone.js

PitchShift

class Effect ↳ extends FeedbackEffect<PitchShiftOptions>

PitchShift does near-realtime pitch shifting to the incoming signal. The effect is achieved by speeding up or slowing down the delayTime of a DelayNode using a sawtooth wave. Algorithm found in this pdf. Additional reference by Miller Pucket.

new PitchShift(pitch?: number)

Parameters

  • pitch number optional

    The interval to transpose the incoming signal by.

new PitchShift(options?: Partial<PitchShiftOptions>)

Parameters

read-only

delayTime: Param<"time">

The amount of delay on the input signal

↳ inherited from FeedbackEffect

feedback: Param<"normalRange">

The amount of signal which is fed back into the effect input.

↳ inherited from Effect

input: Gain

The effect input node

read-only

name: string

The name of the class

Default: "PitchShift"

↳ inherited from Effect

output: CrossFade

The effect output

↳ inherited from Effect

wet: Signal<"normalRange">

The wet control is how much of the effected will pass through to the output. 1 = 100% effected signal, 0 = 100% dry signal.

pitch: number

Repitch the incoming signal by some interval (measured in semi-tones).

const pitchShift = new Tone.PitchShift().toDestination();
const osc = new Tone.Oscillator().connect(pitchShift).start().toDestination();
pitchShift.pitch = -12; // down one octave
pitchShift.pitch = 7; // up a fifth
windowSize: number

The window size corresponds roughly to the sample length in a looping sampler. Smaller values are desirable for a less noticeable delay time of the pitch shifted signal, but larger values will result in smoother pitch shifting for larger intervals. A nominal range of 0.03 to 0.1 is recommended.

dispose(): this

Dispose and disconnect

Returns this

static

getDefaults(): PitchShiftOptions

Returns all of the default options belonging to the class.

Returns PitchShiftOptions