MultiTapOsc

An oscillator that generates multiple waveform outputs from a single counter, and allows the mixing of them. Available waveforms: * sawtooth: The basic output of the counter. * triangle: Produced from the counter by using the top-bit of the counter to invert the next 16 bits. * pulse: Produced from the counter with a simple logic of testing the counter against the pulseWidth variable. * sawpulse: Sawtooth and pulse logically AND-ed together The amounts can be set to minus, this way the output will be inverted.

Members

Functions

outputF
double outputF(double bias, double invDiv)

Returns the floating point output of the oscillator

outputI
int outputI()

Returns the integer output of the oscillator.

reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.
setRate
void setRate(int sampleRate, double freq)

Sets the rate of the oscillator

Variables

counter
uint counter;

Current state of the oscillator

pulseAm
short pulseAm;

Controls the amount of the pulse wave (minus means inverting)

pulseWidth
uint pulseWidth;

Controls the pulse width of the oscillator

rate
uint rate;

The rate of which the oscillator operates at

sawAm
short sawAm;

Controls the amount of the sawtooth wave (minus means inverting)

sawPulseAm
short sawPulseAm;

Controls the amount of the sawpulse wave (minus means inverting)

triAm
short triAm;

Controls the amount of the triangle wave (minus means inverting)

Meta