flatpat

From TidalCycles userbase
Jump to: navigation, search

Type: flatpat :: Pattern [a] -> Pattern a

flatpat takes a pattern of lists and flattens it into a pattern where all the events in each list happen simultaneously.

For example, the following code uses flatpat in combination with listToPat to create an alternating pattern of chords.

d1 $ n (flatpat $ listToPat [[0,4,7],[(-12),(-8),(-5)]]) # s "superpiano" # sustain 2

This code is equivalent to

d1 $ n ("[0,4,7] [-12,-8,-5]") # s "superpiano" # sustain 2