Build with this node

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

Ask Studio

@maruaudio/dsp/delays/pcm16-ping-pong is the CHOMPI firmware's smoothed ping-pong over @maru/delays-pcm16-interpolated. The mono-summed input enters the left lane with the right repeat fed back at feedback^0.7; the right lane stores the delayed left, so repeats land left at T, right at 2T. Below feedback 0.2 the repeat level is 5·feedback. The output mixes dry 1 − 0.6·law (0.5 above 0.83) with wet 2·law (0.5 above 0.25). All arithmetic is f32.

const state = initPcm16PingPongNode() // TAPE mix law
setPcm16PingPongFeedbackTarget(state, pcm16PingPongFeedbackTarget(0.6))
setPcm16PingPongTimeTarget(state, pcm16PingPongTimeSamples(0.4))
pcm16PingPongNodeTick(state, left, right) // state.outLeft, state.outRight

Parameters

Each target is rounded to f32, not clamped, and approached by a one-pole step of 0.001 per sample.

SetterValue as codedInitUnit
setPcm16PingPongFeedbackTargetPre-scaled; pcm16PingPongFeedbackTarget(c) gives 0.9·c0linear
setPcm16PingPongTimeTargetFractional samples of the 96256-frame line; pcm16PingPongTimeSamples(t) gives 0.99·t³·96256 + 450pcm16PingPongTimeSamples(0.5)samples
setPcm16PingPongAmountTargetMix law input with MIX_FROM_AMOUNT only0normalized
initPcm16PingPongNode(mixSource)PCM16_PING_PONG_MIX_FROM_FEEDBACK (TAPE) or …_FROM_AMOUNT (WAVE)TAPEmode

Lifecycle

initPcm16PingPongNode allocates the 96256-frame line once → targets → pcm16PingPongNodeTick per frame → resetPcm16PingPongNode, which clears the line and outputs and keeps the controls, outside realtime. powf runs only when the smoothed feedback changes.

When to use it

A firmware-exact stereo echo with 16-bit storage, where the time knob glides.

Limits

  • Stereo in summed to mono, stereo out. The line holds just over 2 s at 48 kHz; times are in samples. Moving the time pitch-bends the tail, with no crossfade.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Pcm16 ping pong feedback target pcm16PingPongFeedbackTarget

Smoothed-feedback target (already scaled; see `pcm16PingPongFeedbackTarget`).

floatsetPcm16PingPongFeedbackTarget
Samples samples

Delay-time target in samples (see `pcm16PingPongTimeSamples`).

floatsetPcm16PingPongTimeTarget
Pcm16 ping pong amount target pcm16PingPongAmountTarget

Mix-amount target, used only with `PCM16_PING_PONG_MIX_FROM_AMOUNT`.

floatsetPcm16PingPongAmountTarget

Dependencies

Dependents

No other node imports this one.

Used by