Gin
Loading...
Searching...
No Matches
WTOscillator Class Reference

Wavetable oscillator with interpolation and shaping options. More...

#include <gin_wtoscillators.h>

Classes

struct  Params

Public Member Functions

 WTOscillator ()=default
void setSampleRate (double sr)
void noteOn (float p=-1)
void process (float note, const Params &params, juce::AudioSampleBuffer &buffer)
void processAdding (float note, const Params &params, juce::AudioSampleBuffer &buffer)
void processAddingSimple (float note, const Params &params, juce::AudioSampleBuffer &buffer)
void processAddingComplex (float note, const Params &params, juce::AudioSampleBuffer &buffer)
void processAddingCrossfadeComplex (float note, const Params &params, juce::AudioSampleBuffer &buffer)
template<typename T>
void postProcess (const Params &params, T &v)
void setWavetable (Wavetable *table)
void setBlockDC (bool b)

Detailed Description

Wavetable oscillator with interpolation and shaping options.

WTOscillator provides high-quality wavetable synthesis with support for table morphing, formant shifting, phase distortion (bend), and post-processing effects like asymmetry and wavefolding. It uses band-limited wavetables to avoid aliasing.

Key Features:

  • Wavetable synthesis with linear interpolation
  • Table position morphing for timbral variation
  • Formant shifting (pitch-independent spectral shift)
  • Phase distortion (bend parameter)
  • Wavefolding and asymmetry effects
  • Optional DC blocking
  • SIMD optimization where available

Parameters (via Params struct):

  • position: Wavetable position (0.0 to 1.0)
  • bend: Phase distortion amount
  • formant: Formant shift (pitch-independent frequency shift)
  • asym: Asymmetry/waveshaping amount
  • fold: Wavefolding amount
  • leftGain/rightGain: Stereo output gains

Usage:

osc.setSampleRate(44100.0);
osc.setWaveTable(&myBandLimitedTables);
osc.noteOn(); // Initialize phase
params.position = 0.3f;
params.fold = 0.2f;
osc.process(60.0f, params, audioBuffer); // MIDI note 60 (C4)
WTOscillator()=default
void process(float note, const Params &params, juce::AudioSampleBuffer &buffer)
Definition gin_wtoscillators.h:84
void noteOn(float p=-1)
void setSampleRate(double sr)
Definition gin_wtoscillators.h:73
Definition gin_wtoscillators.h:63
float position
Definition gin_wtoscillators.h:66
float fold
Definition gin_wtoscillators.h:70
See also
BandLimitedLookupTable, DCBlocker

Constructor & Destructor Documentation

◆ WTOscillator()

WTOscillator::WTOscillator ( )
default

Member Function Documentation

◆ setSampleRate()

void WTOscillator::setSampleRate ( double sr)

◆ noteOn()

void WTOscillator::noteOn ( float p = -1)

◆ process()

void WTOscillator::process ( float note,
const Params & params,
juce::AudioSampleBuffer & buffer )

References processAdding().

◆ processAdding()

void WTOscillator::processAdding ( float note,
const Params & params,
juce::AudioSampleBuffer & buffer )

◆ processAddingSimple()

void WTOscillator::processAddingSimple ( float note,
const Params & params,
juce::AudioSampleBuffer & buffer )

◆ processAddingComplex()

void WTOscillator::processAddingComplex ( float note,
const Params & params,
juce::AudioSampleBuffer & buffer )

◆ processAddingCrossfadeComplex()

void WTOscillator::processAddingCrossfadeComplex ( float note,
const Params & params,
juce::AudioSampleBuffer & buffer )

◆ postProcess()

template<typename T>
void WTOscillator::postProcess ( const Params & params,
T & v )

◆ setWavetable()

void WTOscillator::setWavetable ( Wavetable * table)

◆ setBlockDC()

void WTOscillator::setBlockDC ( bool b)

The documentation for this class was generated from the following file: