19namespace hw = third_party::hexwave;
63 void generateSamples(
float* output, i32 numSamples,
float freq)
override;
68 void reset()
override;
120 hw::hexwave_engine_destroy(
mEngine);
138 if (!engine || !engine->isValid()) {
159 engine->getEngineInternal(),
175 if (
mHexWave && output && numSamples > 0) {
176 hw::hexwave_generate_samples(output, numSamples,
mHexWave, freq);
static ISynthEnginePtr create(i32 width=32, i32 oversample=16)
Factory function to create an engine with the specified quality settings.
Interface for synth engine that holds BLEP/BLAMP tables.
static ISynthOscillatorPtr create(ISynthEnginePtr engine, const SynthParams ¶ms)
Factory function to create an oscillator with specified engine and parameters.
Interface class for synth oscillator.
i32 getWidth() const override
Get the width setting.
hw::HexWaveEngine * getEngineInternal() const
i32 getOversample() const override
Get the oversample setting.
hw::HexWaveEngine * mEngine
~SynthEngineImpl() FL_NOEXCEPT override
SynthEngineImpl(const SynthEngineImpl &) FL_NOEXCEPT=delete
bool isValid() const override
Check if engine was initialized successfully.
SynthEngineImpl(i32 width, i32 oversample)
SynthEngineImpl & operator=(const SynthEngineImpl &) FL_NOEXCEPT=delete
SynthParams mCurrentParams
ISynthEnginePtr getEngine() const override
Get the engine this oscillator uses.
SynthOscillatorImpl & operator=(const SynthOscillatorImpl &) FL_NOEXCEPT=delete
~SynthOscillatorImpl() FL_NOEXCEPT override
void setParams(const SynthParams ¶ms) override
Change waveform parameters (takes effect at next cycle boundary)
SynthOscillatorImpl(const SynthOscillatorImpl &) FL_NOEXCEPT=delete
SynthOscillatorImpl(fl::shared_ptr< SynthEngineImpl > engine, const SynthParams ¶ms)
void generateSamples(float *output, i32 numSamples, float freq) override
Generate audio samples.
void setShape(SynthShape shape) override
Change waveform shape (takes effect at next cycle boundary)
void reset() override
Reset oscillator to beginning of cycle.
SynthParams getParams() const override
Get current waveform parameters.
fl::shared_ptr< SynthEngineImpl > mEngine
SynthShape
Predefined waveform shapes for synth oscillator.
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
void * malloc(size_t size)
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
shared_ptr< T > static_pointer_cast(const shared_ptr< Y > &other) FL_NOEXCEPT
Base definition for an LED controller.
#define FL_STB_HEXWAVE_MAX_BLEP_LENGTH
float peakTime
Position of peak in cycle [0..1].
SynthParams() FL_NOEXCEPT=default
Default constructor - sawtooth wave.
float halfHeight
Height at half-cycle point.
static SynthParams fromShape(SynthShape shape)
Create parameters for a predefined shape.
float zeroWait
Wait time at zero [0..1].
i32 reflect
Mirror second half of waveform (0 or 1)
Waveform parameters for custom waveforms.
Bandlimited audio synthesizer - waveform oscillator module.