53 return osc.getMasterPhase()*2*
M_PI;
57 osc.setMasterPhase(phase/(2*
M_PI));
62 osc.Render<
true>(nfreq, pw, shape, &sample, 1);
68 osc.Render<
true>(nfreq*(1+fm), pw, shape, &sample, 1);
73 osc.Render<
true>(nfreq, pw, shape, output, output.
getSize());
80 osc.Render<
true>(output, pw, shape, output, output.
getSize());
85 osc.Render<
true>(freqs, pw, shape, output, output.
getSize());
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 PolyBlepOscillator * create(float sr)
void setFrequency(float freq)
Set oscillator frequency in Hertz.
void getSamples(FloatArray output, FloatArray freq)
float generate()
Produce the next consecutive sample.
PolyBlepOscillator(float sr=48000)
float getPhase()
Get current oscillator phase in radians.
static void destroy(PolyBlepOscillator *osc)
void setSampleRate(float sr)
Set oscillator sample rate.
float getFrequency()
Get oscillator frequency in Hertz.
void setPhase(float phase)
Set current oscillator phase in radians.
void setShape(float value)
set waveform shape: 0.0 for saw, 1.0 for square wave
void setPulseWidth(float value)
set square wave pulse width: 0.0 to 1.0 for 0% to 100%
void copyFrom(SimpleArray< T > source)
Copies the content of another array into this array.