![]() |
fsh::stk
fantastic spatial holophonic synthesis toolkit
|
Represents a single band-limited oscillator with multiple waveforms. More...
#include <Oscillator.h>
Classes | |
struct | Params |
Oscillator parameters. More... | |
Public Types | |
enum class | Waveform { TrueSaw , TrueTriangle , Square , Sine , Saw , Noise , Triangle } |
Waveform. More... | |
Public Member Functions | |
void | setSampleRate (double sampleRate) |
Set the sample rate in Hz. | |
void | setFrequency (double) |
Set the oscillator's frequency. | |
void | setParams (const Params &) |
Set the oscillator's parameters. | |
auto | nextSample () -> float |
Compute the oscillator's next sample. | |
void | reset () |
Reset the oscillator's phase/freq/amplitude to zero. | |
Represents a single band-limited oscillator with multiple waveforms.
Set the sample rate using setSampleRate() and set the oscillator's parameters using setParams().
This class is loosely based on code from the JX10 synthesizer by Matthijs Hollemans.
|
strong |
Waveform.
The GUI picker relies on the specific ordering of these values, so be very careful when changing it.