The Alternative Csound Reference Manual
Previous |  | Next

# comb

comb -- Reverberates an input signal with a "colored" frequency response.

## Description

Reverberates an input signal with a "colored" frequency response.

## Syntax

ar comb asig, krvt, ilpt [, iskip] [, insmps]

## Initialization

ilpt -- loop time in seconds, which determines the "echo density" of the reverberation. This in turn characterizes the "color" of the comb filter whose frequency response curve will contain ilpt * sr/2 peaks spaced evenly between 0 and sr/2 (the Nyquist frequency). Loop time can be as large as available memory will permit. The space required for an n second loop is 4n*sr bytes. Delay space is allocated and returned as in delay.

iskip (optional, default=0) -- initial disposition of delay-loop data space (cf. reson). The default value is 0.

insmps (optional, default=0) -- delay amount, as a number of samples.

## Performance

krvt -- the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude).

This filter reiterates input with an echo density determined by loop time ilpt. The attenuation rate is independent and is determined by krvt, the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude). Output from a comb filter will appear only after ilpt seconds.

## Examples

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

Example 1. Example of the comb opcode.

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

    ; Initialize the audio mixer.
    gamix init 0

    ; Instrument #1.
    instr 1
      ; Generate a source signal.
      a1 oscili 30000, cpspch(p4), 1
      ; Output the direct sound.
      out a1

      ; Add the source signal to the audio mixer.
      gamix = gamix + a1
    endin

    ; Instrument #99 (highest instr number executed last)
    instr 99
      krvt = 1.5
      ilpt = 0.1

      ; Comb-filter the mixed signal.
      a99 comb gamix, krvt, ilpt
      ; Output the result.
      out a99

      ; Empty the mixer for the next pass.
      gamix = 0
    endin
    /* comb.orc */

    /* comb.sco */
    ; Table #1, a sine wave.
    f 1 0 128 10 1

    ; p4 = frequency (in a pitch-class)
    ; Play Instrument #1 for a tenth of a second, p4=7.00
    i 1 0 0.1 7.00
    ; Play Instrument #1 for a tenth of a second, p4=7.02
    i 1 1 0.1 7.02
    ; Play Instrument #1 for a tenth of a second, p4=7.04
    i 1 2 0.1 7.04
    ; Play Instrument #1 for a tenth of a second, p4=7.06
    i 1 3 0.1 7.06

    ; Make sure the comb-filter remains active.
    i 99 0 5
    e
    /* comb.sco */

## See Also

alpass, reverb, valpass, vcomb

## Credits

Author: William "Pete" Moss (vcomb and valpass)
University of Texas at Austin
Austin, Texas USA
January 2002

Example written by Kevin Conder.

Previous | Home | Next
cngoto | Up | control