hsc3-lang-0.11: Haskell SuperCollider Language

Sound.SC3.Lang.Random.IO

Description

getStdRandom based sclang random number functions.

Synopsis

Documentation

rand :: (Random n, Num n) => n -> IO nSource

SimpleNumber.rand is randomRIO in (0,n).

rand2 :: (Random n, Num n) => n -> IO nSource

SimpleNumber.rand2 is randomRIO in (-n,n).

nrand2 :: (Random a, Num a) => Int -> a -> IO [a]Source

Variant of rand2 generating k values.

rrand :: Random n => n -> n -> IO nSource

SimpleNumber.rrand is curry randomRIO.

nrrand :: (Random a, Num a) => Int -> a -> a -> IO [a]Source

Variant of rrand generating k values.

choose :: [a] -> IO aSource

SequenceableCollection.choose selects an element at random.

exprand :: (Floating n, Random n) => n -> n -> IO nSource

SimpleNumber.exprand generates exponentially distributed random number in the given interval.

coin :: (Random n, Fractional n, Ord n) => n -> IO BoolSource

SimpleNumber.coin is True at given probability, which is in range (0,1).

scramble :: [t] -> IO [t]Source

List.scramble shuffles the elements.

wchoose :: (Random a, Ord a, Fractional a) => [b] -> [a] -> IO bSource

SequenceableCollection.wchoose selects an element from a list given a list of weights which sum to 1.