Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Latest commit

 

History

History
19 lines (15 loc) · 557 Bytes

File metadata and controls

19 lines (15 loc) · 557 Bytes
title category
scramble
pattern_transformers
scramble :: Int -> Pattern a -> Pattern a

scramble n p divides the pattern p into n equal parts, and then creates a new pattern each cycle by randomly selecting from the parts. This could also be called "sampling with replacement". For example,

d1 $ sound $ scramble 3 "bd sn hh"

{: .render }

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.