struct imposes a new rhythmic grid on a pattern while mask only silences it where the mask is 0
struct(binary_pattern) replaces a pattern’s rhythmic structure with the given binary pattern — 1s trigger events (reusing the source values), 0s produce silence — separating pitch/timbre content from rhythm so the same melody can be re-rhythmized. mask(binary_pattern) instead returns silence wherever the mask is 0 or ~ while leaving the original rhythm intact elsewhere. The distinction: struct supplies a new grid; mask gates the existing one. Both accept Euclidean patterns, so struct("1(3,8)") is a compact way to impose a tresillo.
Examples
note(“c3 e3 g3 b3”).struct(“1 0 1 1 0 1 0 1”) // melody on a new grid note(“c3 e3 g3 b3”).mask(“1 ~ 1 1 ~ 1 ~ 1”) // original rhythm, gated note(“c3 e3 g3”).struct(“1(3,8)”) // Euclidean grid
Assessment
Apply a tresillo (3,8) to a 4-note melody with struct, then rewrite it with mask and explain how the two results differ.