Csound Csound-dev Csound-tekno Search About

Feedback Filter

Date1997-10-19 13:45
FromHans Mikelson
SubjectFeedback Filter
Hi all,

The post by Josep M* Comajuncosas inspired me to try something that had
been bouncing around in the back of my mind for a while.  This is a filter
with a waveguide for resonance. The feedback to the waveguide is bandpass
filtered and a compressor/limiter is used to keep things from blowing up.
One problem is that lower notes will require longer delay times.  It seems
to be doing a nice job at self-oscillating.  Perhaps this is more similar
to how an actual analog filter works.

Bye,
Hans Mikelson

;Feedback Filter Orchestra by Hans Mikelson

sr=44100
kr=22050
ksmps=2
nchnls=2

; Feedback Filter 1
instr 1

  idur    = p3
  iamp    = p4
  ifqc    = cpspch(p5)
  itab    = p6
  itabc   = p7
  ifeedbk = p8

  kdclick  linseg  0, .002, 1, idur-.004, 1, .002, 0
  kfco     linseg  500, .1*idur, 5000, .4*idur, 1000, .4*idur, 500,
.1*idur, 500

  asig  oscil kdclick, ifqc, itab
  afilt tone  asig, kfco

  afdbk    =        afilt/10                    ; Reduce original signal
  adeli    delayr   .2                          ; Feed back delay
  adel1    deltapi  1/kfco
  afilt2   butterbp    adel1, kfco, kfco/4      ; Filter the delayed signal
  kamprms  rms      afilt2                      ; Find rms level
  kampn    =        kamprms/6                   ; Normalize rms level 0-1.
  kcomp    tablei   kampn,itabc,1,0             ; Look up compression value
in table
           delayw   afdbk+kcomp*ifeedbk*afilt2  ; Add limited feedback
  aout     =        adel1*10*kdclick*iamp

  outs  aout, aout

endin

; Begin Score

f1 0 8192 10 1
f2 0 1024 7  1 512 1 0 -1 512 -1
f3 0 1024 7  1 1024 -1

; Compression Curve
f6 0 1025 7 1 128 .2 128 .15 256 .04 256 .02 257 .001

;  Sta  Dur  Amp   Pitch  Waveform  Compr  Feedbk
i1 0    .15   5000  7.00   2         6      1.2
i1 +    .15   5000  7.05   .         6      0.8
i1 .    .15   5000  6.07   .         6      1.1
i1 .    .15   5000  7.10   .         6      1.0
i1 .    .15   5000  8.05   .         6      0.9
i1 .    .15   5000  7.07   .         6      1.0
i1 .    .15   5000  7.10   .         6      1.1
i1 .    .15   5000  7.10   .         6      1.0
i1 .   1.2    5000  7.00   .         6      1.2