|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <supersaw_osc.hpp>
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. | |
Definition at line 33 of file supersaw_osc.hpp.
|
inline |
Definition at line 37 of file supersaw_osc.hpp.
References set_amplitude().
|
inline |
Current detune in cents.
Definition at line 167 of file supersaw_osc.hpp.
|
inline |
Current center frequency (normalized, for diagnostics)
Definition at line 164 of file supersaw_osc.hpp.
References sbl::widgets::source::PolyBlepOsc::frequency().
|
inline |
Render mono (sum of all 3 saws)
Does NOT accumulate — overwrites output.
| out | Output buffer (float, overwritten) |
| frames | Number of samples |
Definition at line 143 of file supersaw_osc.hpp.
References sbl::widgets::source::PolyBlepOsc::process().
|
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.
| left | Left output buffer (float, += semantics) |
| right | Right output buffer (float, += semantics) |
| frames | Number of samples |
Definition at line 109 of file supersaw_osc.hpp.
References sbl::dsp::stereo::pan_mix(), and sbl::widgets::source::PolyBlepOsc::process().
|
inline |
Set output amplitude.
Amplitude is distributed equally across the 3 oscillators so their sum doesn't exceed the specified level.
| amp | Float amplitude (default 1.0) |
Definition at line 91 of file supersaw_osc.hpp.
References sbl::widgets::source::PolyBlepOsc::set_amplitude().
Referenced by SuperSawOsc().
|
inline |
Set detune spread in cents.
| cents | Detune spread in cents (0–50 typical) |
Definition at line 68 of file supersaw_osc.hpp.
|
inline |
Set frequency in Hz.
| freq_hz | Frequency in Hz (e.g., 440.0f) |
| sr | Sample rate (default 48000) |
Definition at line 57 of file supersaw_osc.hpp.
References sbl::widgets::source::PolyBlepOsc::set_frequency().
|
inline |
Set pitch from MIDI note number.
| midi_note | MIDI note (69 = A4 = 440 Hz) |
| sample_rate | Sample rate (default 48000) |
Definition at line 46 of file supersaw_osc.hpp.
|
inline |
Set stereo spread.
| spread | 0.0 = mono (all center), 1.0 = hard L/R |
Definition at line 77 of file supersaw_osc.hpp.
|
inline |
Current stereo spread.
Definition at line 170 of file supersaw_osc.hpp.
|
inline |
Hard sync — reset all oscillator phases.
Definition at line 157 of file supersaw_osc.hpp.
References sbl::widgets::source::PolyBlepOsc::sync().