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

Discrete summation formula (DSF) oscillator. More...

#include <Oscillator.h>

Inheritance diagram for DSF< Tv, Ts >:
AccumPhase< Tv, Ts >

List of all members.

Public Member Functions

 DSF (Tv frq=440, Tv freqRatio=1, Tv ampRatio=0.5, Tv harmonics=8)
Tv operator() ()
 Generate next sample.
void ampRatio (Tv v)
 Set amplitude ratio of partials.
void antialias ()
 Adjust harmonics so partials do not alias.
void freq (Tv v)
 Set frequency of fundamental.
void freqRatio (Tv v)
 Set frequency ratio of partials.
void harmonics (Tv v)
 Set number of harmonics.
void harmonicsMax ()
 Set number of harmonics to fill Nyquist range.
Tv ampRatio ()
 Get amplitude ratio.
Tv freqRatio ()
 Get frequency ratio.
Tv harmonics ()
 Get current number of harmonics.
Tv maxHarmonics ()
 Get maximum number of harmonics for current settings.
Tv nextPhase ()
 Generate next sample. Stored phase is post-incremented.
Tv nextPhase (Tv frqOffset)
 Generate next sample with a frequency offset.
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.

Detailed Description

template<class Tv = gam::real, class Ts = Synced>
class gam::DSF< Tv, Ts >

Discrete summation formula (DSF) oscillator.

This produces a finite set of harmonics whose amplitudes follow a geometric series. The amplitude of harmonic i is ar^i where 'ar' is called the amplitude ratio. The frequency of harmonic i is (i * fr + 1) where 'fr' is called the frequency ratio. Harmonics run from i=0 (the fundamental) to the maximum specified harmonic.


Constructor & Destructor Documentation

DSF ( Tv  frq = 440,
Tv  freqRatio = 1,
Tv  ampRatio = 0.5,
Tv  harmonics = 8 
)
Parameters:
[in]frqFrequency
[in]freqRatioFrequency ratio of partials
[in]ampRatioAmplitude ratio of partials
[in]harmonicsNumber of harmonics

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