In Coypu, sound is produced by attaching a Sequencer to an instrument name (a Pharo symbol like #kick or #snare). The sequencer defines when the instrument triggers; EcoPhausto (or SuperDirt / Kyma) handles how it sounds.

💡 "If Pharo's syntax fits on a postcard, Coypu's fits on a business card." All sequencer creation methods follow the same pattern: create a pattern → send to: #instrumentName.

Binary array — asSeq

The simplest way to define a rhythm: an array of 1s (trigger) and 0s (rest). Send asSeq to it to create a Sequencer, then route it with to: #name.

#( 1 0 0 1 0 0 0 0 ) asSeq to: #kick.
ElementMeaning
1Trigger the instrument on this step
0Rest — do not trigger
"Four-on-the-floor kick"
#(1 0 0 0  1 0 0 0  1 0 0 0  1 0 0 0) asSeq to: #kick.

"Snare on beats 2 and 4 (16-step grid)"
#(0 0 0 0  1 0 0 0  0 0 0 0  1 0 0 0) asSeq to: #snare.
â„šī¸ Array length is flexible — 8, 16, 32 steps all work. Shorter arrays loop faster relative to the BPM grid.

Named rhythms — asRhythm

Coypu ships with a library of named rhythm patterns inspired by global music traditions. Send asRhythm to a Pharo symbol to get a ready-made Sequencer.

#rumba asRhythm to: #conga. #cumbiaClave asRhythm to: #conga. #banda asRhythm to: #kick.

To see the full list of available rhythms, evaluate in a Playground — or browse the Rhythm Library for step-by-step visualisations and ethnomusicological notes on every pattern.

Rhythm list.   "CMD+I or CTRL+I to open an Inspector on the result"

Shorthand: to: directly on a symbol

You can skip asRhythm and send to: directly to the symbol — less iconic but faster to type:

#plena to: #conga.
#banda to: #kick.

Hex patterns — hexBeat

Encode a 16-step binary pattern as a hexadecimal string. Each hex digit represents 4 bits (4 steps). This is a compact, memorable notation for complex patterns.

'<hex-string>' hexBeat to: #instrumentName.
'F000' hexBeat to: #kick.
"F = 1111, 0 = 0000 → triggers on first 4 steps of 16"

'020F' hexBeat to: #snare.
"0=0000 2=0010 0=0000 F=1111 → syncopated pattern"

'FFFF' hexBeat to: #ch.
"All 16 steps active — 16th-note closed hi-hat"
Hex digitBinary (4 steps)Pattern
00000All rest
81000Only first step
A1010Every other step
F1111All four steps

Step helpers — quavers & semiquavers

Create a fully-on sequencer of a given note resolution. Useful as a base to which you apply an index: or cascade other modifiers.

16 quavers to: #ch. 16 semiquavers to: #oh.
8  quavers to: #ch.      "8 triggers on quaver grid"
16 semiquavers to: #oh.  "16 triggers on semiquaver grid"
32 quavers to: #ride.    "32 triggers"

Joining sequencers — ,

Pharo's comma is the binary message for concatenating collections. Use it to chain two sequencers together into one longer pattern.

seqA , seqB to: #instrumentName.
"16 quavers followed by 16 semiquavers → 32-step open hi-hat"
16 quavers , 16 semiquavers to: #oh.

"Combine a named rhythm with an array sequencer"
#rumba asRhythm , #(1 0 1 0) asSeq to: #conga.

Random triggers — randomTrigs

Generate a pattern of random triggers of a given step-count. Each time the line is evaluated a new random pattern is produced.

N randomTrigs to: #instrumentName.
16 randomTrigs to: #ch.

"With probability (0-100): 65% chance of trigger on each step"
(16 randomTrigsWithProbability: 65) to: #ch.

Level control via cascade

After to: you can cascade level: with a space-separated string of amplitude values (one per step, cycling as needed):

16 randomTrigs to: #ch; level: '0.8 0.4 0.3'.
"Triggers at alternating levels 0.8 → 0.4 → 0.3 → 0.8 → â€Ļ"

Sample index — index:

When an instrument folder contains multiple samples (e.g. ch_0, ch_1, â€Ļ), use index: to select which sample plays at each step.

sequencer index: '0 1 2 3' to: #instrumentName. N quavers index: risingArray to: #instrumentName.
"Cycle through samples 0 1 2 3 on each trigger"
16 quavers index: '0 1 2 3 ' to: #bleep.

"Use asRisingArray to automatically build an ascending index list"
#ch index: 7 asRisingArray.

Routing to multiple instruments

The same rhythm can be routed to several instruments at once using the plural form rhythm: on the Performance object or an array of symbols.

#(#kick #ch #cowbell) rhythm: #banda.

"Or set a hex pattern across all sequencers in the Performance"
ep rhythm: '1312' hexBeat.

â„šī¸ Sequencers are live-replaceable: evaluate a new to: #name line at any time and the pattern updates on the next bar boundary without stopping the performance.