Piano Roll
Author polyphonic note sequences in a piano roll editor.
What it does
Piano Roll is a tempo-synced note sequencer. A pattern of notes is drawn in a visual piano-roll editor and played back beat-for-beat against the project's BPM. Notes are held as four parallel lists, beat position, pitch, velocity and duration, one entry per note, so editing the pattern is editing those lists together.
Playback is polyphonic across four voices. Each note that turns on is assigned to the next free voice (first note on to voice 1, and so on), and each voice exposes its own note, velocity and gate outputs, enough to drive four independent synth voices, four particle emitters, or anything else taking a note-on/note-off stream.
When to use it
A musical, loopable trigger pattern instead of a one-shot LFO or timer: chords, arpeggios, drum-style hits, or a melody line driving other nodes
Up to four notes sounding at once, each with its own gate, pitch and velocity output feeding a separate voice
A pattern locked to a musical tempo (BPM) rather than wall-clock seconds, with Loop, Once and Ping-Pong playback
| Parameter | Type | Default |
|---|---|---|
trigger | OneOf([Boolean, Number]) | — |
reset | OneOf([Boolean, Number]) | — |
bpm | Number | 120 |
starts | String | "" |
pitches | String | "" |
velocities | String | "" |
durations | String | "" |
pattern_length | Number | 0 |
loop_mode | String | "Loop" |
velocity_scale | Number | 1 |
run | Boolean | true |
Gotchas
Notes live in four separate lists (starts, pitches, velocities, durations), matched up by position, so all four need the same number of entries. A start time without a matching pitch, velocity and duration will not play correctly.
Pattern Length at 0 derives the loop length from the notes. Raise it only to add trailing silence after the last note before the pattern repeats.
Only four voices are available. With more than four notes active at once, the newest active notes are still assigned voices in order, but there is no fifth voice to spill into. Keep patterns to four-note polyphony or fewer.
Trigger and Reset act on a rising edge only; holding either input high does nothing after the first tick. Trigger restarts playback from beat 0. Reset also clears all voice state, so use Reset to drop every gate immediately.
Worked example
Add a Piano Roll. Open the piano-roll editor and draw a few notes. This fills in Starts, Pitches, Velocities and Durations.
Set BPM to match the project tempo, and choose a Loop Mode (Loop, Once, or Ping-Pong).
Wire Gate 1 and Note 1 into a synth voice's gate and pitch inputs to hear the pattern play back.
Add more notes that overlap in time to hear Voice 2, Voice 3 and Voice 4 pick up the extra polyphony.
See also
Additive Synth · audio.wavetable · Envelope Follower · Numbers, signals & audio