Sine oscillator based on an efficient recursion equation. More...
#include <Oscillator.h>
 
  
 | Public Member Functions | |
| SineR (Tv frq=440, Tv amp=1, Tv phs=0) | |
| Tv | freq () const | 
| Get frequency. | |
| void | ampPhase (Tv a=1, Tv p=0) | 
| Set amplitude and phase. | |
| void | freq (const Tv &v) | 
| Set unit frequency. | |
| void | set (Tv frq, Tv amp, Tv phs=0) | 
| Set all control parameters. | |
| Tv | operator[] (uint32_t i) const | 
| Array get; generates next element. | |
| Tv & | operator[] (uint32_t i) | 
| Array set; sets current value. | |
| Tv | operator() () const | 
| Generate next value. | |
| Tv | amp () const | 
| Get amplitude. | |
| RSin & | amp (const Tv &v) | 
| Set amplitude. | |
| Tv | phase () const | 
| Get unit phase. | |
| RSin & | phase (const Tv &v) | 
| Set unit phase. | |
| RSin & | reset () | 
| Reset state from stored parameters. | |
| RSin & | set (const Tv &frq, const Tv &phs, const Tv &=Tv(1)) | 
| Set parameters from unit freq, phase, and amplitude. | |
| Public Attributes | |
| Tv | mul | 
| Multiplication factor. | |
| Tv | val | 
| Value. | |
Sine oscillator based on an efficient recursion equation.
This oscillator is based on a recursion equation requiring only one multiply and add per sample computation. While calculation is fast, frequency and phase updates are rather expensive and 64-bit precision is required to prevent growing or decaying in amplitude over time. This generator is ideal in situations where a stationary sinusoid is all that is required, e.g. a grain or modulator.
| SineR | ( | Tv | frq = 440, | 
| Tv | amp = 1, | ||
| Tv | phs = 0 | ||
| ) | 
| [in] | frq | Frequency | 
| [in] | amp | Amplitude | 
| [in] | phs | Phase in [0, 1) |