Documentation · Naming
Name[a:b] Slices
A python slice over the ITEMS a reference plays — `Row[:4]`, `Row[2:]`, `Row[::-1]`.
- A slice over a rule whose body is ONE cell call counts the expansion, rests included.
- A slice over a body of SEVERAL calls counts the calls, one apiece.
- An out-of-range lower bound is an error; an over-long upper bound simply clamps.
Halves, and the figure backwards.
bpm 90
meter 4
unit 1/4
key c4 maj
mode diatonic
Row ::= 1 2 3 4 5 6 7 '1
Row
Row[:4]
Row[4:]
Row[::-1]
running…edit it — it re-runs as you type
plays 24 notes in 4.00s — c4 d4 e4 f4 g4 a4 b4 c5 c4 d4 e4 f4 g4 a4 b4 c5 c5 b4 a4 g4 f4 e4 d4 c4
One call: the slice counts note-and-rest pairs, so [:8] is four notes.
bpm 90
meter 4
unit 1/4
key c4 maj
mode diatonic
Beat ::= $1 /2 - /2
Line ::= 1 2 3 4 5 6 7 '1
One ::= Beat(Line)
One
One[:8]
running…edit it — it re-runs as you type
plays 12 notes in 2.00s — c4 d4 e4 f4 g4 a4 b4 c5 c4 d4 e4 f4
Two calls: the slice counts the calls, so [:1] is the whole first one.
bpm 90
meter 4
unit 1/4
key c4 maj
mode diatonic
Beat ::= $1 /2 - /2
Two ::= Beat(1 2 3 4) Beat(5 6 7 '1)
Two
Two[:1]
running…edit it — it re-runs as you type
plays 12 notes in 2.00s — c4 d4 e4 f4 g4 a4 b4 c5 c4 d4 e4 f4