Gin
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
VoicedStereoOscillator< O, P > Class Template Reference

Stereo oscillator with multiple voices for unison/detuning effects. More...

#include <gin_oscillators.h>

Public Member Functions

 VoicedStereoOscillator ()=default
 
void setSampleRate (double sr)
 
void noteOn (float phase=-1)
 
void noteOn (float phases[])
 
void process (float note, const P &params, juce::AudioSampleBuffer &buffer)
 
void processAdding (float note, const P &params, juce::AudioSampleBuffer &buffer)
 

Protected Attributes

juce::OwnedArray< Ooscillators
 

Detailed Description

template<typename O, typename P>
class VoicedStereoOscillator< O, P >

Stereo oscillator with multiple voices for unison/detuning effects.

VoicedStereoOscillator is a template class that wraps any oscillator type (O) and adds multi-voice capabilities with stereo spread, detuning, and panning. This creates rich, thick unison sounds commonly used in synthesizers.

Key Features:

The voices are evenly distributed across:

Template Parameters:

Usage:

// Typically used via derived classes like BLLTVoicedStereoOscillator
// or WTVoicedStereoOscillator, but can be used directly:
osc.setSampleRate(44100.0);
osc.noteOn(); // Initialize all voices
params.voices = 4; // 4 voices for thick sound
params.detune = 0.15f; // Detune range in semitones
params.spread = 0.7f; // Stereo spread amount
params.pan = 0.0f; // Center pan
params.gain = 1.0f;
osc.process(60.0f, params, audioBuffer);
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
float spread
Stereo spread amount (0.0 = mono, 1.0 = full stereo)
Definition gin_oscillators.h:135
float detune
Detune amount between voices (in semitones or cents)
Definition gin_oscillators.h:136
float gain
Overall gain/volume (0.0 to 1.0+)
Definition gin_oscillators.h:137
float pan
Stereo pan position (-1.0 = left, 0.0 = center, 1.0 = right)
Definition gin_oscillators.h:134
int voices
Number of voices (1-N for unison)
Definition gin_oscillators.h:133
Extended parameters for band-limited voiced stereo oscillator.
Definition gin_oscillators.h:267
See also
VoicedOscillatorParams, BLLTVoicedStereoOscillator, WTVoicedStereoOscillator

Constructor & Destructor Documentation

◆ VoicedStereoOscillator()

Member Function Documentation

◆ setSampleRate()

template<typename O , typename P >
void VoicedStereoOscillator< O, P >::setSampleRate ( double  sr)

◆ noteOn() [1/2]

template<typename O , typename P >
void VoicedStereoOscillator< O, P >::noteOn ( float  phase = -1)

◆ noteOn() [2/2]

template<typename O , typename P >
void VoicedStereoOscillator< O, P >::noteOn ( float  phases[])

◆ process()

template<typename O , typename P >
void VoicedStereoOscillator< O, P >::process ( float  note,
const P params,
juce::AudioSampleBuffer &  buffer 
)

◆ processAdding()

template<typename O , typename P >
void VoicedStereoOscillator< O, P >::processAdding ( float  note,
const P params,
juce::AudioSampleBuffer &  buffer 
)

Member Data Documentation

◆ oscillators

template<typename O , typename P >
juce::OwnedArray<O> VoicedStereoOscillator< O, P >::oscillators
protected

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