krange -- the range of the random numbers (-krange to +krange).
For more detailed explanation of these distributions, see:
C. Dodge - T.A. Jerse 1985. Computer music. Schirmer books. pp.265 - 286
D. Lorrain. A panoply of stochastic cannons. In C. Roads, ed. 1989. Music machine . Cambridge, Massachusetts: MIT press, pp. 351 - 379.
Here is an example of the trirand opcode. It uses the files trirand.orc and trirand.sco.
Example 15-1. Example of the trirand opcode.
/* trirand.orc */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1.
instr 1
; Generate a random number between -1 and 1.
; krange = 1
i1 trirand 1
print i1
endin
/* trirand.orc */
/* trirand.sco */
; Play Instrument #1 for one second.
i 1 0 1
e
/* trirand.sco */
instr 1: i1 = 7506.261