The Alternative Csound Reference Manual
Previous |  | Next

# weibull

weibull -- Weibull distribution random number generator (positive values only).

## Description

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

## Syntax

ar weibull ksigma, ktau

ir weibull ksigma, ktau

kr weibull ksigma, ktau

## Performance

ksigma -- scales the spread of the distribution.

ktau -- if greater than one, numbers near ksigma are favored. If smaller than one, small values are favored. If t equals 1, the distribution is exponential. Outputs only positive numbers.

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 weibull opcode. It uses the files weibull.orc and weibull.sco.

Example 1. Example of the weibull opcode.

    /* weibull.orc */
    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    ; Instrument #1.
    instr 1
      ; Generate a random number in a Weibull distribution.
      ; ksigma = 1
      ; ktau = 1

      i1 weibull 1, 1

      print i1
    endin
    /* weibull.orc */

    /* weibull.sco */
    ; Play Instrument #1 for one second.
    i 1 0 1
    e
    /* weibull.sco */

Its output should include lines like this:

    instr 1:  i1 = 1.834

## See Also

betarand, bexprnd, cauchy, exprand, gauss, linrand, pcauchy, poisson, trirand, unirand

## Credits

Author: Paris Smaragdis
MIT, Cambridge
1995

Example written by Kevin Conder.

Previous | Home | Next
waveset | Up | wgbow