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
chunkback
Like 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
Selects indices in in stacked notes.
note("<[c,eb,g]!2 [c,f,ab] [d,f,ab]>") .arp("0 [0,2] 1 [0,2]").slow(2)
arpWith π§ͺ
Selects indices in in stacked notes.
note("<[c,eb,g]!2 [c,f,ab] [d,f,ab]>") .arpWith(haps => haps[2])
struct
Applies the given structure to the pattern:
note("c3,eb3,g3") .struct("x ~ x ~ ~ x ~ x ~ ~ ~ x ~ x ~ ~") .slow(4)
mask
Returns silence when mask is 0 or "~"
note("c [eb,g] d [eb,g]").mask("<1 [0 1]>").slow(2)
reset
Resets the pattern to the start of the cycle for each onset of the reset pattern.
s("<bd lt> sd, hh*4").reset("<x@3 x(3,8)>")
restart
Restarts the pattern for each onset of the restart pattern. While reset will only reset the current cycle, restart will start from cycle 0.
s("<bd lt> sd, hh*4").restart("<x@3 x(3,8)>")
hush
Silences a pattern.
stack( s("bd").hush(), s("hh*3") )
invert
inv
Swaps 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.