kmin -- minimum range limit
kmax -- maximum range limit
The random opcode is similar to linrand and trirand but sometimes I [Gabriel Maldonado] find it more convenient because allows the user to set arbitrary minimum and maximum values.
Here is an example of the random opcode. It uses the files random.orc and random.sco.
Example 318. Example of the random opcode.
/* random.orc */ ; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; Instrument #1. instr 1 ; Generate a random number between 220 and 440. kmin init 220 kmax init 440 k1 random kmin, kmax printks "k1 = %f\\n", 0.1, k1 endin /* random.orc */
/* random.sco */ ; Play Instrument #1 for one second. i 1 0 1 e /* random.sco */
Its output should include lines like:
k1 = 414.232056 k1 = 419.393402 k1 = 275.376373