Build with this node

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

Ask Studio

@maruaudio/dsp/tables/tape-loop is the CHOMPI TAPE firmware's stereo looper. The first pass records at 1× and sets the loop length; then the loop plays and overdubs at a slewed varispeed, with a trailing write head, dub-gain feedback through a hard limiter, a paused scrub, a reset fade and an automatic close when the buffer fills. Samples are the firmware's int16 codes (f2s16) held as exact integers in one interleaved f32 buffer, in the firmware's float32 order.

Parameters

PathSetterRange as codedDefaultUnit
tapeSlewinitTapeLoop, setTapeLoopTapeSlew0 or 1 (non-zero is 1): speed slew 0.01 or 0.0001 per samplefrom initflag
speedsetTapeLoopVarispeedStored as f32; the slewed tape speed is clamped to −2..21×
dub gaintapeLoopIncrementDubGain(increment)Target clamped 0..1 with floatClamp; slews while overdubbing, set at once while empty1linear
scrubtapeLoopAddScrubTurns(turns)Accumulated; each 6000-sample period sets the paused scrub0turns

Lifecycle

initTapeLoop(capacityFrames, tapeSlew) allocates that many stereo frames (floored, at least 1) in the power-on state. When tapeLoopBlockStarting returns 1 (every 24 frames, the firmware callback), apply queued transport calls (tapeLoopToggleRecord, tapeLoopTogglePlaying, tapeLoopReset, tapeLoopJumpToStart), call tapeLoopCheckRecordReady, then the owner's button logic or tapeLoopReleaseResetLatch. Then tapeLoopTick(state, l, r) per frame writes outputLeft/outputRight, the bus plus the loop. tapeLoopOpenStored installs a loop written into buffer; resetTapeLoop restores power-on state without reallocating or clearing it.

When to use it

A live looper matching the TAPE pedal, driven by the product's own buttons.

Limits

  • Stereo, sample tick; the 24-frame virtual block is internal, so output does not depend on host block size. While empty and idle a block passes the bus through unchanged. Button-hold gestures are the owner's.
  • Rates are per sample, as upstream: slews, the 6000-sample scrub period and the 480-element loop-end fade assume 48 kHz. Every loop has a compile-time bound.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Tape slew tapeSlew

The TAPE "tape slew" option; takes effect on the next sample.

floatsetTapeLoopTapeSlew
Speed speed

Tape speed, -2..2 in the firmware (`SetVarispeed` without force).

floatsetTapeLoopVarispeed

Dependencies

Dependents

No other node imports this one.

Used by