#include <Oscillator.h>

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 |
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
| SumOfSines::SumOfSines | ( | ) |
| SumOfSines::SumOfSines | ( | float | frequency | ) |
| SumOfSines::SumOfSines | ( | PartialDescriptionMode | format, | |
| unsigned | partialCount, | |||
| ... | ||||
| ) |
References csl::Partial::amplitude, kFreqAmp, kFreqAmpPhase, kFrequency, mPartials, csl::Partial::number, and csl::Partial::phase.
| void SumOfSines::addPartial | ( | Partial * | pt | ) |
References mPartials.
Referenced by csl::SquareBL::nextWaveInto(), and csl::AdditiveInstrument::setParameter().
| void SumOfSines::addPartials | ( | unsigned | num_p, | |
| Partial ** | pt | |||
| ) |
| void SumOfSines::addPartials | ( | int | argc, | |
| void ** | argv | |||
| ) |
References csl::Partial::amplitude, mPartials, and csl::Partial::number.
| void SumOfSines::addPartial | ( | float | nu, | |
| float | amp | |||
| ) |
References csl::Partial::amplitude, mPartials, csl::Partial::number, and csl::Partial::phase.
| void SumOfSines::addPartial | ( | float | nu, | |
| float | amp, | |||
| float | phase | |||
| ) |
References csl::Partial::amplitude, mPartials, csl::Partial::number, and csl::Partial::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] |
Implements csl::CompOrCacheOscillator.
References csl::Partial::amplitude, CSL_TWOPI, DECLARE_PHASED_CONTROLS, DECLARE_SCALABLE_CONTROLS, testkiss::j, LOAD_PHASED_CONTROLS, LOAD_SCALABLE_CONTROLS, csl::UnitGenerator::mFrameRate, mPartials, csl::Partial::number, csl::Partial::phase, UPDATE_PHASED_CONTROLS, and UPDATE_SCALABLE_CONTROLS.
std::vector<Partial *> csl::SumOfSines::mPartials [protected] |
Referenced by addPartial(), addPartials(), clearPartials(), dump(), csl::SquareBL::nextWaveInto(), nextWaveInto(), and SumOfSines().
Buffer csl::SumOfSines::outputBuffer [private] |
1.5.8