Class daisysp::Oscillator¶
ClassList > daisysp > Oscillator
#include <oscillator.h>
Public Types¶
Type | Name |
---|---|
enum | Oscillator |
Public Functions¶
Type | Name |
---|---|
void | Init (float sample_rate) |
bool | IsEOC () |
bool | IsEOR () |
bool | IsFalling () |
bool | IsRising () |
Oscillator () |
|
void | PhaseAdd (float _phase) |
float | Process () |
void | Reset (float _phase=0.0f) |
void | SetAmp (const float a) |
void | SetFreq (const float f) |
void | SetPw (const float pw) |
void | SetWaveform (const uint8_t wf) |
~Oscillator () |
Detailed Description¶
Synthesis of several waveforms, including polyBLEP bandlimited waveforms.
Public Types Documentation¶
enum @¶
This enum is anonymous
enum {
WAVE_SIN,
WAVE_TRI,
WAVE_SAW,
WAVE_RAMP,
WAVE_SQUARE,
WAVE_POLYBLEP_TRI,
WAVE_POLYBLEP_SAW,
WAVE_POLYBLEP_SQUARE,
WAVE_LAST,
};
Choices for output waveforms, POLYBLEP are appropriately labeled. Others are naive forms.
Public Functions Documentation¶
function Init¶
Initializes the Oscillator
Parameters:
sample_rate
- sample rate of the audio engine being run, and the frequency that the Process function will be called.
Defaults: * freq_ = 100 Hz * amp_ = 0.5 * waveform_ = sine wave.
function IsEOC¶
Returns true if cycle is at end of cycle. Set during call to Process.
function IsEOR¶
Returns true if cycle is at end of rise. Set during call to Process.
function IsFalling¶
Returns true if cycle falling.
function IsRising¶
Returns true if cycle rising.
function Oscillator¶
function PhaseAdd¶
Adds a value 0.0-1.0 (equivalent to 0.0-TWO_PI) to the current phase. Useful for PM and "FM" synthesis.
function Process¶
Processes the waveform to be generated, returning one sample. This should be called once per sample period.
function Reset¶
Resets the phase to the input argument. If no argumeNt is present, it will reset phase to 0.0;
function SetAmp¶
Sets the amplitude of the waveform.
function SetFreq¶
Changes the frequency of the Oscillator, and recalculates phase increment.
function SetPw¶
Sets the pulse width for WAVE_SQUARE and WAVE_POLYBLEP_SQUARE (range 0 - 1)
function SetWaveform¶
Sets the waveform to be synthesized by the Process() function.
function ~Oscillator¶
The documentation for this class was generated from the following file external-docs/DaisySP/Source/Synthesis/oscillator.h