Floating-point phase accumulator with output in [-pi, pi). More...
#include <Oscillator.h>
Public Member Functions | |
| AccumPhase (Tv frq=440, Tv phs=0) | |
| 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. | |
| void | period (Tv v) |
| Set period length. | |
| void | phase (Tv v) |
| Set phase from [0, 1) of one period. | |
| void | phaseAdd (Tv v) |
| Add value to unit phase. | |
| Tv | freq () |
| Get frequency. | |
| Tv | period () |
| Get period. | |
| Tv | phase () |
| Get normalized phase in [0, 1) | |
Floating-point phase accumulator with output in [-pi, pi).
| AccumPhase | ( | Tv | frq = 440, |
| Tv | phs = 0 |
||
| ) |
| [in] | frq | Frequency |
| [in] | phs | Phase in [0, 1) |