Build with this node

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

Ask Studio

@maruaudio/dsp/processors/pattern-arpeggiator is a port of the CHOMPI TEMPO firmware's two-engine ArpeggiatorSequencer: engine 0 chromatic, engine 1 the slice engine. Each steps on clock edges through a held or latched note list in one of five orders (sequence, up, down, ping-pong, random), with five 20-step rest rows, random ±12 shifts, sustain, decouple and a deferred retrigger for a lone note. Its engine requests (START, STOP, short-release retrigger and restore, last slice) go to an output log in call order.

Parameters

SetterAcceptsDefault
setPatternArpEngine(chromatic)Selects which engine the panel editschromatic
incrementPatternArpPattern / setPatternArpPattern(engine, p)Cycles 0 to 4; the setter stores p % 2560, sequence
incrementPatternArpRestMode / setPatternArpRestMode(engine, row)Cycles 0 to 4; the setter stores row % 2560
setPatternArpRandomness(engine, amount)Stored as f32, unclamped0
setPatternArpPlay, setPatternArpLatch, setPatternArpTransportGestures, with press timing in msoff

Lifecycle

createPatternArp allocates 64-note lists, a 64-request FIFO and a 512-entry log → per 48-frame block after the @maru/processors-division-clock head: setPatternArpClockEdge per stepped lane, the active-voice keys, patternArpPrepare(rand, nowMs) → drain and clearPatternArpOutput → resetPatternArp. Keys enter through routePatternArpKey; scenes recall through setPatternArpLatchDirect, setPatternArpSequence and the scene-swap pair. The caller owns the rand() stream.

When to use it

Reproducing the CHOMPI TEMPO arpeggiator step for step beside the division clock; @maru/processors-midi-pattern is the general pattern.

Limits

  • std::vector semantics up to 64 notes, then adds drop; sort stable to 16. Kept quirks: one ping-pong direction shared by both engines; every step start draws rand(); slice key 28 cycles four modes.
  • Undefined upstream reads are guarded, counted in guards; no LED or MIDI out.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Parameters

ParameterTypeSetter
Engine enginefloatsetPatternArpClockEdge
Chromatic chromatic

`setEngine(g)`: true selects the chromatic engine (0), false the slice engine (1).

boolsetPatternArpEngine

Dependencies

Dependents

No other node imports this one.

Used by