1 #ifndef __MorphingOscillator_h
2 #define __MorphingOscillator_h
44 return l + (h - l) *
xf;
49 return l + (h - l) *
xf;
93 osc[index] = oscillator;
This class contains useful methods for manipulating arrays of floats.
void multiply(FloatArray operand2, FloatArray destination)
Element-wise multiplication between arrays.
void add(FloatArray operand2, FloatArray destination)
Element-wise sum between arrays.
static void destroy(FloatArray array)
Destroys a FloatArray created with the create() method.
static FloatArray create(int size)
Creates a new FloatArray.
The MorphingOscillator wraps a fixed number of Oscillators and crossfades between their outputs.
void generate(FloatArray output, FloatArray fm)
Produce a block of samples with frequency modulation.
MorphingOscillator(Oscillator **osc, size_t count, FloatArray buffer)
Oscillator * getOscillator(size_t index)
void setPhase(float value)
Set current oscillator phase in radians.
void setFrequency(float value)
Set oscillator frequency in Hertz.
void reset()
Reset oscillator (typically resets phase)
size_t getNumberOfOscillators()
static MorphingOscillator * create(size_t oscillator_count, size_t blocksize)
void setOscillator(size_t index, Oscillator *oscillator)
float generate()
Produce the next consecutive sample.
float getPhase()
Get current oscillator phase in radians.
void generate(FloatArray output)
Produce a block of samples.
float getFrequency()
Get oscillator frequency in Hertz.
float generate(float fm)
Produce a sample with frequency modulation.
void morph(float value)
Morph between all configured oscillators.
static void destroy(MorphingOscillator *obj)
An Oscillator is a SignalGenerator that operates at a given frequency and that can be frequency modul...
virtual void reset()=0
Reset oscillator (typically resets phase)
virtual float getFrequency()=0
Get oscillator frequency in Hertz.
virtual float generate(float fm)=0
Produce a sample with frequency modulation.
virtual void setPhase(float phase)=0
Set current oscillator phase in radians.
virtual void setFrequency(float value)=0
Set oscillator frequency in Hertz.
virtual float getPhase()=0
Get current oscillator phase in radians.