bexprnd — Exponential distribution random number generator.


Exponential distribution random number generator. This is an x-class noise generator.


ares bexprnd krange
ires bexprnd krange
kres bexprnd krange


krange -- the range of the random numbers (-krange to +krange)

For more detailed explanation of these distributions, see:

  1. C. Dodge - T.A. Jerse 1985. Computer music. Schirmer books. pp.265 - 286

  2. 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 bexprnd opcode. It uses the file bexprnd.csd.

Example 49. Example of the bexprnd opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o bexprnd.wav -W ;;; for file output any platform

; 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 bexprnd 1

  print i1


; Play Instrument #1 for one second.
i 1 0 1


Its output should include a line like:

instr 1:  i1 = 1.141

See Also

seed, betarand, cauchy, exprand, gauss, linrand, pcauchy, poisson, trirand, unirand, weibull


Author: Paris Smaragdis
MIT, Cambridge

Example written by Kevin Conder.