OpenWareLaboratory
|
Public Member Functions | |
float | generate () |
Produce the next consecutive sample. More... | |
float | generate (float fm) |
Produce a sample with frequency modulation. More... | |
void | generate (FloatArray output) |
Produce a block of samples. More... | |
void | generate (FloatArray output, FloatArray fm) |
Produce a block of samples with frequency modulation. More... | |
float | getFrequency () |
Get oscillator frequency in Hertz. More... | |
float | getNextSample () |
float | getNextSample (float fm) |
float | getPhase () |
Get current oscillator phase in radians. More... | |
float | getPulseWidth () |
float | getSampleRate () |
void | getSamples (FloatArray output) |
void | getSamples (FloatArray output, FloatArray freq) |
float | getShape () |
PolyBlepOscillator (float freq, float sr) | |
PolyBlepOscillator (float sr=48000) | |
void | reset () |
Reset oscillator (typically resets phase) More... | |
void | setFrequency (float freq) |
Set oscillator frequency in Hertz. More... | |
void | setPhase (float phase) |
Set current oscillator phase in radians. More... | |
void | setPulseWidth (float value) |
set square wave pulse width: 0.0 to 1.0 for 0% to 100% More... | |
void | setSampleRate (float sr) |
Set oscillator sample rate. More... | |
void | setShape (float value) |
set waveform shape: 0.0 for saw, 1.0 for square wave More... | |
Static Public Member Functions | |
static PolyBlepOscillator * | create (float freq, float sr) |
static PolyBlepOscillator * | create (float sr) |
static void | destroy (PolyBlepOscillator *osc) |
Definition at line 8 of file PolyBlepOscillator.h.
PolyBlepOscillator::PolyBlepOscillator | ( | float | sr = 48000 | ) |
Definition at line 4 of file PolyBlepOscillator.cpp.
Referenced by create().
PolyBlepOscillator::PolyBlepOscillator | ( | float | freq, |
float | sr | ||
) |
Definition at line 12 of file PolyBlepOscillator.cpp.
References setFrequency().
|
static |
Definition at line 92 of file PolyBlepOscillator.cpp.
References PolyBlepOscillator().
|
static |
Definition at line 88 of file PolyBlepOscillator.cpp.
References PolyBlepOscillator().
|
static |
Definition at line 96 of file PolyBlepOscillator.cpp.
|
virtual |
Produce the next consecutive sample.
Reimplemented from SignalGenerator.
Definition at line 60 of file PolyBlepOscillator.cpp.
|
virtual |
Produce a sample with frequency modulation.
Implements Oscillator.
Definition at line 66 of file PolyBlepOscillator.cpp.
|
virtual |
Produce a block of samples.
Reimplemented from SignalGenerator.
Definition at line 72 of file PolyBlepOscillator.cpp.
References SimpleArray< T >::getSize().
|
virtual |
Produce a block of samples with frequency modulation.
Reimplemented from Oscillator.
Definition at line 76 of file PolyBlepOscillator.cpp.
References FloatArray::add(), SimpleArray< T >::copyFrom(), SimpleArray< T >::getSize(), and FloatArray::multiply().
|
virtual |
Get oscillator frequency in Hertz.
Implements Oscillator.
Definition at line 32 of file PolyBlepOscillator.cpp.
|
inlineinherited |
Definition at line 55 of file Oscillator.h.
References Oscillator::generate().
|
inlineinherited |
Definition at line 57 of file Oscillator.h.
References Oscillator::generate().
|
virtual |
Get current oscillator phase in radians.
Implements Oscillator.
Definition at line 52 of file PolyBlepOscillator.cpp.
References M_PI.
float PolyBlepOscillator::getPulseWidth | ( | ) |
Definition at line 48 of file PolyBlepOscillator.cpp.
float PolyBlepOscillator::getSampleRate | ( | ) |
Definition at line 24 of file PolyBlepOscillator.cpp.
|
inlineinherited |
Definition at line 59 of file Oscillator.h.
References Oscillator::generate().
void PolyBlepOscillator::getSamples | ( | FloatArray | output, |
FloatArray | freq | ||
) |
Definition at line 83 of file PolyBlepOscillator.cpp.
References SimpleArray< T >::getSize(), and FloatArray::multiply().
float PolyBlepOscillator::getShape | ( | ) |
Definition at line 40 of file PolyBlepOscillator.cpp.
|
inlinevirtual |
Reset oscillator (typically resets phase)
Implements Oscillator.
Definition at line 28 of file PolyBlepOscillator.h.
References setPhase().
|
virtual |
Set oscillator frequency in Hertz.
Implements Oscillator.
Definition at line 28 of file PolyBlepOscillator.cpp.
Referenced by PolyBlepOscillator().
|
virtual |
Set current oscillator phase in radians.
phase | a value between 0 and 2*pi |
Implements Oscillator.
Definition at line 56 of file PolyBlepOscillator.cpp.
References M_PI.
Referenced by reset().
void PolyBlepOscillator::setPulseWidth | ( | float | value | ) |
set square wave pulse width: 0.0 to 1.0 for 0% to 100%
Definition at line 44 of file PolyBlepOscillator.cpp.
|
virtual |
Set oscillator sample rate.
Reimplemented from Oscillator.
Definition at line 20 of file PolyBlepOscillator.cpp.
void PolyBlepOscillator::setShape | ( | float | value | ) |
set waveform shape: 0.0 for saw, 1.0 for square wave
Definition at line 36 of file PolyBlepOscillator.cpp.