choice(list)
list → anyOne element picked at random. Re-rolled on every eval.
Building and reshaping lists — of notes, of steps, of anything else.
One element picked at random. Re-rolled on every eval.
Dot a written note value: q.dot is a dotted quarter,
a quarter and an eighth.
dots defaults to 1; q.dot(2) is the doubly-dotted quarter.
Can be chained as well q.dot.dot.
Filter a list based on the predicate.
The number of elements in the list.
Marks numbers as one value rather than a sequence. A lane is read by note — the
nth note takes the nth value, wrapping — so div: [2, 3] gives the first note 2
and the second 3, where div: list(2, 3) gives every note both. '[2, 3] is the
same value written short. Only a lane reads one.
fn poly(n, div = [4]) = for d in div { saw(n * d) * 0.3 }
play([110, 165], poly, div: list(2, 3))
The quote spelling is the one to reach for inside a lane that is already bracket-heavy:
play([110, 165], poly, div: ['[2, 3], '[4], `])
Apply a function to every element: riff.map(up).
The list followed by its mirror: [a, b, c] becomes [a, b, c, c, b, a].
A new list without its last element.
A new list with value appended.
Reverse a list
Rotate left, wrapping.
amount defaults to 1; a negative amount rotates right.
Rotate right, wrapping.
amount defaults to 1; a negative amount rotates left.
The list shuffled. Re-rolled on every eval.
The list sorted ascending.
Break the list into chunks of size.
Creates patterns that sound at once instead of in turn: stack([c4;2, e4;2], [g4;4]).
Each argument keeps its own division, so the layers need not agree on a rhythm.
Creates chords and polyphony.
Add every element together.
Weighted random choice The two lists run in parallel; weights must be finite and >= 0.
Pair elements positionally: zip([1, 2], [3, 4]) is [[1, 3], [2, 4]].
Every argument must be a list and all must be the same length.
19names in Lists. All categories.