Four objects do all the work in Coypu. Learn what each one is for and the rest of this manual is detail.

1. The four objects

Sequencer — one part. It holds gates (when to trigger), notes, durations and gate times. Everything in Rhythms: Basics builds one of these.
Performance — a dictionary of Sequencers keyed by instrument name, plus the transport. There is exactly one, reached with Performance uniqueInstance.
Performer — the backend adapter. It decides what a triggered step actually sends: an OSC message to SuperDirt, a MIDI note, a Phausto parameter change.
Rhythm — an array of ones and zeros with a name. The 31 named rhythms are Rhythms; so is anything you write by hand.

The flow is always the same. A Sequencer goes into the Performance under a key; the transport walks the steps; on each trigger the Performer sends something to the outside world.

The Performance is a Dictionary Literally — Performance is a subclass of Dictionary. Instrument names are its keys and Sequencers are its values, which is why sending a new Sequencer to an occupied key simply replaces the old one.

2. Your first pattern

Assuming you have a backend working from Setup, open a Playground and evaluate these line by line with Cmd-D / Ctrl-D:

"1. get the Performance"
p := Performance uniqueInstance.

"2. choose where sound goes"
p performer: PerformerSuperDirt new.

"3. set a tempo"
p freq: 120 bpm.

"4. put a pattern on an instrument"
16 downbeats to: #bd.

"5. start the transport"
p play.

Four evenly spaced kicks, looping. That is a working Coypu session.

2.1 Reading the line

16 downbeats to: #bd is worth taking apart, because every pattern you write will have this shape:

PartMeaning
16How many steps the pattern occupies
downbeatsThe rule that fills those steps — here, a trigger every 4th
to: #bdWhich instrument key to file the resulting Sequencer under

The receiver is always the step count, never the trigger count. 16 downbeats is sixteen steps containing four triggers — see Rhythms: Basics §5.

3. Instrument keys

The symbol after to: is a key in the Performance, and what it means depends entirely on your Performer:

PerformerThe key becomes
PerformerSuperDirtA SuperDirt sample folder name — #bd, #sn, #cp
PerformerPhaustoAn instrument in the Phausto rack
PerformerKymaA Kyma VCS label — #bass drives /vcs/bassGate/1
PerformerLocalAn OSC address — #bass sends /bassGate and /bassNote
PerformerMIDIA part on a MIDI channel, set with midiCh:
Names that work everywhere With SuperDirt, #bd, #sn, #hh, #cp and #arpy are all standard folders. If you hear nothing, a wrong folder name is as likely as a wrong pattern.

4. Adding parts

Each new key is a new part. Add them while the transport runs:

16 downbeats to: #bd.
16 claveSon  to: #cp.
16 quavers   to: #hh.

Three patterns, three instruments, all locked to the same transport. There is no limit and no setup — a key exists because you sent something to it.

Patterns of different lengths run happily together and drift against one another, realigning at the least common multiple:

16 downbeats to: #bd.    "16 steps"
13 trueAksak to: #perc.  "13 — realigns after 208 steps"

5. Changing what is playing

This is the part that makes Coypu a live-coding system rather than a sequencer: re-evaluate a line and the part changes at the next step. Nothing stops, nothing is rebuilt.

"with the transport running, evaluate this…"
16 claveSon to: #cp.

"…then this"
16 rumba to: #cp.

The same applies to tempo, and to taking a part away:

p freq: 140 bpm.
p mute: #hh.
p remove: #cp.
Evaluate the line, not the file Coypu sessions are written as a Playground full of independent lines that you fire individually — not as a script run top to bottom. Keeping every part on its own line is what makes that practical.

6. Giving a part pitch

A bare rhythm plays one repeated note — MIDI 60. notes: supplies pitches, taken one per trigger and wrapping when they run out:

(16 tumbao notes: #( 36 43 36 41 )) to: #bass.

Many named rhythms accept the notes inline, which reads better:

16 tumbao: '36 43 36 41' to: #bass.
MIDI 60 is c4 in Coypu Coypu's note-name parser treats c4 as 60, so 'c4 e4 g4' is a C major triad from middle C. Some other systems call that C3 — if a melody comes out an octave away from where you expected, this is usually why.

Scales, chords and generated melodies are covered in Melody & Scales.

7. Stopping cleanly

p stop.        "halt the transport immediately"
p muteAll.     "silence everything but keep the parts"

stop is instant, with no fade and no wait for the bar. In performance you usually want to thin the arrangement out first and stop into a gap — see Performing.

If sound continues after stop Something else is still running — most often a second transport started by hand, or a sustaining note on a backend that never received its note-off. p muteAll followed by p stop clears the first; the second is backend-specific.

8. Where to go next

DocumentWhat it covers
Coypu by ExampleA full session built up line by line, from one kick to an arrangement.
Rhythms: BasicsEvery notation for building a pattern.
Rhythm LibraryAll 31 named rhythms.
PerformingTransport, mute, solo and the moves you make live.

9. Troubleshooting

Everything runs without error but there is no sound

Work outwards: is the transport running (p play), is a Performer set (Setup §4), and is the backend actually up? A Coypu session with no Performer raises nothing — it simply sends nowhere.

One instrument is silent while the others play

The key probably does not exist on the backend — a misspelt SuperDirt folder, or a Phausto instrument that is not in the rack. Try a name you know works, such as #bd.

My pattern plays once and stops

You used playFor: with a small number. p play runs effectively indefinitely — see Performing §2.

Re-evaluating a line did not change anything

Check you evaluated the line rather than just saving it, and that the key matches — sending to #hh will not alter a part filed under #ch.

The melody is an octave out

Coypu treats c4 as MIDI 60 — §6.

Two parts will not stay in sync

They are different lengths and are meant to drift. Give them the same length, or a common multiple — §4.