home/ atoms/ tidal-while-binary-gate

TidalCycles `while` applies a function only when a binary pattern is true, gating transformations per cycle

In TidalCycles, while takes a binary pattern (a pattern of true/false, equivalently 1/0) and a function, and applies that function only where the binary pattern is true. A binary pattern is just a pattern whose values are booleans. Because the binary pattern is itself a Tidal pattern, it can be transformed: shifted, inverted, or made to follow its own sequence rules (e.g. <1 0> to act every other cycle). This lets a performer gate any transformation (fast 2, crush, …) rhythmically without duplicating pattern definitions. It contrasts with sometimes/rarely, which gate probabilistically; while gates deterministically from an explicit pattern.

Examples

d1 $ while "1 0" (# crush 4) $ s "amen"
-- crushes only on the first half of each cycle
d1 $ while "<1 0>" (fast 2) $ s "amen"
-- fast 2 on every other cycle

Assessment

Write a pattern that applies rev on the first third of each cycle using while; then describe what changes if you invert the binary pattern.

“while and then T which stands for true if I wanted I could also use a 1 here so this is what's called a binary pattern so a binary pattern is a pattern of things which either true or false”
corpus · alex-mclean-yaxu-eulerroom-equinox-2020-tidalcycles-set-talk · chunk 1