Chapter 3
Notes & scales
Absolute notes, scale degrees, and one key for the whole song.
Notes and degrees
| Write | Means |
|---|---|
note("c4 e4 g4") · note("60 64 67") | absolute pitch; c3 is MIDI 60, sharps and flats are c#4 / db4 |
n("0 2 4").scale("F minor") | scale degrees: 0 is the root, 7 the octave above (in a seven-note scale) |
keys: n("0 2 4 6").scale("F minor").synth("Wavetable").postgain(0.6)
A scale is "root mode": "F minor", "c dorian",
"Bb mixolydian". The modes, pentatonics, blues, harmonic and melodic minor and
chromatic are there, with the usual aliases. "F2:minor" is the same scale, and that
spelling can be patterned like any other argument: .scale("<F2:minor Ab2:major>")
changes scale each cycle.
keys: n("0 2 4 6").scale("<F2:minor Ab2:major>").synth("Wavetable").postgain(0.6)
On a note() pattern, .scale() snaps each note to the
nearest one in the key: note("c4 f#4").scale("C major") plays c4 and f4. Notes from a
MIDI keyboard snap the same way.
One key for the song
setscale("C minor") sets the key for the buffer, and .sc() uses it. The
optional number puts the root in that octave.
setscale("C minor")
bass: n("0 3 5").sc(3).synth("Wavetable")
.fx("Filter").param("Cutoff", 0.4).postgain(0.8)
lead: n("0 2 4 7").sc(5).synth("FM").vel(0.7).postgain(0.6)
The last setscale in the buffer wins everywhere, including the tracks above it, so
changing key is one edit. The piano roll follows it.
synth("…") with no notes plays a C3 every cycle, so a new instrument makes sound
while you decide what it should play.
To move notes by scale steps rather than semitones, add an n():
.add(n(2)) is two steps up in the key. See Transforms.
Chords
.chord() builds a chord on every note, with the note as its root. A quality name is
the same chord in any key; a number stacks the key's own thirds, so the chord changes quality
as the root moves through the scale.
| Write | Plays |
|---|---|
note("c3 f3").chord("m9") | Cm9, Fm9 |
n("0 3 4").sc().chord() | the key's triads: in C major C, F, G |
n("0 3 4").sc().chord(7) | its seventh chords: Cmaj7, Fmaj7, G7; 9, 11, 13 go taller |
.chord("<m7 dom7>") | a quality per cycle, like any pattern |
The qualities are maj m dim aug
sus2 sus4 maj6 m6 dom7
maj7 m7 m7b5 dim7 mMaj7
7sus4 add9 madd9 maj69 dom9
maj9 m9 dom11 m11 maj11
dom13 m13 maj13 power.
| Write | Does |
|---|---|
.inv(1) | invert, staying in the same register; -1 inverts downward |
.voicing("drop2") | close · open · drop2 · drop3 · shell (root, 3rd and 7th) |
.spread(1) | move the outer notes an octave apart from the middle |
.lead() | pick each chord's inversion so its notes move as little as possible; .lead("c4") stays near c4 |
A voicing keeps its shape through .inv() and .lead(): a drop-2 chord
stays a drop-2 chord, just on another inversion. An .inv() after
.lead() inverts from the voicing it chose. All of them work on any chord, whether
it came from .chord(), "[c3,e3,g3]" or a piano roll.
setscale("C major")
keys: n("<0 5 3 4>").sc(3).chord(7).voicing("drop2").lead()
.synth("Wavetable").postgain(0.35)