inv

From TidalCycles userbase
Jump to: navigation, search

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"