← All modules

@maru shared this module so you can build on it and use it in your DAW.

AvailableMIDI & Modulation

Arpeggiator

Walk held notes through a rhythmic pattern.

About

A MIDI arpeggiator: hold a chord and it plays the held notes one at a time on a steady grid. It makes no sound of its own, so place it in front of an instrument and play through it.

The idea

The pattern follows what your hands are holding rather than recording it. Add a note to a chord you are already holding and it joins the pattern on the next step; lift one and the cycle closes around the gap. The step grid keeps running while the harmony changes, so the rhythm does not stutter when you move between chords.

The random pattern is seeded. Each step's choice comes from the step number, so the line is unpredictable to listen to but plays back the same way every time, including in an offline render.

Controls

  • Arp switches the arpeggiator in or out. Off, held keys pass through and sound normally, which is the easiest way to hear what it is doing.
  • Pattern sets the order: up, down, up-down, order played, or random. Up-down turns around without repeating the top or bottom note. Order played keeps the order in which your fingers landed.
  • Rate is steps per second, from 0.5 to 32 Hz. 8 Hz is sixteenth notes at 120 BPM.
  • Octaves stacks the held chord over one to four octaves. The whole chord repeats an octave up at a time: two octaves of C-E-G play C E G C' E' G'.
  • Gate sets note length as a fraction of the step, so it follows Rate. Short is staccato, high is legato; a small gap is always kept between notes.

The panel's walk diagram shows how the current pattern orders a reference chord, usually C-E-G. It is a reference, not a display of the notes you are holding.

Getting started

Mount an instrument after the Arpeggiator, hold a three- or four-note chord and try Up at the default 8 Hz. Then switch to Up-down, add a second octave and shorten the Gate. Release the keys to stop the pattern.

Hold and Swing appear on the panel but are not available yet: the pattern always stops when you let go, and steps are always straight.

How it works.

The module is split into a pure core and a scheduler, and the split is where the interesting part lives. The core is a plain function: given the set of notes you are holding, a step index and the params, it returns the note that step plays. It has no clock, no audio and no state, which is what makes every musical claim on this page, the ordering, the octave stacking, the gate maths, the reproducibility of random, checkable in the test suite rather than by ear.

The scheduler wraps that core in the same lookahead loop the chord player and the clip player use. A timer wakes every 25 ms, asks the core for every step whose onset falls in the next 120 ms, and commits each one to the engine with an absolute AudioContext time. Because the time is computed rather than taken from the timer, a stalled main thread can delay the decision but cannot move the note, which is the whole reason this is not a setInterval that calls noteOn.

It hooks note handling rather than the audio graph. A keypress while the arp is engaged is swallowed and held; the scheduler then re-enters the engine's own noteOn with a scheduled time, so the sound comes from whichever voice the mounted module provides. That is what makes it a note filter in the roster's sense: it emits MIDI, not audio, and needs an instrument downstream to be heard.

What would you make with Arpeggiator?

Describe what you want to make. Build it with the Studio agent.

Goes well with.

Prototype

A step sequencer and arpeggiator on one grid.

Prototype

A 32-step Matrix, with ties, ratchets and a curve lane.

Prototype

Generate a voiced chord from one note.

Prototype

A compact subtractive synth for learning the signal path.