|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Morphable PolyBLEP oscillator with three dedicated voices.
| MaxFrames | Maximum block size for internal scratch buffers. Default 48 matches standard DMA block size. |
Definition at line 59 of file morph_osc.hpp.
#include <morph_osc.hpp>
Public Member Functions | |
| void | set_pitch_su (float su) |
| Set pitch from normalized signal. [0,1] → C1–C9 (MIDI 24–120). | |
| void | set_morph_su (float su) |
| Set morph position from normalized signal. [0,1] → triangle→pulse→saw. | |
| void | set_pulse_width_su (float su) |
| Set pulse width from normalized signal. [0,1] → [0.05, 0.95]. | |
| void | set_drift_amount_su (float su) |
| Set analog drift amount from normalized signal. [0,1] → [0, 0.10] semitones. | |
| void | set_amplitude_su (float su) |
| Set output amplitude from normalized signal. [0,1] → [0, 1]. | |
| void | set_detune_cents (float cents) |
| Set detune offset in cents (±1200). Applied as a frequency ratio. | |
| void | set_drift_rate (float hz) |
| Set drift control rate in Hz. Call once at init. | |
| void | tick_drift () |
| void | reset () |
| Reset all oscillator phases and drift state to zero. | |
| void | process (float *out, uint16_t frames, const float *fm_mod=nullptr, float fm_depth=0.0f) |
Friends | |
| struct | MorphOscTestAccess |
|
inline |
Set pitch from normalized signal. [0,1] → C1–C9 (MIDI 24–120).
Definition at line 74 of file morph_osc.hpp.
References sbl::dsp::math::note_of_su(), and sbl::dsp::math::note_to_frequency().
|
inline |
Set morph position from normalized signal. [0,1] → triangle→pulse→saw.
Definition at line 81 of file morph_osc.hpp.
|
inline |
Set pulse width from normalized signal. [0,1] → [0.05, 0.95].
Definition at line 86 of file morph_osc.hpp.
|
inline |
Set analog drift amount from normalized signal. [0,1] → [0, 0.10] semitones.
Definition at line 92 of file morph_osc.hpp.
|
inline |
Set output amplitude from normalized signal. [0,1] → [0, 1].
Definition at line 98 of file morph_osc.hpp.
|
inline |
Set detune offset in cents (±1200). Applied as a frequency ratio.
Definition at line 106 of file morph_osc.hpp.
|
inline |
Set drift control rate in Hz. Call once at init.
Definition at line 109 of file morph_osc.hpp.
References sbl::dsp::comp::AnalogDrift::set_rate().
|
inline |
Advance drift state by one control tick. Call at control rate (~200 Hz). The ratios are applied internally on the next process() call.
Definition at line 117 of file morph_osc.hpp.
References sbl::dsp::comp::AnalogDrift::process(), and sbl::dsp::math::semitones_to_ratio().
|
inline |
Reset all oscillator phases and drift state to zero.
Definition at line 133 of file morph_osc.hpp.
References sbl::dsp::comp::AnalogDrift::reset(), and sbl::dsp::widgets::PolyBlepOsc::sync().
|
inline |
Render block, 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 = apply_detune(freq_hz_) * 2^(fm_mod[i] * fm_depth)
| out | Output buffer |
| 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 155 of file morph_osc.hpp.
References sbl::dsp::math::fast_exp2f(), and sbl::dsp::widgets::PolyBlepOsc::process().
|
friend |
Definition at line 232 of file morph_osc.hpp.