Base class for producing band-limited waveforms. More...
#include <Oscillator.h>
Public Member Functions | |
Buzz (Tv frq=440, Tv phase=0, Tv harmonics=8) | |
void | antialias () |
Adjust number of harmonics to prevent aliasing. | |
void | harmonics (Tv num) |
Set number of harmonics. | |
void | harmonicsMax () |
Set number of harmonics to fill Nyquist range. | |
Tv | operator() () |
Returns next sample of all harmonic impulse. | |
Tv | odd () |
Returns next sample of odd harmonic impulse. | |
Tv | saw (Tv intg=0.997) |
Returns next sample of saw waveform. | |
Tv | square (Tv intg=0.997) |
Returns next sample of square waveform. | |
Tv | maxHarmonics () |
Get number of harmonics below Nyquist based on current settings. | |
Tv | nextPhase () |
Generate next sample. Stored phase is post-incremented. | |
Tv | nextPhase (Tv frqOffset) |
Generate next sample with a frequency offset. | |
void | freq (Tv v) |
Set frequency. | |
Tv | freq () |
Get frequency. | |
void | period (Tv v) |
Set period length. | |
Tv | period () |
Get period. | |
void | phase (Tv v) |
Set phase from [0, 1) of one period. | |
Tv | phase () |
Get normalized phase in [0, 1) | |
void | phaseAdd (Tv v) |
Add value to unit phase. |
Base class for producing band-limited waveforms.
This produces a finite sum of equi-amplitude cosine waves that approach the shape of a periodic impulse train. Due to numerical issues, this generator should not be used for producing very low frequency modulation signals. For that purpose, it is better to use the LFO class.
Buzz | ( | Tv | frq = 440 , |
Tv | phase = 0 , |
||
Tv | harmonics = 8 |
||
) |
[in] | frq | Frequency |
[in] | phase | Phase in [0, 1) |
[in] | harmonics | Number of harmonics |