@maruaudio/dsp/distortion/sample-rate-reducer reproduces DaisySP's SampleRateReducer, from Mutable Instruments Plaits, in f32 operation order. A phase accumulator re-samples the input at frequency × the host rate. Each new held value is placed at the linearly interpolated crossing instant t = phase / frequency, and every step is smoothed by a two-sample polyBLEP residual, 0.5·t² on this sample and −0.5·(1 − t)² on the next.
Parameters
| Setter | Range the setter enforces | Default |
|---|---|---|
setSampleRateReducerFrequency | 0 to 1, a ratio of the host rate (@maru/math-float-clamp) | 0.2 |
initSampleRateReducerNode() takes no sample rate.
Lifecycle
initSampleRateReducerNode (upstream Init) → setSampleRateReducerFrequency → sampleRateReducerTick per sample → resetSampleRateReducerNode, which is Init in place and so also returns the frequency to 0.2. Ticks allocate nothing and do no I/O.
When to use it
Lowering the effective sample rate of a voice or mix with smoothed steps, or reproducing the CHOMPI TEMPO engines' Reduce stage, which runs one per channel after each engine's mix.
Limits
- Mono sample tick.
- Frequency 1 passes the input one sample late; frequency 0 holds the last value for ever and never divides by zero. Reset returns the frequency to 0.2.
- Output is bit-exact against DaisySP compiled without FMA contraction.
@maru/distortion-decimatoris DaisySP's different Decimator algorithm.