TidalCycles ascii, binary, and binaryN turn strings or integers into boolean rhythm patterns via their binary representation
Boolean patterns (t/f) that drive struct and mask can be generated from data. ascii str converts each character of str to its 8-bit binary representation and reads the bits as a boolean pattern: ascii "x y" yields "f t t t t f f f f t t t t f f t". binary n converts an integer to an 8-bit boolean pattern (binary 2946 → the bits of 10000010), and binaryN digits n lets you set the bit-width (binaryN 12 2946). This encodes rhythms as numbers, so a single integer names a whole 8- or 16-step groove — handy for compact storage, algorithmic generation, and sweeping through rhythms by incrementing a value.
Examples
d1 $ struct (ascii "x y") $ s "hh"
d1 $ struct (binary 2946) $ s "hh" -- 8-bit: t f f f f f t f
d1 $ struct (binaryN 12 2946) $ s "hh" -- 12-bit width
Assessment
What boolean pattern does binary 2946 produce and why? How does binaryN 12 change the output? Describe a musical use for sweeping binary across a range of integers.