The Alternative Csound Reference Manual
Previous |  | Next

# noise

noise -- A white noise generator with an IIR lowpass filter.

## Description

A white noise generator with an IIR lowpass filter.

## Syntax

ar noise xamp, kbeta

## Initialization

ioffset -- the delay before the first impulse. If it is negative, the value is taken as the number of samples, otherwise it is in seconds. Default is zero.

## Performance

xamp -- amplitude of final output

kbeta -- beta of the lowpass filter. Should be in the range of 0 to 1.

The filter equation is:

y_n = sqrt(1-beta^2) * x_n + beta Y_(n-1)

where x_n is white noise.

## Examples

Here is an example of the noise opcode. It uses the files noise.orc and noise.sco.

Example 1. Example of the noise opcode.

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

    ; Instrument #1.
    instr 1
      kamp = 30000

      ; Change the beta value linearly from 0 to 1.
      kbeta line 0, p3, 1

      a1 noise kamp, kbeta
      out a1
    endin
    /* noise.orc */

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

## Credits

Author: John ffitch
University of Bath, Codemist. Ltd.
Bath, UK
December 2000

Example written by Kevin Conder.

New in Csound version 4.10

Previous | Home | Next
nlfilt | Up | noteoff