csl::SumOfSines Class Reference

#include <Oscillator.h>

Inheritance diagram for csl::SumOfSines:

csl::CompOrCacheOscillator csl::WavetableOscillator csl::Cacheable csl::Oscillator csl::UnitGenerator csl::Phased csl::Scalable csl::Model csl::Controllable csl::Controllable csl::SquareBL

List of all members.

Public Member Functions

 SumOfSines ()
 SumOfSines (float frequency)
 SumOfSines (PartialDescriptionMode format, unsigned partialCount,...)
void addPartial (Partial *pt)
void addPartials (unsigned num_p, Partial **pt)
void addPartials (int argc, void **argv)
void addPartial (float nu, float amp)
void addPartial (float nu, float amp, float phase)
void clearPartials ()
void dump ()
 print the receiver for debugging

Protected Member Functions

void nextWaveInto (SampleBuffer dest, unsigned count, bool oneHz)

Protected Attributes

std::vector< Partial * > mPartials

Private Attributes

Buffer outputBuffer


Detailed Description

SumOfSines -- Sum-of-sines oscillator class

The constructor takes an int format (1, 2, or 3 elements per overtone), the number of partials, and a list of elements

This can cache a wavetable (if you use a strictly harmonic overtone series) or compute a buffer on the fly by summation (slow)

Examples: Format kFrequency = list of values for overtone amplitudes with num = 1, 2, 3..., amps = values, phases = 0 SumOfSines vox(1, 5, 0.2, 0.2, 0.1, 0.1, 0.05) -- first 5 overtones with weights 0.2, 0.2...

Format kFreqAmp = list of values for overtone freq/amplitudes with phases = 0 SumOfSines vox(2, 3, 1, 0.2, 2, 0.1, 3.01, 0.05) -- overtones 1, 2, and 3.01 (i.e., non-harmonic)

Format kFreqAmpPhase = list of values for overtone num/amps/phases SumOfSines vox(3, 3 1.02, 0.2, 0, 2.1, 0.2, 0.1, 3.0, 0.1, 0.05) -- verbose constructor


Constructor & Destructor Documentation

SumOfSines::SumOfSines (  ) 

SumOfSines::SumOfSines ( float  frequency  ) 

SumOfSines::SumOfSines ( PartialDescriptionMode  format,
unsigned  partialCount,
  ... 
)


Member Function Documentation

void SumOfSines::addPartial ( Partial pt  ) 

void SumOfSines::addPartials ( unsigned  num_p,
Partial **  pt 
)

void SumOfSines::addPartials ( int  argc,
void **  argv 
)

void SumOfSines::addPartial ( float  nu,
float  amp 
)

void SumOfSines::addPartial ( float  nu,
float  amp,
float  phase 
)

void SumOfSines::clearPartials (  ) 

References mPartials.

void SumOfSines::dump ( void   )  [virtual]

print the receiver for debugging

Reimplemented from csl::Oscillator.

References csl::logMsg(), and mPartials.

void SumOfSines::nextWaveInto ( SampleBuffer  dest,
unsigned  count,
bool  oneHz 
) [protected, virtual]


Member Data Documentation

std::vector<Partial *> csl::SumOfSines::mPartials [protected]


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

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8