|
LMMS
|
#include <osc.h>
Public Member Functions | |
| void | reset () |
| Reset oscillator phase to zero. | |
| void | set_freq (float freq, float sr) |
| Set phase delta based on oscillator frequency and sample rate. | |
| void | set_freq_odsr (float freq, double odsr) |
| Set phase delta based on oscillator frequency and inverse of sample rate. | |
| void | step () |
| Make one phase increment. | |
| float | get () |
| Make one phase increment and return a value from -0.5 to 0.5. | |
Public Attributes | |
| uint32_t | phase |
| Phase (from 0 to 0xFFFFFFFF). | |
| uint32_t | phasedelta |
| Per-sample phase delta (phase increment), equal to 2^32*freq/sr. | |
Very simple, non-bandlimited saw oscillator. Should not be used for anything else than testing/prototyping. Unless get() function is replaced with something with "proper" oscillator code, as the frequency setting function is fine.
|
inline |
Make one phase increment and return a value from -0.5 to 0.5.
|
inline |
Reset oscillator phase to zero.
|
inline |
Set phase delta based on oscillator frequency and sample rate.
|
inline |
Set phase delta based on oscillator frequency and inverse of sample rate.
|
inline |
Make one phase increment.
| uint32_t dsp::simple_oscillator::phase |
Phase (from 0 to 0xFFFFFFFF).
| uint32_t dsp::simple_oscillator::phasedelta |
Per-sample phase delta (phase increment), equal to 2^32*freq/sr.