Conditional Modifiers
lastOf
Applies the given function every n cycles, starting from the last cycle.
- n (number): how many cycles
- func (function): function to apply
note("c3 d3 e3 g3").lastOf(4, x=>x.rev())firstOf
Applies the given function every n cycles, starting from the first cycle.
- n (number): how many cycles
- func (function): function to apply
note("c3 d3 e3 g3").firstOf(4, x=>x.rev())when
Applies the given function whenever the given pattern is in a true state.
- binary_pat (Pattern):
- func (function):
"c3 eb3 g3".when("<0 1>/2", x=>x.sub(5)).note()chunk
Divides a pattern into a given number of parts, then cycles through those parts in turn, applying the given function to each part in turn (one part per cycle).
"0 1 2 3".chunk(4, x=>x.add(7)).scale('A minor').note()chunkBack
chunkbackLike chunk, but cycles through the parts in reverse order. Known as chunk' in tidalcycles
"0 1 2 3".chunkBack(4, x=>x.add(7)).scale('A minor').note()arp
arpWith π§ͺ
struct
mask
reset
restart
hush
Silences a pattern.
stack(
s("bd").hush(),
s("hh*3")
)invert
invSwaps 1s and 0s in a binary pattern.
s("bd").struct("1 0 0 1 0 0 1 0".lastOf(4, invert))After Conditional Modifiers, letβs see what Accumulation Modifiers have to offer.