five-mode arpeggiator with internal clock
The arp captures incoming MIDI note-ons into a sorted-by-pitch held-note stack (up to 3 entries — Pro-One style), removes the captured events from the MIDI buffer, and emits its own timed note-on/off events at the selected rate and pattern. It sits in the signal chain between latch handling and the mono/poly synth routing, so both the latch feature and both voicing modes work transparently with it.
The tempo you set here is the same arpBpm that drives
the drum sequencer and every
sync-aware LFO when SYNC SYNTH is on. The drum panel
shows the same BPM readout and its TEMPO slider writes to the
same atomic.
how the arpeggiator block is arranged on the env rail
The arp controls are laid out as a tidy three-row stack centred toward the right side of the envelope rail (just past the GLIDE knob):
OFF / UP / U/D / DRN / GATE), 40x22 px each
with a 2 px gap. Total row width is 208 px.Everything in the block is horizontally centred against the button row so the display and slider line up cleanly. The engraved "ARPEGGIATOR" caption above uses the same math to stay centred above the buttons regardless of window size.
the 5 positions on the arp mode selector
| Mode | Behavior |
|---|---|
| OFF | Bypass. MIDI note-ons/offs pass through to the mono/poly synth routing unchanged. Any notes the arp had sounding are released via internal note-offs. |
| UP | Plays held notes low → high, one note per 16th-note tick, loops back to low after the top. |
| U/D | Up-down bounce: low → high → low, with proper endpoint handling (no repeated top or bottom notes). |
| DRN (Drone) | All held notes sound simultaneously and sustain indefinitely. No clock stepping. Releasing a mode change (to OFF or a stepping mode) releases the drone cleanly. |
| GATE | All held notes retrigger on every 16th-note tick — rhythmic chord pulse. |
| Param | Range | Default | Notes |
|---|---|---|---|
| MODE | OFF / UP / U/D / DRN / GATE | OFF | Radio group to the right of the GLIDE knob. |
| BPM (TEMPO slider) | 0 → 320 BPM | 120 | Master tempo. Linear horizontal slider under the
BPM numeric display. Writes to arpBpm
— the same atomic the drum sequencer and every
sync-aware LFO read from. The clock runs at 16th-
note resolution (bpm / 60 × 4
ticks/sec). The engine clamps to a safe internal
operating range so slider extremes don't glitch. |
how the 3-note limit works
The arp keeps two synchronized views of its held notes:
held[] — sorted ascending by pitch (used by
UP/U-D stepping logic).heldOrder[] — sorted by insertion time,
oldest first (used by the rolling FIFO).
When a new note-on arrives and the stack is already at 3 entries,
the oldest entry (heldOrder[0]) is dropped from both
arrays and the new note is inserted (sorted) into
held[] and appended (newest) to heldOrder[].
This means you can play new notes while latched and the arp pattern
keeps rotating through your most recent 3 notes.
// pseudo-code for the "full stack + new note" branch if (numHeld >= kMaxNotes) { oldestNote = heldOrder[0]; remove oldestNote from held[] shift heldOrder[] left by one --numHeld; } insert(new note into held[] keeping pitch order) heldOrder[numHeld++] = newNote;
While LATCH is ON, note-offs are stripped from the
MIDI buffer before the arp sees them, so the held stack never
shrinks naturally — the arp keeps cycling through everything
you pressed. The rolling FIFO is how you swap notes: after the
stack is full, each new note you press pushes out the oldest.
When you toggle LATCH off, the engine calls
arp.forceRelease() which empties the held stack, the
sounding flags, and the step counter so no ghost notes re-trigger
on the next clock tick.
Arp-emitted note-ons feed through the same mono-mode note stack
the keyboard would — so mono mode + arp gives you a single
voice cycling with proper legato on consecutive steps, plus
GLIDE applied between steps if set.
Poly mode has 4 voices (voice stealing enabled). In UP / U-D modes only one note at a time is active so you rarely steal; in GATE mode the three held notes hit simultaneously on every tick, which spreads across 3 of the 4 voices cleanly.
Switching modes while notes are held or latched triggers a one-shot edge detector that emits note-offs for any currently-sounding arp notes. So you can freely flip between OFF / UP / U-D / DRN / GATE without stuck notes.