reson
Prev | Orchestra Opcodes and Operators | Next

## reson

reson — A second-order resonant filter.

## Description

A second-order resonant filter.

## Syntax

    ares reson asig, xcf, xbw [, iscl] [, iskip]

## Initialization

iscl (optional, default=0) -- coded scaling factor for resonators. A value of 1 signifies a peak response factor of 1, i.e. all frequencies other than kcf are attenuated in accordance with the (normalized) response curve. A value of 2 raises the response factor so that its overall RMS value equals 1. (This intended equalization of input and output power assumes all frequencies are physically present; hence it is most applicable to white noise.) A zero value signifies no scaling of the signal, leaving that to some later adjustment (see balance). The default value is 0.

iskip (optional, default=0) -- initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.

## Performance

ares -- the output signal at audio rate.

asig -- the input signal at audio rate.

xcf -- the center frequency of the filter, or frequency position of the peak response.

xbw -- bandwidth of the filter (the Hz difference between the upper and lower half-power points).

reson is a second-order filter in which kcf controls the center frequency, or frequency position of the peak response, and kbw controls its bandwidth (the frequency difference between the upper and lower half-power points).

## Examples

Here is an example of the reson opcode. It uses the file reson.csd.

Example 894. Example of the reson 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
    -odac   ;;;realtime audio out
    ;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
    ; For Non-realtime ouput leave only the line below:
    ; -o reson.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    0dbfs  = 1
    nchnls = 2

    instr 1

    asaw vco2 .2, 220	;sawtooth
    kcf  line 220, p3, 1760	;vary cut-off frequency from 220 to 1280 Hz
    kbw  = p4		;vary bandwidth of filter too
    ares reson asaw, kcf, kbw
    asig balance ares, asaw
         outs asig, asig

    endin
    </CsInstruments>
    <CsScore>

    i 1 0 4 10	;bandwidth of filter = 10 Hz
    i 1 + 4 50	;50 Hz and
    i 1 + 4 200	;200 Hz
    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

areson, aresonk, atone, atonek, port, portk, resonk, tone, tonek

## Credits

Audio rate parameters introduced in version 6.02

November 2013.

Prev | Up | Next
reshapearray | Home | resonbnk