#include <Oscillator.h>
Public Member Functions | |
Oscillator (void) | |
deterministic phase in radians | |
void | resetEnvelopes (const Breakpoint &bp, double srate) |
void | setPhase (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. | |
Filter & | filter (void) |
Static Public Member Functions | |
static const Filter & | prototype_filter (void) |
Class Oscillator represents the state of a single bandwidth-enhanced sinusoidal oscillator used for synthesizing sounds from Reassigned Bandwidth-Enhanced analysis data. Oscillator encapsulates the oscillator state, including the instantaneous radian frequency (radians per sample), amplitude, bandwidth coefficient, and phase, and a bandlimited stochastic modulator.
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.
Filter& Loris::Oscillator::filter | ( | void | ) | [inline] |
Return access to the Filter used by this oscillator to implement bandwidth-enhanced sinusoidal synthesis.
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.
static const Filter& Loris::Oscillator::prototype_filter | ( | void | ) | [static] |
Static local function for obtaining a prototype Filter to use in Oscillator construction. Eventually, allow external (client) specification of the Filter prototype.
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::setPhase | ( | 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.