inv
From TidalCycles userbase
Revision as of 18:57, 24 December 2020 by Left adjoint (talk | contribs) (creating inv and linking to struct)
Type: inv :: Functor f => f Bool -> f Bool
inv inverts a collection of Boolean values, such as Pattern Bool
, thus turning True
into False
and visa-versa.
This is particularly useful when using functions such as struct that use a pattern of Booleans to control another pattern.
The following example gives a bass drum and a hi-hat on alternate beats by using inv
along with struct
let pat = "[t f]*4"
d1 $ struct pat $ s "bd"
d2 $ struct (inv pat) $ s "hh27"