1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
<info>
Simple band-pass filter.
Gain is post-balance.
Alexandre Burton , 1996
(rev.2/12/97 for 1.8)
</info>
<tk_interface>
cfilein source -label "Input Soundfile"
cpopup name -label "Filter type" -value "lowpass highpass bandpass"
ctoggle balance -label "balance output with input (pre-gain)"
cgraph center -label "frequency" -unit Hz -relation log -min 20 -max 15000 -init 1000
csepar
cslider reso -label "resonance" -unit x -min 1 -max 20 -init 2
csepar
cgraph gain -label "output\ngain" -unit x -rel log -min .1 -max 10 -init 1
</tk_interface>
<mono>
; mono passband filter
instr 1
gkcenter init 400
gkwidth init .3
kfac = [sinfo source sr]/sr
aing diskin "[source]", kfac, [offsource]
kband = cpsoct(octcps(gkcenter)+gkwidth/2) - cpsoct(octcps(gkcenter)-gkwidth/2)
if (gkbutterwrt == 1) igoto butter
afiltg reson aing, gkcenter, kband, 1
afiltg reson afiltg, gkcenter, kband, 1
goto bal
butter:
afiltg butterbp aing, gkcenter, kband
afiltg butterbp afiltg, gkcenter, kband
bal:
if (gkbalance == 0 ) goto nobal
afiltg balance afiltg, aing
nobal:
out afiltg*gkgain
endin
</mono>
<stereo>
; stereo passband filter
instr 1
igo = i(gk name)
kfac = [sinfo source sr]/sr
aing,aind diskin "[source]", kfac, [offsource]
alowg,ahig,abang svfilter aing, gkcenter, gireso,2
alowd,ahid,aband svfilter aind, gkcenter ,gireso ,2
if igo==1 goto hi
if igo==2 goto band
aoud = alowd
aoug = alowg
goto outer
hi:
aoud = ahid
aoug = ahig
goto outer
band:
aoud = aband
aoug = abang
outer:
if gkbalance == 0 goto nobal
aoud balance aoud,aind
aoug balance aoug,aing
nobal:
outs aoud*gkgain, aoug *gkgain
endin
</stereo>
<quad>
</quad>
<score>
#minimum
</score>
|