resonx
Prev | Orchestra Opcodes and Operators | Next

## resonx

resonx — Emulates a stack of filters using the reson opcode.

## Description

resonx is equivalent to a filters consisting of more layers of reson with the same arguments, serially connected. Using a stack of a larger number of filters allows a sharper cutoff. They are faster than using a larger number instances in a Csound orchestra of the old opcodes, because only one initialization and k- cycle are needed at time and the audio loop falls entirely inside the cache memory of processor.

## Syntax

    ares resonx asig, xcf, xbw [, inumlayer] [, iscl] [, iskip]

## Initialization

inumlayer (optional) -- number of elements in the filter stack. Default value is 4.

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

asig -- input signal

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)

## Examples

Here is an example of the resonx opcodes. It uses the file resonx.csd.

Example 842. Example of the resonx opcodes.

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 resonx.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr 1	; unfiltered noise

    kenv	linseg	0, p3*.5, 1, p3*.5, 0	;envelope
    asig	rand	0.7			;white noise
    	outs	asig*kenv, asig*kenv

    endin

    instr 2	; filtered noise

    kenv	linseg	0, p3*.5, 1, p3*.5, 0	;envelope
    asig	rand	0.7
    kcf	line	300, p3, 2000
    afilt	resonx	asig, kcf, 300, 4
    asig	balance afilt, asig
    	outs	asig*kenv, asig*kenv

    endin
    </CsInstruments>
    <CsScore>

    i 1 0 2
    i 2 3 2

    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

atonex, tonex

## Credits

Author: Gabriel Maldonado (adapted by John ffitch)
Italy

New in Csound version 3.49

Audio rate parameters introduced in version 6.02

November 2013.

Prev | Up | Next
resonr | Home | resonxk