NAME

makerandom - set up a periodic random-number generator for control purposes, using a pfield-handle connect to an Instrument parameter


SYNOPSIS

pfield-handle = makerandom("type", frequency, min, max[, seed])

Parameters inside the [brackets] are optional.


DESCRIPTION

makerandom returns a pfield-handle that will deliver data periodically from an internal RTcmix random-number generator. The period is determined by the frequency argument, and the random numbers will lie within the range set by the min and max arguments. The random-numbers will be generated according the the random-number distribution specified in the "type" string argument. These distributions are identical to the ones decribed in the maketable "random" table construction command. The optional seed argument allows the user to specify a particular seed value for the psuedorandom algorithm used by the random-number generator.

Many of the arguments for makerandom may themselves also be pfield-handles.


ARGUMENTS
type
This string value (i.e. enclosed in "double quotes" in the scorefile) determines the type of random-number distribution to use in generating the periodic values. The different types currently supported are:
frequency
The frequency (in Hz) determines the rate at which random values will be generetated through the pfield-handle This should be less than the reset rate.

min
max
These two arguments define the range of random values that will be produced by the random-number generator through the pfield-handle. min will set the minimum value of the range, and max will set the upper bound.

seed
This optional argument sets the 'seed' (or initial value) for the pseudorandom number algorithm used by RTcmix. Each seed value will generate a unique sequence of "random" numbers. If the seed argument is 0, then the 'seed' for the psuedorandom number algorithm comes from the microsecond system clock, otherwise the value of seed is used as the 'seed'. If no seed argument is present, the 'seed' used is 0 (i.e. the 'seed' will come from the system clock).


EXAMPLES
   pitch1 = makerandom("low", 10, 8.00, 8.11)
   pitch2 = makerandom("high", 15, 8.00, 8.11)
	wave = maketable("wave", 1000, 1.0, 0.2, 0.1)
	WAVETABLE(0, 4.9, 15000, pitch1, 0.0, wave)
	WAVETABLE(0, 4.9, 15000, pitch2, 1.0, wave)
This scorefile uses two random-number PField generators, one operating at 10 Hz (10 values/second) and the other at 15 Hz (15 values/second) to control the pitch of two WAVETABLE notes, one in the left channel and one in the right. The pitch (in octave.pitch-class notation) is coming directly from the random-number pfield-handles, pitch1 and pitch2. The range of these random-number generators is set to produce values within the octave 8.00 to 8.11 (middle "C" to the "B" above middle "C").


SEE ALSO

maketable, makeconnection, makeLFO, makefilter, makeconverter, makemonitor, irand, srand, trand, random, rand, pickrand, pickwrand, spray_init, get_spray,