Definition at line 48 of file polyblep_osc.hpp.
#include <polyblep_osc.hpp>
|
| | PolyBlepOsc ()=default |
| | Default constructor (Saw waveform).
|
| |
| | PolyBlepOsc (Waveform w) |
| | Construct with a specific waveform.
|
| |
| void | set_waveform (Waveform w) |
| | Set active waveform (discrete — no _su suffix)
|
| |
| void | set_pitch_su (float su) |
| | Set pitch from normalized [0,1] signal unit.
|
| |
| void | set_pulse_width_su (float su) |
| | Set pulse width from normalized [0,1] signal unit.
|
| |
| void | set_amplitude_su (float su) |
| | Set output amplitude from normalized [0,1] signal unit.
|
| |
| void | process (float *out, uint16_t frames, const float *fm_mod=nullptr, float fm_depth=0.0f) |
| | Generate audio samples, optionally with per-sample FM modulation.
|
| |
| void | sync () |
| | Hard sync — reset phase to zero.
|
| |
| void | sync (float phase) |
| | Reset phase to a specific value (0.0–1.0)
|
| |
| uint32_t | phase () const |
| | Current phase as uint32_t.
|
| |
| float | frequency () const |
| | Current normalized frequency (freq_hz / sample_rate)
|
| |
◆ PolyBlepOsc() [1/2]
| sbl::dsp::widgets::PolyBlepOsc::PolyBlepOsc |
( |
| ) |
|
|
default |
Default constructor (Saw waveform).
- Note
- All public methods are ISR-safe — bounded computation, no I/O.
◆ PolyBlepOsc() [2/2]
| sbl::dsp::widgets::PolyBlepOsc::PolyBlepOsc |
( |
Waveform |
w | ) |
|
|
inlineexplicit |
◆ set_waveform()
| void sbl::dsp::widgets::PolyBlepOsc::set_waveform |
( |
Waveform |
w | ) |
|
|
inline |
Set active waveform (discrete — no _su suffix)
Definition at line 61 of file polyblep_osc.hpp.
◆ set_pitch_su()
| void sbl::dsp::widgets::PolyBlepOsc::set_pitch_su |
( |
float |
su | ) |
|
|
inline |
Set pitch from normalized [0,1] signal unit.
- Parameters
-
| su | Unipolar [0,1] — maps to MIDI 24–120 (C1–C9) |
Definition at line 69 of file polyblep_osc.hpp.
◆ set_pulse_width_su()
| void sbl::dsp::widgets::PolyBlepOsc::set_pulse_width_su |
( |
float |
su | ) |
|
|
inline |
Set pulse width from normalized [0,1] signal unit.
- Parameters
-
| su | Unipolar [0,1] — linear map to 0.05–0.95 |
Definition at line 80 of file polyblep_osc.hpp.
◆ set_amplitude_su()
| void sbl::dsp::widgets::PolyBlepOsc::set_amplitude_su |
( |
float |
su | ) |
|
|
inline |
Set output amplitude from normalized [0,1] signal unit.
- Parameters
-
| su | Unipolar [0,1] — linear map to amplitude 0–1 |
Definition at line 90 of file polyblep_osc.hpp.
◆ process()
| void sbl::dsp::widgets::PolyBlepOsc::process |
( |
float * |
out, |
|
|
uint16_t |
frames, |
|
|
const float * |
fm_mod = nullptr, |
|
|
float |
fm_depth = 0.0f |
|
) |
| |
|
inline |
Generate audio samples, optionally with per-sample FM modulation.
When fm_mod is provided, per-sample exponential FM is applied around the stored frequency (set via set_pitch_su / set_frequency): freq = frequency_ * 2^(fm_mod[i] * fm_depth)
- Parameters
-
| out | Output buffer (float, [-1.0, 1.0]) |
| frames | Number of samples |
| fm_mod | FM modulation signal [-1,1] (nullptr = no modulation) |
| fm_depth | FM depth in octaves (e.g., 1.0 = ±1 octave) |
Definition at line 108 of file polyblep_osc.hpp.
References sbl::dsp::math::fast_exp2f().
Referenced by sbl::dsp::modules::MorphOsc< MaxFrames >::process().
◆ sync() [1/2]
| void sbl::dsp::widgets::PolyBlepOsc::sync |
( |
| ) |
|
|
inline |
◆ sync() [2/2]
| void sbl::dsp::widgets::PolyBlepOsc::sync |
( |
float |
phase | ) |
|
|
inline |
◆ phase()
| uint32_t sbl::dsp::widgets::PolyBlepOsc::phase |
( |
| ) |
const |
|
inline |
◆ frequency()
| float sbl::dsp::widgets::PolyBlepOsc::frequency |
( |
| ) |
const |
|
inline |
Current normalized frequency (freq_hz / sample_rate)
Definition at line 161 of file polyblep_osc.hpp.
◆ PolyBlepOscTestAccess
| friend struct PolyBlepOscTestAccess |
|
friend |
◆ sbl::dsp::modules::MorphOsc
The documentation for this class was generated from the following file: