@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.outRightParameters
Each target is rounded to f32, not clamped, and approached by a one-pole step of 0.001 per sample.
| Setter | Value as coded | Init | Unit |
|---|---|---|---|
setPcm16PingPongFeedbackTarget | Pre-scaled; pcm16PingPongFeedbackTarget(c) gives 0.9·c | 0 | linear |
setPcm16PingPongTimeTarget | Fractional samples of the 96256-frame line; pcm16PingPongTimeSamples(t) gives 0.99·t³·96256 + 450 | pcm16PingPongTimeSamples(0.5) | samples |
setPcm16PingPongAmountTarget | Mix law input with MIX_FROM_AMOUNT only | 0 | normalized |
initPcm16PingPongNode(mixSource) | PCM16_PING_PONG_MIX_FROM_FEEDBACK (TAPE) or …_FROM_AMOUNT (WAVE) | TAPE | mode |
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.