exprand
Prev | Orchestra Opcodes and Operators | Next

## exprand

exprand — Exponential distribution random number generator (positive values only).

## Description

Exponential distribution random number generator (positive values only). This is an x-class noise generator.

## Syntax

    ares exprand klambda

    ires exprand klambda

    kres exprand klambda

## Performance

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:

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.

## Examples

Here is an example of the exprand opcode. It uses the file exprand.csd.

Example 143. Example of the exprand 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
    ; Audio out   Audio in
    -odac           -iadc    ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o exprand.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    ; Instrument #1.
    instr 1
      ; Generate a random between 0 and 1.
      ; krange = 1

      i1 exprand 1

      print i1
    endin

    </CsInstruments>
    <CsScore>

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

    </CsScore>
    </CsoundSynthesizer>

Its output should include a line like this:

    instr 1:  i1 = 0.174

## See Also

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

## Credits

Author: Paris Smaragdis
MIT, Cambridge
1995

Example written by Kevin Conder.

Prev | Up | Next
expon | Home | expseg