Signal Generators: Random (Noise) Generators

## rand, randh, randi

```
kr      rand       xamp[, iseed[, isize[, koffset]]]

kr      randh      kamp, kcps[, iseed[, isize[, koffset]]]

kr      randi      kamp, kcps[, iseed[, isize][, koffset]]]

ar      rand       xamp[, iseed[, isize[, koffset]]]

ar      randh      xamp, xcps[, iseed[, isize[, koffset]]]

ar      randi      xamp, xcps[, iseed[, isize[, koffset]]]

```

### Description

Output is a controlled random number series between +amp and -amp

### Initialization

iseed (optional) – seed value for the recursive pseudo-random formula. A value between 0 and +1 will produce an initial output of kamp * iseed. A negative value will cause seed re-initialization to be skipped. A value greater than 1 will obtain the seed value from the system clock. (New in Csound Version 4.16.) The default seed value is .5.

isize – if zero, a 16 bit number is generated. If non-zero, a 31-bit random number is generated. Default is 0.

### Performance

koffset (optional) – a base value added to the random result. New in Csound version 4.03.

The internal pseudo-random formula produces values which are uniformly distributed over the range kamp to -kamp. rand will thus generate uniform white noise with an R.M.S value of kamp / root 2.

The remaining units produce band-limited noise: the kcps and xcps parameters permit the user to specify that new random numbers are to be generated at a rate less than the sampling or control frequencies. randh will hold each new number for the period of the specified cycle; randi will produce straight-line interpolation between each new number and the next.

### Example

```   i1   =      octpch(p5) ; center pitch, to be modified

k1   randh  1,10       ;10 time/sec by random displacements up to 1 octave

a1   oscil  5000, cpsoct(i1+k1), 1```

Signal Generators: Random (Noise) Generators