1 #ifndef __WavetableOscillator_h__
2 #define __WavetableOscillator_h__
45 float sample = wave[index];
52 template<InterpolationMethod im = LINEAR_INTERPOLATION>
64 : wave(data.getData(), data.getSize()) {
static constexpr float begin_phase
AntialiasedWavetableOscillator()
AntialiasedWavetableOscillator(float sr, FloatArray wave)
AntialiasedWavetableOscillator(float sr)
static constexpr float end_phase
void setData(DataType *data, IndexType len)
IndexType getSize() const
This class contains useful methods for manipulating arrays of floats.
static void destroy(FloatArray array)
Destroys a FloatArray created with the create() method.
static FloatArray create(int size)
Creates a new FloatArray.
float readAt(float index)
Interpolated read at sub-sample index.
InterpolatingWavetableOscillator()
InterpolatingWavetableOscillator(float sr)
InterpolatingWavetableOscillator(float sr, FloatArray data)
static InterpolatingWavetableOscillator< im > * create(float sr, size_t length)
static constexpr float begin_phase
static void destroy(InterpolatingWavetableOscillator< im > *obj)
static constexpr float end_phase
FloatArray getWavetable()
void setWavetable(FloatArray wavetable)
static float polyblep(float t, float dt)
Calculate poly blep antialiasing compensation on normalised (to range [0, 1]) phase and phase increme...
void setSampleRate(float sr)
T * getData()
Get the data stored in the Array.
static constexpr float begin_phase
WavetableOscillator(float sr)
WavetableOscillator(float sr, const FloatArray wavetable)
static constexpr float end_phase
FloatArray getWavetable()