AUDIO
Source snapshot · 12 October 2026

Prepared signal processing

Prepared periodic wavetable oscillator

WavetableOscillator::new(rate, frequency, &table) validates and copies 2..=65536 finite f64 cycle samples on the control thread. Samples represent uniformly spaced phases i/N; omit a duplicated endpoint. Rates are finite positive and frequency is finite from zero to strictly below Nyquist. No preset waveform/DC/level policy is imposed. table() borrows the immutable prepared cycle.

Processing emits at current phase, linearly interpolates between neighboring samples (including final-to-first wrap), then advances. It performs no allocation or per-sample transcendental work. set_frequency preserves phase and rejects before mutation. Reset retains table/frequency and returns phase zero. Whole/split blocks match. Prepare, clone and destruction own table allocation outside processing; maximum owned table storage is 512 KiB, excluding object/allocator overhead.

Interpolation is not bandlimited or alias-free; no smoothing, denormal/headroom, nonfinite output or native deadline policy is inferred. Extreme finite table amplitudes can overflow interpolation. Tests check exact periodic segments and wrap, non-power-of-two cycles, analytic sine error, retuning/reset/partition, invalid input without allocation and 10000 heap-instrumented samples. See decision 0129.