@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
| Setter | Accepts | Default |
|---|---|---|
setPatternArpEngine(chromatic) | Selects which engine the panel edits | chromatic |
incrementPatternArpPattern / setPatternArpPattern(engine, p) | Cycles 0 to 4; the setter stores p % 256 | 0, sequence |
incrementPatternArpRestMode / setPatternArpRestMode(engine, row) | Cycles 0 to 4; the setter stores row % 256 | 0 |
setPatternArpRandomness(engine, amount) | Stored as f32, unclamped | 0 |
setPatternArpPlay, setPatternArpLatch, setPatternArpTransport | Gestures, with press timing in ms | off |
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::vectorsemantics up to 64 notes, then adds drop; sort stable to 16. Kept quirks: one ping-pong direction shared by both engines; every step start drawsrand(); slice key 28 cycles four modes.- Undefined upstream reads are guarded, counted in
guards; no LED or MIDI out.