tonex — Emulates a stack of filters using the tone opcode.


tonex is equivalent to a filter consisting of more layers of tone 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.


ares tonex  asig, khp [, inumlayer] [, iskip]
ares tonex  asig, ahp [, inumlayer] [, iskip]


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

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.


asig -- input signal

khp/ahp -- the response curve's half-power point. Half power is defined as peak power / root 2.


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

Example 1134. Example of the tonex opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; 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 tonex.wav -W ;;; for file output any platform

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

instr 1

asig diskin2 "drumsMlp.wav", 1
     outs asig, asig

instr 2

kton line 10000, p3, 0		;all the way down to 0 Hz
asig diskin2 "drumsMlp.wav", 1
asig tonex asig, kton, 8	;8 filters
     outs asig, asig

i 1 0 2
i 2 3 2


See also

Standard filters: Low-pass filters


Author: Gabriel Maldonado (adapted by John ffitch)

New in Csound version 3.49

Audio rate parameters introduced in version 6.02

October 2013.