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
Performance uniqueInstance.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.
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:
| Part | Meaning |
|---|---|
16 | How many steps the pattern occupies |
downbeats | The rule that fills those steps — here, a trigger every 4th |
to: #bd | Which 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:
| Performer | The key becomes |
|---|---|
| PerformerSuperDirt | A SuperDirt sample folder name — #bd, #sn, #cp |
| PerformerPhausto | An instrument in the Phausto rack |
| PerformerKyma | A Kyma VCS label — #bass drives /vcs/bassGate/1 |
| PerformerLocal | An OSC address — #bass sends /bassGate and /bassNote |
| PerformerMIDI | A part on a MIDI channel, set with midiCh: |
#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.
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.
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.
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.
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.