From TidalCycles userbase
Revision as of 03:10, 26 November 2018 by Echophon (talk | contribs) (Created page with "{{DISPLAYTITLE:rand}} Type: <syntaxhighlight lang="haskell" inline>rand :: Fractional a => Pattern a </syntaxhighlight> '''rand''' generates a pattern of...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Type: rand :: Fractional a => Pattern a

rand generates a pattern of (pseudo-)random, floating point numbers between 0 and 1. For example to randomly pan around the stereo field you can:

d1 $ sound "bd*8" # pan rand

Or to enjoy a randomised speed from 0.5 to 1.5, you can add 0.5 to it.

d1 $ sound "arpy*4" # speed (rand + 0.5)


Type: irand :: Num a => Int -> Pattern a

irand is similar to rand, but generates a pattern of (pseudo-)random integers between 0 to n-1 inclusive. Notably used to pick random samples from a folder.

d1 $ sound "amencutup*8" # n (irand 8)