René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

tone (Csound opcode)

A first-order recursive low pass filter with variable frequency response.
ar tone asig, khp [, iskip]
sr     = 44100
kr     = 4410
nchnls = 2

instr 1
  ilen =       p3
  iamp =       p4

  kenv   linseg 0, 0.02, 1, ilen-0.02-0.05, 1, 0.05, 0

  ifrq = cpspch(p5)

  ifrq_t = cpspch(8.00) 


  a_osc   oscil iamp*kenv, ifrq, 1

  a_sig tone a_osc, ifrq_t

  out  a_sig, a_osc
endin
f1 0 2048 10 1

i1 0.00 0.25 30000 5.00
i1  +   0.25 30000 5.02
i1  +   0.25 30000 5.04
i1  +   0.25 30000 5.05
i1  +   0.25 30000 5.07
i1  +   0.25 30000 5.09
i1  +   0.25 30000 5.11

i1  +   0.25 30000 6.00
i1  +   0.25 30000 6.02
i1  +   0.25 30000 6.04
i1  +   0.25 30000 6.05
i1  +   0.25 30000 6.07
i1  +   0.25 30000 6.09
i1  +   0.25 30000 6.11

i1  +   0.25 30000 7.00
i1  +   0.25 30000 7.02
i1  +   0.25 30000 7.04
i1  +   0.25 30000 7.05
i1  +   0.25 30000 7.07
i1  +   0.25 30000 7.09
i1  +   0.25 30000 7.11

i1  +   0.25 30000 8.00
i1  +   0.25 30000 8.02
i1  +   0.25 30000 8.04
i1  +   0.25 30000 8.05
i1  +   0.25 30000 8.07
i1  +   0.25 30000 8.09
i1  +   0.25 30000 8.11
This produces the following output. The channel that has the signal go through tone is attenuated with higher frequencies while the other channel is not:
/csound/opcodes/tone.jpg

Instruments

This opcode is used for the following instruments: