Expand description
Synth — voice allocator + ADSR + oscillator voices → audio. Re-exports only (AU-MIDI-SYNTH).
Polyphonic subtractive-lite synth: a fixed-capacity VoiceAllocator of
OscillatorVoices (waveform × AdsrEnvelope × velocity), summed by
render_block. The render path is zero-alloc, lock-free, and FS-free — all voice
state is inline in a [Voice; N] array. Frequencies are supplied directly so a
tuning table can drive pitch; VoiceAllocator::note_on_12tet is the equal-temperament
default.
Structs§
- Adsr
Envelope - A four-stage attack/decay/sustain/release amplitude envelope.
- Oscillator
Voice - A single monophonic voice: oscillator + envelope + velocity gain.
- Voice
- A pool voice: the sound generator plus allocator bookkeeping.
- Voice
Allocator - Fixed pool of
Nvoices. All state is inline; no allocation on any path.
Enums§
- Waveform
- Selectable oscillator waveform.
Constants§
- MAX_
VOICES - Default maximum simultaneous voices for a full-size pool.
Functions§
- render_
block - Render one audio block by summing every active voice into
out(mono, one sample per element). Each element is fully mixed before advancing to the next, so voice phase/envelope stay sample-accurate. ReturnsOk(()); reservedAudioErrorvariants allow future validation without changing the signature.