FastLED 3.9.15
Loading...
Searching...
No Matches
synth.h File Reference

Detailed Description

Bandlimited audio synthesizer - waveform oscillator module.

Provides a flexible anti-aliased (bandlimited) digital audio oscillator that generates waveforms made of line segments. Uses BLEP (Band-Limited Step) and BLAMP (Band-Limited Ramp) techniques to eliminate aliasing.

This is the foundation oscillator module for a planned full audio synthesizer. Currently provides basic waveform generation. Future versions will expand to include envelopes (ADSR), filters, LFOs, effects, and polyphony management.

The library supports multiple independent engine instances, allowing different oscillators to use different quality settings.

Classic waveforms: peak half zero reflect time height wait Sawtooth 1 0 0 0 Square 1 0 1 0 Triangle 1 0.5 0 0

Usage:

// Create an engine (shared among oscillators with same settings)
auto engine = ISynthEngine::create(32, 16);
// Create oscillators using the engine
auto osc1 = ISynthOscillator::create(engine, SynthShape::Sawtooth);
auto osc2 = ISynthOscillator::create(engine, SynthShape::Square);
// Generate samples
float buffer[256];
float freq = 440.0f / 44100.0f; // 440 Hz at 44.1 kHz sample rate
osc1->generateSamples(buffer, 256, freq);
Note
This API is currently focused on the oscillator. Future versions will add envelope generators, filters, and other synthesizer components. The interface is expected to evolve but maintain backward compatibility where practical.

Definition in file synth.h.

#include "fl/stl/stdint.h"
#include "fl/stl/span.h"
#include "fl/stl/shared_ptr.h"
#include "fl/stl/noexcept.h"
+ Include dependency graph for synth.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fl::audio::ISynthEngine
 Interface for synth engine that holds BLEP/BLAMP tables. More...
 
class  fl::audio::ISynthOscillator
 Interface class for synth oscillator. More...
 
struct  fl::audio::SynthParams
 Waveform parameters for custom waveforms. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::audio
 

Enumerations

enum class  fl::audio::SynthShape {
  fl::audio::Sawtooth , fl::audio::Square , fl::audio::Triangle , fl::audio::AlternatingSaw ,
  fl::audio::Custom
}
 Predefined waveform shapes for synth oscillator. More...
 

Functions

 fl::audio::FASTLED_SHARED_PTR (ISynthEngine)
 
 fl::audio::FASTLED_SHARED_PTR (ISynthOscillator)