### Hierarchy

- RNG

## Index

### Constructors

- constructor

### Methods

- exponential
- nextByte
- normal
- poisson
- random
- uniform

## Constructors

### constructor

- new RNG(seed: number): RNG

- - Defined in sound/rng.ts:91

  Create a new random number generator with optional seed. If the provided seed is a function (i.e. Math.random) it will be used as the uniform number generator.

  constructor

  #### Parameters

  - ##### seed: number

    An arbitrary object used to seed the generator.

  #### Returns RNG

## Methods

### exponential

- exponential(): number

- - Defined in sound/rng.ts:181

  Generates numbers using this.uniform().

  #### Returns number

  Number from the exponential distribution, lambda = 1.

### nextByte

- nextByte(): number

- - Defined in sound/rng.ts:127

  #### Returns number

  Uniform random number between 0 and 255.

### normal

- normal(): number

- - Defined in sound/rng.ts:164

  Generates numbers using this.uniform() with the Box-Muller transform.

  #### Returns number

  Normally-distributed random number of mean 0, variance 1.

### poisson

- poisson(mean: number): number

- - Defined in sound/rng.ts:190

  Generates numbers using this.uniform() and Knuth's method.

  #### Parameters

  - ##### mean: number

  #### Returns number

  Number from the Poisson distribution.

### random

- random(n: Optional<number>, m: Optional<number>): number

- - Defined in sound/rng.ts:150

  Produce a random integer within [n, m).

  #### Parameters

  - ##### n: Optional<number>

  - ##### m: Optional<number>

  #### Returns number

### uniform

- uniform(): number

- - Defined in sound/rng.ts:134

  #### Returns number

  Uniform random number between 0 and 1.

Generated using TypeDoc