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.
SynthEngineImpl(const SynthEngineImpl &) FL_NO_EXCEPT=delete
hw::HexWaveEngine * getEngineInternal() const
~SynthEngineImpl() FL_NO_EXCEPT override
i32 getOversample() const override
Get the oversample setting.
hw::HexWaveEngine * mEngine
bool isValid() const override
Check if engine was initialized successfully.
SynthEngineImpl(i32 width, i32 oversample)
SynthEngineImpl & operator=(const SynthEngineImpl &) FL_NO_EXCEPT=delete
SynthParams mCurrentParams
ISynthEnginePtr getEngine() const override
Get the engine this oscillator uses.
void setParams(const SynthParams ¶ms) override
Change waveform parameters (takes effect at next cycle boundary)
SynthOscillatorImpl(fl::shared_ptr< SynthEngineImpl > engine, const SynthParams ¶ms)
SynthOscillatorImpl(const SynthOscillatorImpl &) FL_NO_EXCEPT=delete
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)
~SynthOscillatorImpl() FL_NO_EXCEPT override
SynthOscillatorImpl & operator=(const SynthOscillatorImpl &) FL_NO_EXCEPT=delete
void reset() override
Reset oscillator to beginning of cycle.
SynthParams getParams() const override
Get current waveform parameters.
fl::shared_ptr< SynthEngineImpl > mEngine
const T * data() const FL_NO_EXCEPT
constexpr fl::size size() const FL_NO_EXCEPT
SynthShape
Predefined waveform shapes for synth oscillator.
void * malloc(size_t size)
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
void * memset(void *s, int c, size_t n) FL_NO_EXCEPT
InputGamut g FL_NO_EXCEPT
shared_ptr< T > static_pointer_cast(const shared_ptr< Y > &other) FL_NO_EXCEPT
Base definition for an LED controller.
#define FL_STB_HEXWAVE_MAX_BLEP_LENGTH
float peakTime
Position of peak in cycle [0..1].
float halfHeight
Height at half-cycle point.
SynthParams() FL_NO_EXCEPT=default
Default constructor - sawtooth wave.
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.