resonxk
Prev | Orchestra Opcodes and Operators | Next

## resonxk

resonxk — Control signal resonant filter stack.

## Description

resonxk is equivalent to a group of resonk filters, with the same arguments, serially connected. Using a stack of a larger number of filters allows a sharper cutoff.

## Syntax

    kres resonxk ksig, kcf, kbw[, inumlayer, iscl, istor]

## Initialization

inumlayer - number of elements of filter stack. Default value is 4. Maximum value is 10

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.

istor (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

kres - output signal

ksig - input signal

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

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

resonxk is a lot faster than using individual instances in Csound orchestra of the old opcodes, because only one initialization and 'k' cycle are needed at a time, and the audio loop falls enterely inside the cache memory of processor.

## Examples

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

Example 709. Example of the resonxk 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 resonxk.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    gisin ftgen 0, 0, 2^10, 10, 1

    instr 1

    ksig randomh  400, 1800, 150
    aout poscil   .2, 1000+ksig, gisin
         outs     aout, aout
    endin

    instr 2

    ksig randomh  400, 1800, 150
    kcf  line     1, p3, 1000		;vary high-pass
    ilay = p4
    ksig resonxk  ksig, kcf, 100, ilay
    aout poscil   .2, 1000+ksig, gisin
    asig interp   ksig			;convert k-rate to a-rate
    aout balance  asig, aout		;avoid getting asig out of range
         outs     aout, aout
    endin

    </CsInstruments>
    <CsScore>
    i 1 0  5
    i 2 6  5 1	;number of filter stack = 1
    i 2 12 5 5	;number of filter stack = 5
    e
    </CsScore>
    </CsoundSynthesizer>

## Credits

Written by Gabriel Maldonado.

New in Csound 5 (Previously available only on CsoundAV)

Prev | Up | Next
resonx | Home | resony