Use Non-Frames Version Previous Page Next Page
Signal Generators: Random (Noise) Generators

rand, randh, randi

  kr      rand       xamp[, iseed[, isize]]
  kr      randh      kamp, kcps[, iseed[, isize]]
  kr      randi      kamp, kcps[, iseed[, isize]]
  ar      rand       xamp[, iseed[, isize]]
  ar      randh      xamp, xcps[, iseed[, isize]]
  ar      randi      xamp, xcps[, iseed[, isize]]


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 value greater than 1 will be used directly, without scaling. A negative value will cause seed re-initialization to be skipped. 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

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

Use Non-Frames Version Previous Page Next Page
Signal Generators: Random (Noise) Generators