**GEN** Routines: Random Functions

## GEN21

** f** # time size 21 type level [arg1 [arg2]]

### Description

This generates tables of different random distributions. (See also **x-class noise generators**.)

*time* and *size* are the usual GEN function arguments. *level* defines the amplitude. Note that GEN21 is not self-normalizing as are most other GEN functions. *type* defines the distribution to be used as follow:

- 1 = Uniform (positive numbers only)
- 2 = Linear (positive numbers only)
- 3 = Triangular (positive and negative numbers)
- 4 = Exponential (positive numbers only)
- 5 = Biexponential (positive and negative numbers)
- 6 = Gaussian (positive and negative numbers)
- 7 = Cauchy (positive and negative numbers)
- 8 = Positive Cauchy (positive numbers only)
- 9 = Beta (positive numbers only)
- 10 = Weibull (positive numbers only)
- 11 = Poisson (positive numbers only)

Of all these cases only 9 (Beta) and 10 (Weibull) need extra arguments. Beta needs two arguments and Weibull one.

### Examples

**f**1 0 1024 21 1 ; Uniform (white noise)
**f**1 0 1024 21 6 ; Gaussian
**f**1 0 1024 21 9 1 1 2 ; Beta (note that level precedes arguments)
**f**1 0 1024 21 10 1 2 ; Weibull

All of the above additions were designed by the author between May and December 1994, under the supervision of Dr. Richard Boulanger.

### Authors

Paris Smaragdis

MIT, Cambridge

1995

John ffitch

University of Bath/Codemist Ltd.

Bath, UK

New in Csound version 3.2

**GEN** Routines: Random Functions