#include <Oscillator.h>
Public Member Functions | |
| Oscillator (void) | |
| deterministic phase in radians | |
| void | resetEnvelopes (const Breakpoint &bp, double srate) |
| void | resetPhase (double ph) |
| void | oscillate (double *begin, double *end, const Breakpoint &bp, double srate) |
| double | amplitude (void) const |
| Return the instantaneous amplitde of the Oscillator. | |
| double | bandwidth (void) const |
| Return the instantaneous bandwidth of the Oscillator. | |
| double | phase (void) const |
| Return the instantaneous phase of the Oscillator. | |
| double | radianFreq (void) const |
| Return the instantaneous radian frequency of the Oscillator. | |
Class Synthesizer uses an instance of Oscillator to synthesize bandwidth-enhanced Partials.
| Loris::Oscillator::Oscillator | ( | void | ) |
deterministic phase in radians
Construct a new Oscillator with all state parameters initialized to 0.
| void Loris::Oscillator::oscillate | ( | double * | begin, | |
| double * | end, | |||
| const Breakpoint & | bp, | |||
| double | srate | |||
| ) |
Accumulate bandwidth-enhanced sinusoidal samples modulating the oscillator state from its current values of radian frequency, amplitude, and bandwidth to the specified target values. Accumulate samples into the half-open (STL-style) range of doubles, starting at begin, and ending before end (no sample is accumulated at end). The caller must insure that the indices are valid. Target frequency and bandwidth are checked to prevent aliasing and bogus bandwidth enhancement.
| void Loris::Oscillator::resetEnvelopes | ( | const Breakpoint & | bp, | |
| double | srate | |||
| ) |
Reset the instantaneous envelope parameters (frequency, amplitude, bandwidth, and phase). The sample rate is needed to convert the Breakpoint frequency (Hz) to radians per sample.
| void Loris::Oscillator::resetPhase | ( | double | ph | ) |
Reset the phase of the Oscillator to the specified value. This is done when the amplitude of a Partial goes to zero, so that onsets are preserved in distilled and collated Partials.
1.5.7