Class thl::dsp::utils::PitchShifter#

class PitchShifter#

Two-grain overlap-add pitch shifter with Hann-window crossfade.

Two read heads traverse a circular buffer at a rate proportional to the pitch ratio, crossfaded with a Hann window so the two grains always sum to 1.0, hiding grain boundaries.

The circular buffer is backed by an BufferF (heap-allocated).

Call prepare() before use.

Public Functions

PitchShifter()#
void prepare(int window_size = 2048)#
void set_pitch(float semitones, float cents = 0.0f)#
void set_cents_modulation(float cents_offset)#
void reset()#
float process(float x)#