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.
Constructor
Section titled “Constructor”new PitchShift(pitch?: number)Parameters
-
pitch
numberoptionalThe interval to transpose the incoming signal by.
new PitchShift(options?: Partial<PitchShiftOptions>)Parameters
- options
Partial<PitchShiftOptions>optional
Properties
Section titled “Properties”delayTime
Section titled “delayTime”read-only
delayTime: Param<"time">The amount of delay on the input signal
feedback
Section titled “feedback”↳ inherited from FeedbackEffect
feedback: Param<"normalRange">The amount of signal which is fed back into the effect input.
↳ 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: numberRepitch 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
Section titled “windowSize”windowSize: numberThe 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.
Methods
Section titled “Methods”getDefaults()
Section titled “getDefaults()”static
getDefaults(): PitchShiftOptionsReturns all of the default options belonging to the class.
Returns PitchShiftOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()