scramble

From TidalCycles userbase
Revision as of 22:53, 9 December 2018 by Yaxu (talk | contribs) (Yaxu moved page Scramble to scramble)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Type: scramble :: Int -> Pattern a -> Pattern a

scramble takes a number and a pattern as input, divides the pattern into the given number of parts, and returns a new pattern by randomly selecting from the parts. This could also be called "sampling with replacement". For example:

d1 $ sound $ scramble 3 "bd sn hh"

... will sometimes play "sn bd hh" or "hh sn bd", but can also play "bd sn bd" or "hh hh hh", because it can make any random combination of the three parts.

See also: shuffle