Documentation · Naming

Name[a:b] Slices

A python slice over the ITEMS a reference plays: Row[:4], Row[2:], Row[::-1].

  • A step takes every nth item, and negative numbers count from the end.
  • 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.
  • A slice of a barred rule drops the bars.

Halves, and the figure backwards.

running…edit it and it re-runs as you type

c4 d4 e4 f4 g4 a4 b4 c5 c4 d4 e4 f4 g4 a4 b4 c5 c5 b4 a4 g4 f4 e4 d4 c4

Every other item, the last three, and all but the ends.

running…edit it and it re-runs as you type

c4 e4 g4 b4 a4 b4 c5 d4 e4 f4 g4 a4 b4

One call: the slice counts note-and-rest pairs, so [:8] is four notes.

running…edit it and it re-runs as you type

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.

running…edit it and it re-runs as you type

c4 d4 e4 f4 g4 a4 b4 c5 c4 d4 e4 f4