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.
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.
| Element | Meaning |
|---|---|
| 1 | Trigger the instrument on this step |
| 0 | Rest â 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.
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.
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.
'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 digit | Binary (4 steps) | Pattern |
|---|---|---|
| 0 | 0000 | All rest |
| 8 | 1000 | Only first step |
| A | 1010 | Every other step |
| F | 1111 | All 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.
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.
"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.
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.
"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.
to: #name line at any
time and the pattern updates on the next bar boundary without stopping the performance.