TidalCycles sew switches between two patterns using a boolean pattern for structure; stitch uses the boolean's own structure rather than the source patterns'
sew boolPat p1 p2 uses boolPat to choose between p1 (where true) and p2 (where false). The resulting structure comes from the source patterns p1 and p2. stitch boolPat p1 p2 also switches between two values using a boolean pattern, but the resulting event structure comes from the boolean pattern itself, not from the value patterns — enabling rhythm and content to be controlled independently. Example: stitch "t(7,16)" 127 0 sends CC value 127 on a Euclidean 7/16 rhythm and 0 elsewhere, with the Euclidean pattern defining when events occur. Both functions accept Euclidean syntax in the boolean pattern.
Examples
d1 $ sound (sew "t f" "bd*8" "cp*8") -- bd first half, cp second
d1 $ sew "t <f t> <f [f t] t>" (n "0 .. 15" # s "future") (s "cp:3*16" # speed saw + 1.2)
d1 $ ccv (stitch "t(7,16)" 127 0) # ccn 0 # "midi"
Assessment
Explain the structural difference between sew and stitch using a concrete example. When would you use sew to A/B two patterns? How does stitch "t(5,8)" 127 0 differ from euclid 5 8 $ ccv 127 # ccn 0?