daisysp::Oscillator¶
#include <oscillator.h>
Public Types¶
Name | |
---|---|
enum | @3 |
Public Functions¶
Name | |
---|---|
Oscillator() | |
~Oscillator() | |
void | Init(float sample_rate) |
void | SetFreq(const float f) |
void | SetAmp(const float a) |
void | SetWaveform(const uint8_t wf) |
void | SetPw(const float pw) |
bool | IsEOR() |
bool | IsEOC() |
bool | IsRising() |
bool | IsFalling() |
float | Process() |
void | PhaseAdd(float _phase) |
void | Reset(float _phase =0.0f) |
Detailed Description¶
Synthesis of several waveforms, including polyBLEP bandlimited waveforms.
Public Types Documentation¶
enum @3¶
Enumerator | Value | Description |
---|---|---|
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 Oscillator¶
function ~Oscillator¶
function Init¶
Parameters:
- sample_rate - sample rate of the audio engine being run, and the frequency that the Process function will be called.
Initializes the Oscillator
Defaults:
- freq_ = 100 Hz
- amp_ = 0.5
- waveform_ = sine wave.
function SetFreq¶
Changes the frequency of the Oscillator, and recalculates phase increment.
function SetAmp¶
Sets the amplitude of the waveform.
function SetWaveform¶
Sets the waveform to be synthesized by the Process() function.
function SetPw¶
Sets the pulse width for WAVE_SQUARE and WAVE_POLYBLEP_SQUARE (range 0 - 1)
function IsEOR¶
Returns true if cycle is at end of rise. Set during call to Process.
function IsEOC¶
Returns true if cycle is at end of cycle. Set during call to Process.
function IsRising¶
Returns true if cycle rising.
function IsFalling¶
Returns true if cycle falling.
function Process¶
Processes the waveform to be generated, returning one sample. This should be called once per sample period.
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 Reset¶
Resets the phase to the input argument. If no argumeNt is present, it will reset phase to 0.0;
---¶
Updated on 2024-01-03 at 19:38:46 +0000