exprandi — Exponential distribution random number generator with interpolation (positive values only).
Exponential distribution random number generator with controlled interpolation between values (positive values only). This is an x-class noise generator.
ares exprandi klambda, xamp, xcps
ires exprandi klambda, xamp, xcps
kres exprandi klambda, xamp, xcps
klambda -- lambda parameter for the exponential distribution.
The probablity density function of an exponential distribution is an exponential curve, whose mean is 0.69515/lambda. 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.
xamp -- range over which random numbers are distributed.
xcps -- the frequency which new random numbers are generated.
Here is an example of the exprandi opcode. It uses the file exprandi.csd.
Example 237. Example of the exprandi opcode.
See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
<CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform -odac ;;;realtime audio out ;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o exprand.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> sr = 44100 ksmps = 32 nchnls = 2 0dbfs = 1 instr 1 klambda exprandi 20, 1, 3 printk2 klambda ; look aout oscili 0.8, 440+klambda, 1 ; & listen outs aout, aout endin </CsInstruments> <CsScore> ; sine wave f 1 0 16384 10 1 i 1 0 4 e </CsScore> </CsoundSynthesizer>