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::PolyBlepOsc Class Reference

#include <polyblep_osc.hpp>

Collaboration diagram for sbl::widgets::source::PolyBlepOsc:

Public Member Functions

void set_waveform (Waveform w)
 Set active waveform.
 
void set_frequency (float freq_hz, float sr=48000.0f)
 Set frequency in Hz.
 
void set_note (float midi_note, float sample_rate=48000.0f)
 Set frequency from MIDI note number (requires FPU)
 
void set_pulse_width (float pw)
 Set pulse width (only affects Pulse waveform)
 
void set_amplitude (float amp)
 Set output amplitude (0.0 = silence, 1.0 = full scale)
 
void process (float *out, uint16_t frames)
 Generate audio samples.
 
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 (for API compatibility with WavetableOsc)
 
float frequency () const
 Current normalized frequency (freq_hz / sample_rate)
 

Detailed Description

Definition at line 37 of file polyblep_osc.hpp.

Member Function Documentation

◆ frequency()

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

Current normalized frequency (freq_hz / sample_rate)

Definition at line 112 of file polyblep_osc.hpp.

Referenced by sbl::widgets::source::SuperSawOsc::frequency().

Here is the caller graph for this function:

◆ phase()

uint32_t sbl::widgets::source::PolyBlepOsc::phase ( ) const
inline

Current phase as uint32_t (for API compatibility with WavetableOsc)

Definition at line 107 of file polyblep_osc.hpp.

Referenced by sync().

Here is the caller graph for this function:

◆ process()

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

Generate audio samples.

Parameters
outOutput buffer (float, [-1.0, 1.0])
framesNumber of samples

Definition at line 78 of file polyblep_osc.hpp.

Referenced by sbl::widgets::source::SuperSawOsc::process(), and sbl::widgets::source::SuperSawOsc::process_stereo().

Here is the caller graph for this function:

◆ set_amplitude()

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

Set output amplitude (0.0 = silence, 1.0 = full scale)

Definition at line 71 of file polyblep_osc.hpp.

Referenced by sbl::widgets::source::SuperSawOsc::set_amplitude().

Here is the caller graph for this function:

◆ set_frequency()

void sbl::widgets::source::PolyBlepOsc::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 49 of file polyblep_osc.hpp.

Referenced by sbl::widgets::source::SuperSawOsc::set_frequency().

Here is the caller graph for this function:

◆ set_note()

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

Set frequency from MIDI note number (requires FPU)

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

Definition at line 58 of file polyblep_osc.hpp.

References sbl::dsp::note_to_frequency().

Here is the call graph for this function:

◆ set_pulse_width()

void sbl::widgets::source::PolyBlepOsc::set_pulse_width ( float  pw)
inline

Set pulse width (only affects Pulse waveform)

Parameters
pwPulse width, clamped to [0.05, 0.95]. Default 0.5.

Definition at line 66 of file polyblep_osc.hpp.

◆ set_waveform()

void sbl::widgets::source::PolyBlepOsc::set_waveform ( Waveform  w)
inline

Set active waveform.

Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 42 of file polyblep_osc.hpp.

◆ sync() [1/2]

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

Hard sync — reset phase to zero.

Definition at line 94 of file polyblep_osc.hpp.

Referenced by sbl::widgets::source::SuperSawOsc::sync().

Here is the caller graph for this function:

◆ sync() [2/2]

void sbl::widgets::source::PolyBlepOsc::sync ( float  phase)
inline

Reset phase to a specific value (0.0–1.0)

Definition at line 101 of file polyblep_osc.hpp.

References phase().

Here is the call graph for this function:

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