Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@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

SetterRange the setter enforcesDefault
setSampleRateReducerFrequency0 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-decimator is DaisySP's different Decimator algorithm.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Frequency frequency

Upstream `SetFreq(frequency)`: clamped to 0..1.

floatsetSampleRateReducerFrequency

Ports

  • In ininput · audio · mono
  • Out outoutput · audio · mono

One sample per sampleRateReducerTick call.

Dependencies

Dependents

No other node imports this one.

Used by