A pattern (+ → Pattern, #333) is a stretch of notes for one instrument, drawn in a piano roll. It is the second piece of the music tools of #330: a song (#334) lays patterns out on tracks, and several songs and tracks can use the same pattern.
Patterns are listed under Patterns in the asset panel, the instruments under Instruments. A new pattern is empty: four bars of 4/4 at 120 BPM, drawn on a 1/16 grid, with no instrument yet.
What a pattern says
The notes and the loop are the pattern's own data; everything else is a row in the inspector.
| Row | What it does |
|---|---|
| Instrument | What plays the notes, and what the keys of the tab play. Without one the notes can be drawn, but nothing sounds. |
| Length (bars) | 1 to 256 bars. A note starting at the end or behind it is kept, drawn faint, and not played; a note reaching past the end is cut off there. |
| Grid | What a note is drawn and moved on: 1/1 to 1/32, and the triplets 1/4T to 1/32T. The tab's header has the same choice. |
| Sign | The time signature, from the same list as a song's (#364): 1/2, 2/2, 3/2, 1/4 to 6/4, or 5/8 to 9/8, 4/4 by default. It only says where the bars and beats of the ruler are; the notes are kept in ticks, so a pattern changed from 4/4 to 6/8 keeps every note where it was. |
| Tempo (BPM) | 20 to 400, quarter notes a minute, for hearing the pattern in its tab. A song plays it at its own tempo. |
| Sound FX | A sound FX all its notes go through together, as one chain (#352): Play pattern, the tab, and a pattern item of a song that picks none. |
Where a Play pattern and the tab are heard is said by the links of its node in the
Master routing (#351). In a song the song's links count.
A note is a start and a length in ticks (480 to the quarter note, see Playing in time), a note number (60 is C4) and a velocity from 0 to 1. One instrument plays the whole pattern; a drum kit is one instrument with a name per note (see Single notes on Instruments).
The Pattern tab
Down the left are the keys, the highest note on top. A key the instrument plays nothing for is grey, a note a drum kit has named shows its name, every C its note name. A key sounds while the pointer holds it. Along the top is the ruler with the bars numbered from 1 and the beats as short ticks, the loop as a band along its top edge and where playing starts as a small triangle at its foot. Between them are the notes, each a bar in its key's row, the brighter the harder it is struck; picked notes are light with a white edge. An end of a note under the pointer lights up and the pointer turns into a resize arrow, as on an item of the Song tab: that end can be dragged. Below them is the velocity lane: a stem at the start of every note, as high as its velocity.
The header has Play (it turns into Stop), the Grid, Audition, Ghosts with where the ghost notes come from, Fit and on the right the number of notes and the instrument. Audition is off when the tab opens; switched on, a note sounds for a moment when it is drawn, grabbed or moved to another key. The keys down the left sound either way. Fit shows the whole pattern across and its notes (or, with none, what the instrument plays) down the middle, the rows zoomed so they fill the height (up to 64 px a row).
Drawing and editing
| Do this | And this happens |
|---|---|
| Click into the grid | A note at the grid line before the pointer, as long as the last note drawn or lengthened (a grid step at first), with the last velocity set (0.8 at first). It is picked and, with Audition on, sounds for a moment. Only inside the pattern: left of bar 1 and from its end on a click draws nothing. |
| Drag a note by its body | It moves along the grid and to the key under the pointer, the other picked notes with it. With Audition on it sounds when grabbed and again on every new key. |
| Drag a note by its right end | It takes the length to the grid line nearest the pointer, the other picked notes lengthen by as much. |
| Drag a note by its left end | Its start goes to the grid line nearest the pointer and its end stays put; the other picked notes' starts move by as much. Never before tick 0. |
Hold Alt or Shift while drawing, moving or sizing |
Off the grid, on the tick. A note is at least one tick long. |
| Drag on empty grid | A band; the notes it touches are picked. With Shift they are added to the pick. |
Shift-click a note |
Adds it to the pick or takes it out. Dragged on with Shift, it is added and moved or sized off the grid instead. |
| Right-click a note | Deletes it; dragging on with the right button deletes every note it passes. |
| Drag a stem in the velocity lane | Sets that note's velocity; if the note is picked, the other picked notes move by as much. |
Every drag is one undo step, and so is every key below that changes notes.
| Key (the roll focused) | |
|---|---|
Space |
Play or stop. |
Delete, Backspace |
Delete the picked notes. With none picked the key does nothing, so a second press never asks about the pattern itself. |
Ctrl+C, Ctrl+V |
Copy the picked notes; paste them under the pointer: the earliest on the grid line before it, the highest on its row, as far as the keyboard goes. With the pointer off the grid (or outside the pattern) the earliest lands where playing starts, on the keys they came from. The copy works for every pattern of the project. |
Ctrl+D |
A copy of the picked notes right behind them, moved by whole grid steps, picked in their place. |
Ctrl+A |
Pick every note. |
↑ / ↓ |
The picked notes a semitone up or down, with Shift an octave. |
← / → |
The picked notes a grid step earlier or later, with Shift a bar. |
Esc |
Pick nothing. |
Ctrl+C, Ctrl+V and Delete work on the tab also when the keyboard is somewhere else in the
editor, the way they do in the other tabs.
The ruler
The ruler has two parts: a dark loop strip along its top, which shows the loop as a blue band, and below it the bars and beats, which hold where playing starts.
- A click or drag on the bars moves where playing starts, and nothing else (on the grid line
nearest the pointer, with
AltorShifton the tick). A paste with the pointer off the grid lands there. While the pattern plays, it jumps there when the button is let go. - A drag on the loop strip spans the loop, on the grid. Near an end of the loop a drag moves that end. A click there without a drag changes nothing.
- A right-click offers Loop bar N and Loop the whole pattern. With no loop set the whole pattern is the loop, and a shorter pattern cuts a loop at its end.
Zoom and scroll
The wheel zooms and does nothing else: over the grid, the ruler or the velocity lane it zooms the
time about the pointer, over the keys it zooms the rows (6 to 64 px). Alt and Shift do not change it. A
middle-drag pans both ways. Bar 1 need not stay at the left edge: a pan takes it up to half the
grid in, and with ghost notes back to the start of the song. The time
before it and from the end of the pattern on is drawn dark, only to look at; a click there draws no
note. Down the
grid the same: the highest note can come up to half the height down from the top, the lowest up to
half the height up from the bottom, the room past them dark and with nothing to draw. Ctrl+wheel is left to the browser, which zooms the page with it. Only
what is on screen is drawn, so a pattern of some hundred notes stays quick.
Ghost notes from the song
A pattern opened by a double-click on its item in the Song tab shows what else the song plays around that item, faint: grey boxes without an edge, under the pattern's own notes. They cannot be clicked or picked; resting the pointer on one tells its track and its pattern. The header names where they come from, for example Tune · Bass · bar 5. Ghosts switches them off and on, and is on when the tab opens.
- Which round: an item plays its pattern round and round for as long as it is. The round double-clicked into is the one edited; it starts at bar 1 of the roll.
- What counts: every pattern item of the other tracks, all along the song. On the item's own track the items before and after it and its other rounds. The round edited itself does not count, so ghost notes of the own track only ever show outside the pattern. Sound items have no notes and do not show.
- Which row: a ghost note is drawn where it sounds, with the transpose of its own item, less the transpose of the item the pattern was opened from. So a note drawn on the row of a ghost note sounds together with it in the song.
- How long it holds: the item is remembered for the pattern while the project is open. The pattern opened again from the Assets panel shows the same item; moving the item in the song moves its ghost notes along. Without a double-click, a pattern that lies in exactly one item of all the songs shows that one, its first round. A pattern used several times shows none until one of its items is double-clicked. The item gone or set to another pattern, they are gone too. Nothing of this is saved with the project.
- Play still plays only the pattern. Fit frames only the pattern.
Measured (2026-10-07, e2e 65): a pattern item on the third track, double-clicked into its second round, with the same pattern a tone up on the second track from bar 1: all 8 notes of the second track were drawn a tone up, each at its tick of the song less where the round starts; the header said Song · Track 3 · bar 4, and resting on a ghost note showed Track 2 · Riff 65.
Playing
Space or Play plays the pattern round its loop from where playing starts, through the scheduler (#332): each note is planned ahead on the clock of the sound and starts on its sample. A playhead runs over the grid, the lane and the ruler. An edit while it plays is heard from the next window on, without starting over: a note drawn ahead of the playhead in this round, one drawn behind it in the next. A new loop or tempo counts from what is planned.
Playing goes on while another tab is open, so an instrument can be changed while its pattern plays. It stops when another pattern is shown in the tab, when its tab is closed (a key of the roll too), when the pattern is gone, when Play starts the game and when a project is opened.
Measured (2026-10-06, e2e 64 on the CI's Windows machine): bar 1 of a pattern at 120 BPM, its notes at ticks 720, 960, 1440 and 1680 were planned exactly 0, 0.25, 0.75 and 1 s apart on the audio clock; a note drawn at tick 1800 while it played came in the next round with the playing going on.
Playing one in a game
Play pattern plays a pattern through its instrument, at the pattern's own tempo, on the same scheduler as the tab. It plays the whole pattern from its first bar to its end: the loop set on the ruler is only for editing.
| Input | |
|---|---|
pattern |
The pattern asset. |
volume |
0 to 1, how loud every note of it is next to its velocity. |
loop |
On (the default): round and round until it is stopped. Off: once, and it is over by itself when its last note has ended. |
detached |
As for a sound: off, the pattern belongs to the object of the behavior and stops when that object is destroyed; on, it outlives it. |
fx |
A sound FX all of it goes through as one chain (#346): an LFO runs on across the notes, an echo repeats the whole. From the asset (the default) is the pattern's own Sound FX, None none (#352). A Pitch there is a shifter of its own, and the notes start as much earlier as it is late. |
fx params |
Values for that FX's parameters, from a Sound FX parameters node. Set sound FX parameters with the playback moves them while it plays. |
It gives out playback, the number of this playing, and 0 where the pattern has no instrument or
no notes. Firing it twice plays the pattern twice, overlapping. Its files are loaded first, so the
first note may come a moment later, but always in time with the ones after it.
Stop pattern stops every playing of the pattern it names, and every pattern where it names
none (songs and sounds play on). With playback connected it stops only that one, and nothing where it is 0.
Its notes fade out in 10 ms; with Let ring a note of an instrument with an
Envelope falls away in its release. Stop sound reaches patterns as well:
naming no sound it stops everything, patterns included, and its voice takes a playback. The end
of the run stops every pattern.
A pattern can be baked with the icon in the header of its tab (#340): Play pattern then plays
the bake, one voice of a file, in place of its notes, as long as nothing it is made of has changed.
The tab plays the notes. See Baking.
To play several patterns and sounds together, lay them out in a song and play that with Play song. A pattern has no tempo input in the game yet, and nothing tells a graph that a pattern played once has ended.
Measured (2026-10-06, e2e 64): a bar of quarters at 150 BPM played by Play pattern in a game was
planned 0.4 s apart, round and round, owned by the behavior; stopping the game ended it, and played
once it was gone by itself after its bar.
Not yet
No ghost notes from another pattern without a song, no lanes for pitch bend or an instrument's parameters (automation, #337), no swing (#372). The computer keyboard does not play notes in this tab as it does in the Instrument tab, and there is no step input.
Using the editor
- Concepts
- Accounts
- Agents (MCP)
- Scenes
- Scene editing
- Behaviors
- Structs
- Colliders
- Physics
- Textures
- Vector art
- Pixel art
- Fonts
- Videos
- Sounds
- Instruments
- Patterns
- Songs
- Animations
- Curves
- Tiles
- Tilemaps
- State machines
- Shaders
- Particles
- Containers
- Compositions
- Keyboard
Working on the code