home/ atoms/ tidal-const-pattern-replace

const replaces the entire playing pattern with another one

const q p ignores pattern p and plays pattern q instead — it substitutes the whole pattern rather than transforming it (it relies on the Haskell const, which returns its first argument and discards the second). On its own it just discards the original, so it is only useful when paired with a conditional. Combined with every (or the modulo-window whenmod), it becomes the idiomatic fill/break tool: it runs the main groove most cycles then swaps in a completely different phrase on the scheduled cycles. This is how you drop a break, insert a fill, or hand a channel to an unrelated phrase for one cycle in a live set. It differs from transforms like fast or rev, which reshape the existing pattern; const throws it away and plays something else.

Examples

d1 $ const (sound "arpy*3") $ sound "bd sn cp hh"   -- replaces entirely, all the time
d1 $ every 3 (const $ sound "arpy*3") $ sound "bd sn cp hh"  -- fill on every 3rd cycle
d1 $ every 12 (const $ sound "bd*4 sn*2") $ sound "bd sn bass2 sn"  -- fill every 12th cycle

Assessment

Explain why const must be paired with something like every to work as a fill. Write a line that drops in a drum fill on every 8th cycle using const and every, and explain how the result differs from every 8 (fast 2).

“`const` can be used to completely replace a playing pattern with another one”
corpus · tidalcycles-alteration-reference-ply-chunk-linger-snowball-s · chunk 3
“You can use the const function to completely replace a playing pattern.”
corpus · tidalcycles-userbase-tutorial-community-function-by-function · chunk 8