Gamma  0.9.5
Generic Synthesis Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
SineR< Tv, Ts > Class Template Reference

Sine oscillator based on an efficient recursion equation. More...

#include <Oscillator.h>

Inheritance diagram for SineR< Tv, Ts >:
RSin< Tv > Val< Tv >

List of all members.

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.
RSinamp (const Tv &v)
 Set amplitude.
Tv phase () const
 Get unit phase.
RSinphase (const Tv &v)
 Set unit phase.
RSinreset ()
 Reset state from stored parameters.
RSinset (const Tv &frq, const Tv &phs, const Tv &amp=Tv(1))
 Set parameters from unit freq, phase, and amplitude.

Public Attributes

Tv mul
 Multiplication factor.
Tv val
 Value.

Detailed Description

template<class Tv = double, class Ts = Synced>
class gam::SineR< Tv, Ts >

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.


Constructor & Destructor Documentation

SineR ( Tv  frq = 440,
Tv  amp = 1,
Tv  phs = 0 
)
Parameters:
[in]frqFrequency
[in]ampAmplitude
[in]phsPhase in [0, 1)

The documentation for this class was generated from the following file: