nreverb
Prev | Orchestra Opcodes and Operators | Next

## nreverb

nreverb — A reverberator consisting of 6 parallel comb-lowpass filters.

## Description

This is a reverberator consisting of 6 parallel comb-lowpass filters being fed into a series of 5 allpass filters. nreverb replaces reverb2 (version 3.48) and so both opcodes are identical.

## Syntax

    ares nreverb asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] \
          [, inumAlpas] [, ifnAlpas]

## Initialization

iskip (optional, default=0) -- Skip initialization if present and non-zero.

inumCombs (optional) -- number of filter constants in comb filter. If omitted, the values default to the nreverb constants. New in Csound version 4.09.

ifnCombs - function table with inumCombs comb filter time values, followed the same number of gain values. The ftable should not be rescaled (use negative fgen number). Positive time values are in seconds. The time values are converted internally into number of samples, then set to the next greater prime number. If the time is negative, it is interpreted directly as time in sample frames, and no processing is done (except negation). New in Csound version 4.09.

inumAlpas, ifnAlpas (optional) -- same as inumCombs/ifnCombs, for allpass filter. New in Csound 4.09.

## Performance

The input signal asig is reverberated for ktime seconds. The parameter khdif controls the high frequency diffusion amount. The values of khdif should be from 0 to 1. If khdif is set to 0 the all the frequencies decay with the same speed. If khdif is 1, high frequencies decay faster than lower ones. If ktime is inadvertently set to a non-positive number, ktime will be reset automatically to 0.01. (New in Csound version 4.07.)

As of Csound version 4.09, nreverb may read any number of comb and allpass filter from an ftable.

## Examples

Here is a simple example of the nreverb opcode. It uses the file nreverb.csd.

Example 391. Simple example of the nreverb 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    No messages
    -odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o nreverb.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    gaout init  0

    instr 1
    a1	oscil	15000, 440, 1
    	out	a1

    gaout = gaout+a1
    endin

    instr 99

    a2	nreverb	gaout, 2, .3
    	out	a2*.15		;volume of reverb

    gaout = 0
    endin

    </CsInstruments>
    <CsScore>

    ; Table 1: an ordinary sine wave.
    f 1 0 32768 10 1

    i 1 0 .5
    i 1 1 .5
    i 1 2 .5
    i 1 3 .5
    i 1 4 .5
    i 99 0 9
    e

    </CsScore>
    </CsoundSynthesizer>

Here is an example of the nreverb opcode using an ftable for filter constants. It uses the file nreverb_ftable.csd, and beats.wav.

Example 392. An example of the nreverb opcode using an ftable for filter constants.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    ; Audio out   Audio in    No messages
    -odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o nreverb_ftable.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr 1
      a1  soundin "beats.wav"
      a2  nreverb a1, 1.5, .75, 0, 8, 71, 4, 72
      out a1 + a2 * .4
    endin

    </CsInstruments>
    <CsScore>

    ; freeverb time constants, as direct (negative) sample, with arbitrary gains
    f71 0 16   -2  -1116 -1188 -1277 -1356 -1422 -1491 -1557 -1617  0.8  0.79  0.78  0.77  0.76  0.75  0.74  0.73

    f72 0 16   -2  -556 -441 -341 -225  0.7  0.72  0.74  0.76

    i1 0 3
    e

    </CsScore>
    </CsoundSynthesizer>

## Credits

Authors: Paris Smaragdis (reverb2)
MIT, Cambridge
1995

Author: Richard Karpen (nreverb)
Seattle, Wash
1998

Prev | Up | Next
notnum | Home | nrpn