Giving a rhythm pitch — by hand, from a scale, as chords, or generated. Eighteen scales, sixty-four chord types, and several ways to let the machine write the tune.
1. Notes by hand
A Sequencer's notes are consumed one per trigger and wrap when they run out, so you never need as many notes as steps:
(16 claveSon notes: #( 36 38 42 46 )) to: #perc.
Five triggers, four notes — the figure shifts by one each cycle, which is a cheap and musical source of variation. Give it exactly five and it repeats identically.
Many named rhythms take the notes inline as a string:
16 claveSon: '36 38 42 46' to: #perc.
1.1 Note names and the octave question
Where a string of notes is accepted, note names work as well as numbers.
asMidiNote handles a generous range of spellings:
| Written | Means |
|---|---|
c4 | MIDI 60 — middle C in Coypu's reckoning |
c#4 cs4 | Sharp — # or TidalCycles-style s |
bb3 bf3 | Flat — b or f |
c##4 cx4 css4 | Double sharp |
cbb4 cff4 | Double flat |
c | No octave digit defaults to octave 4 |
60 | A bare number passes through unchanged |
asMidiNote and an older asMidiNN, and they do not
agree: 'c4' asMidiNote is 60, while 'c4' asMidiNN is 72. The
string notations used throughout this manual go through asMidiNote, so
c4 means 60. If a melody lands an octave high, check which one you called.
2. Scales
A Scale is an array of semitone intervals from a root. Send the scale's name to
the Scale class to get it:
Scale pentaMinor. "#(0 3 5 7 10)"
Scale pentaMinor: 60. "the same, rooted at middle C"
2.1 The eighteen scales
| Scale | Intervals | Notes |
|---|---|---|
| major | 0 2 4 5 7 9 11 | The major scale |
| minor | 0 2 3 5 7 8 10 12 | Natural minor — see §2.3 |
| pentaMajor | 0 2 4 7 9 | Major pentatonic |
| pentaMinor | 0 3 5 7 10 | Minor pentatonic |
| yo | 0 3 5 7 10 | Japanese yo, used in gagaku and shōmyō — identical to pentaMinor |
| blues | 0 3 5 6 7 10 | Minor pentatonic plus the flat fifth |
| bebop | 0 2 4 5 7 9 10 11 | Major with a chromatic passing tone |
| chromatic | 0 1 2 … 11 | Every semitone |
| augmented | 0 3 4 7 8 11 | Symmetrical, alternating minor and major thirds |
| gypsy | 0 2 3 6 7 8 10 | Hungarian/Romani minor, with its augmented second |
| flamenco | 0 1 4 5 7 8 11 | The Andalusian sound |
| persian | 0 1 4 5 6 8 11 | Persian |
| enigmatic | 0 1 4 6 8 10 11 | Verdi's scala enigmatica |
| istrian | 0 1 3 4 6 | From the Istrian peninsula, Croatia |
| hirajoshi | 0 4 6 7 11 | Koto tuning adapted from shamisen music by Yatsuhashi Kengyō |
| insen | 0 1 5 7 10 | A koto tuning differing from hirajoshi by one note |
| sakura | 0 1 5 7 8 | The Japanese in scale — koto and shamisen |
| domenico | 0 2 8 9 11 | The author's own |
Every one has a rooted variant taking a MIDI note — Scale gypsy: 62 — and
blues:octaves: spans several octaves at once.
2.2 Using a scale
A scale is just an array, so anything taking notes will take one:
"pick random notes from a scale"
(16 quavers notes: (8 randomNotesFrom: (Scale pentaMinor: 60))) to: #arpy.
fullScale expands a scale across the whole MIDI range, which is what you want
when a generator needs room to move:
Scale pentaMinor fullScale. "the pattern repeated up to 128 notes"
intoScale: goes the other way, mapping scale degrees onto pitches so you can
think in steps rather than semitones:
#( 0 2 4 2 ) intoScale: #pentaMinor.
2.3 Two quirks worth knowing
minor includes its octave; nothing else does
Scale minor is #(0 2 3 5 7 8 10 12) — eight elements, the last
being the octave. Every other scale stops below it. When a generator picks uniformly from
the array, minor therefore favours the root slightly and spans one note more
than you might expect.
yo and pentaMinor are identical
Both are #(0 3 5 7 10). The two names are kept for what they mean
musically rather than for any difference in output — much as
adowa and sikyi share a rhythm.
3. Chords
Chord list answers a Dictionary of 64 entries, from major to
thirteen, each an array of intervals. Many are aliases —
major/maj, minor7/min7 — so the number
of distinct voicings is smaller than 64.
Chord list. "inspect the whole table"
Chord traceList. "print the names to the Transcript"
3.1 Chord notation
Chords are written as strings in root-quality form, separated by spaces. The
root may be a note letter or a number:
'c-maj' parseChord. "#(0 4 7)"
'd-min7' parseChord. "rooted on D"
'12-sus4' parseChord. "root as a semitone offset"
Send a whole progression to a Sequencer with chords::
(16 downbeats chords: 'c-maj a-min f-maj g-dom7') to: #piano.
| Family | Examples |
|---|---|
| Triads | maj min aug diminished five |
| Suspended | sus2 sus4 sevensus2 ninesus4 |
| Sixths | six six9 minor5 |
| Sevenths | maj7 min7 dom7 diminished7 minMaj7 |
| Extensions | nine eleven thirteen and their major/minor forms |
| Altered | sevenflat5 sevensharp5 sevenflat9 min7flat5 |
chords: answers a SequencerPoly, which sends every note of the
chord on each trigger rather than one at a time. Not every backend handles that the same
way — SuperDirt gets one message per chord tone.
3.2 Arpeggios
arpeggiate: spreads the chord tones across successive triggers instead of
sounding them together:
(16 semiquavers arpeggiate: '12-sus4 0-min') to: #psg.
The variant arpeggiate:octave: shifts the whole figure by octaves. Notes are
laid out in chord order and then consumed one per trigger like any other note list, so the
rhythm you choose decides the arpeggio's shape.
4. Generated melodies
4.1 Random walks
The difference between a random walk and random notes is that a walk moves by one scale degree at a time. It stays coherent where free choice sounds scattered:
(16 quavers notes: (8 randomWalksOn: Scale pentaMinor octaves: 2 root: 60))
to: #arpy.
| Message | Gives |
|---|---|
| n randomWalksOn: scale | A walk within one octave of the scale |
| n randomWalksOn: scale octaves: o | A walk across o octaves |
| n randomWalksOn: scale octaves: o root: r | The same, rooted at MIDI note r |
| n randomNotesFrom: array | Free choice, no step constraint |
| n randomNotesFrom: array octaves: o | Free choice, octave-displaced |
| n randomNotesIn: #( lo hi ) | Uniform between two MIDI notes, ignoring any scale |
| n randomNotes: #( lo hi ) | As above, by range |
A Sequencer understands several of these directly, which avoids nesting the parentheses:
(16 quavers randomNotesFrom: Scale pentaMinor fullScale) to: #arpy.
(16 quavers withRandomNotesMin: 48 max: 72) to: #arpy.
4.2 Markov melodies
JazzMarkovMelody generates a line by weighted transitions between scale
degrees rather than by stepping at random. Motion tends upward and stepwise, which sounds
more deliberate than a walk:
gen := JazzMarkovMelody new.
melody := gen
generateMelodyFromScaleDegrees: Scale bebop
root: 60
startDegree: 0
length: 32.
(32 quavers notes: melody) to: #arpy.
The transition table is seven degrees wide and built in initialize, so it
works with any seven-note scale. Feeding it a pentatonic will simply never reach the
higher degrees.
melodyFrom: is the simpler relative: it generates notes from a scale and then
nudges the note before each octave or second onto a more resolved degree.
(16 quavers melodyFrom: (Scale major: 60)) to: #arpy.
5. Transposing and progressions
| Message | Effect |
|---|---|
| transpose: n | Shift a Sequencer's notes by n semitones |
| progression: intervals | Repeat the Sequencer once per interval, transposed each time |
| + n / − n | Arithmetic transposition; + answers a copy |
| randomOctaves: n | Displace each note by a random number of octaves |
"a I–vi–IV–V from one bass figure"
(16 tumbao notes: #( 36 43 )) progression: #( 0 9 5 7 ); to: #bass.
"shift a whole part after the fact"
#bass transpose: -12.
progression: #( 0 9 5 7 ) makes the part four times longer. Against 16-step
drums that gives a four-bar harmonic cycle for free — but be aware which of your parts are
long, or they will seem to drift.
7. Troubleshooting
My melody is an octave higher than expected
Probably asMidiNN rather than asMidiNote — they differ by twelve.
§1.1.
Fewer notes are sounding than I supplied
Notes are consumed one per trigger, not per step. A pattern with four triggers uses four notes however many you give it, and the rest wait for the next cycle — §1.
The scale sounds right but one note keeps recurring
If it is minor, the octave is in the array twice over — as 0 and
as 12 — so uniform picking favours the root. §2.3.
A chord plays only one note
The backend may not handle polyphony the way SequencerPoly sends it. Try
arpeggiate: instead, which needs nothing special — §3.2.
parseChord raises an error about an invalid chord
The quality is not in Chord list. Check spelling against
Chord traceList; the names are lowercase and unhyphenated —
min7flat5, not m7b5.
The Markov melody sounds stuck
Its table covers seven degrees. On a five-note scale the higher transitions fall outside the array and the line stays low — give it a seven-note scale — §4.2.