Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::widgets::source::SuperSawOsc Class Reference

#include <supersaw_osc.hpp>

Collaboration diagram for sbl::widgets::source::SuperSawOsc:

Public Member Functions

 SuperSawOsc ()
 
void set_note (float midi_note, float sample_rate=48000.0f)
 Set pitch from MIDI note number.
 
void set_frequency (float freq_hz, float sr=48000.0f)
 Set frequency in Hz.
 
void set_detune (float cents)
 Set detune spread in cents.
 
void set_stereo_spread (float spread)
 Set stereo spread.
 
void set_amplitude (float amp)
 Set output amplitude.
 
void process_stereo (float *left, float *right, uint16_t frames)
 Render into stereo float buffers (accumulating)
 
void process (float *out, uint16_t frames)
 Render mono (sum of all 3 saws)
 
void sync ()
 Hard sync — reset all oscillator phases.
 
float frequency () const
 Current center frequency (normalized, for diagnostics)
 
float detune () const
 Current detune in cents.
 
float stereo_spread () const
 Current stereo spread.
 

Detailed Description

Definition at line 33 of file supersaw_osc.hpp.

Constructor & Destructor Documentation

◆ SuperSawOsc()

sbl::widgets::source::SuperSawOsc::SuperSawOsc ( )
inline
Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 37 of file supersaw_osc.hpp.

References set_amplitude().

Here is the call graph for this function:

Member Function Documentation

◆ detune()

float sbl::widgets::source::SuperSawOsc::detune ( ) const
inline

Current detune in cents.

Definition at line 167 of file supersaw_osc.hpp.

◆ frequency()

float sbl::widgets::source::SuperSawOsc::frequency ( ) const
inline

Current center frequency (normalized, for diagnostics)

Definition at line 164 of file supersaw_osc.hpp.

References sbl::widgets::source::PolyBlepOsc::frequency().

Here is the call graph for this function:

◆ process()

void sbl::widgets::source::SuperSawOsc::process ( float *  out,
uint16_t  frames 
)
inline

Render mono (sum of all 3 saws)

Does NOT accumulate — overwrites output.

Parameters
outOutput buffer (float, overwritten)
framesNumber of samples

Definition at line 143 of file supersaw_osc.hpp.

References sbl::widgets::source::PolyBlepOsc::process().

Here is the call graph for this function:

◆ process_stereo()

void sbl::widgets::source::SuperSawOsc::process_stereo ( float *  left,
float *  right,
uint16_t  frames 
)
inline

Render into stereo float buffers (accumulating)

ACCUMULATES into left[] and right[] — caller must zero the buffers before the first voice when mixing multiple SuperSaws.

Parameters
leftLeft output buffer (float, += semantics)
rightRight output buffer (float, += semantics)
framesNumber of samples

Definition at line 109 of file supersaw_osc.hpp.

References sbl::dsp::stereo::pan_mix(), and sbl::widgets::source::PolyBlepOsc::process().

Here is the call graph for this function:

◆ set_amplitude()

void sbl::widgets::source::SuperSawOsc::set_amplitude ( float  amp)
inline

Set output amplitude.

Amplitude is distributed equally across the 3 oscillators so their sum doesn't exceed the specified level.

Parameters
ampFloat amplitude (default 1.0)

Definition at line 91 of file supersaw_osc.hpp.

References sbl::widgets::source::PolyBlepOsc::set_amplitude().

Referenced by SuperSawOsc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_detune()

void sbl::widgets::source::SuperSawOsc::set_detune ( float  cents)
inline

Set detune spread in cents.

Parameters
centsDetune spread in cents (0–50 typical)

Definition at line 68 of file supersaw_osc.hpp.

◆ set_frequency()

void sbl::widgets::source::SuperSawOsc::set_frequency ( float  freq_hz,
float  sr = 48000.0f 
)
inline

Set frequency in Hz.

Parameters
freq_hzFrequency in Hz (e.g., 440.0f)
srSample rate (default 48000)

Definition at line 57 of file supersaw_osc.hpp.

References sbl::widgets::source::PolyBlepOsc::set_frequency().

Here is the call graph for this function:

◆ set_note()

void sbl::widgets::source::SuperSawOsc::set_note ( float  midi_note,
float  sample_rate = 48000.0f 
)
inline

Set pitch from MIDI note number.

Parameters
midi_noteMIDI note (69 = A4 = 440 Hz)
sample_rateSample rate (default 48000)

Definition at line 46 of file supersaw_osc.hpp.

◆ set_stereo_spread()

void sbl::widgets::source::SuperSawOsc::set_stereo_spread ( float  spread)
inline

Set stereo spread.

Parameters
spread0.0 = mono (all center), 1.0 = hard L/R

Definition at line 77 of file supersaw_osc.hpp.

◆ stereo_spread()

float sbl::widgets::source::SuperSawOsc::stereo_spread ( ) const
inline

Current stereo spread.

Definition at line 170 of file supersaw_osc.hpp.

◆ sync()

void sbl::widgets::source::SuperSawOsc::sync ( )
inline

Hard sync — reset all oscillator phases.

Definition at line 157 of file supersaw_osc.hpp.

References sbl::widgets::source::PolyBlepOsc::sync().

Here is the call graph for this function:

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