Rand

A random monad parameterized by the type g of the generator to carry. The return function leaves the generator unchanged, while >>= uses the final generator of the first computation as the initial generator of the second.
The GRand struct is an opaque data structure. It should only be accessed through the g_rand_* functions.
Memory-managed wrapper type.
pseudorandom matrix with uniform elements between 0 and 1
rand is an oscillator that generates a continuous pattern of (pseudo-)random numbers between 0 and 1. For example, to randomly pan around the stereo field:
d1 $ sound "bd*8" # pan rand
Or to enjoy a randomised speed from 0.5 to 1.5, add 0.5 to it:
d1 $ sound "arpy*4" # speed (rand + 0.5)
To make the snares randomly loud and quiet:
sound "sn sn ~ sn" # gain rand
Numbers coming from this pattern are 'seeded' by time. So if you reset time (using resetCycles, setCycle, or cps) the random pattern will emit the exact same _random_ numbers again. In cases where you need two different random patterns, you can shift one of them around to change the time from which the _random_ pattern is read, note the difference:
jux (# gain rand) $ sound "sn sn ~ sn" # gain rand
and with the juxed version shifted backwards for 1024 cycles:
jux (# ((1024 <~) $ gain rand)) $ sound "sn sn ~ sn" # gain rand
pseudorandom matrix with uniform elements between 0 and 1
Random seed used for generation of the test data
This library deals with the common task of pseudo-random number generation.
The class of types for which random values can be generated. Most instances of Random will produce values that are uniformly distributed on the full range, but for those types without a well-defined "full range" some sensible default subrange will be selected. Random exists primarily for backwards compatibility with version 1.1 of this library. In new code, use the better specified Uniform and UniformRange instead.
RandomGen is an interface to pure pseudo-random number generators. StdGen is the standard RandomGen instance provided by this library.
Deprecated: In favor of FrozenGen
This module is provided for backwards compatibility, and simply re-exports Control.Monad.Random.Lazy.
A random transformer monad parameterized by:
  • g - The generator.
  • m - The inner monad.
The return function leaves the generator unchanged, while >>= uses the final generator of the first computation as the initial generator of the second.
The class of types for which random values can be generated. Most instances of Random will produce values that are uniformly distributed on the full range, but for those types without a well-defined "full range" some sensible default subrange will be selected. Random exists primarily for backwards compatibility with version 1.1 of this library. In new code, use the better specified Uniform and UniformRange instead.
RandomGen is an interface to pure pseudo-random number generators. StdGen is the standard RandomGen instance provided by this library.
Random monads, passing a random number generator through a computation. This version is lazy; for a strict version, see Control.Monad.Trans.Random.Strict, which has the same interface.
A proxy that carries information about the type of generator to use with RandT monad and its StatefulGen instance.