;Better global reverberator from Richard Karpen
;send in stereo signal on ga1 and ga2
;turn instr 99 on for duration of piece + reverb time
;p4=reverb time
;p5=reverb amplitude
;for example, score should include "i99 0 120 5 .75", where piece is 115 seconds long
;with 5 seconds of reverb time and reverberated signal is 75% of original.
;If you are using Netscape, use "View Source" to download as a textfile.  Delete html tags.

instr 99 ;accepts global outputs and adds reverb

irevfactor              = p4
ilowpass                = 9000
ioutputscale    = p5

idel1 = 1237.000/sr
idel2 = 1381.000/sr
idel3 = 1607.000/sr
idel4 = 1777.000/sr
idel5 = 1949.000/sr
idel6 = 2063.000/sr
idel7 = 307.000/sr
idel8 = 97.000/sr
idel9 = 71.000/sr
idel10 = 53.000/sr
idel11 = 47.000/sr
idel12 = 37.000/sr
idel13 = 31.000/sr

icsc1 = .822 * irevfactor
icsc2 = .802 * irevfactor
icsc3 = .773 * irevfactor
icsc4 = .753 * irevfactor
icsc5 = .753 * irevfactor
icsc6 = .753 * irevfactor

icsc7 = .7 * irevfactor


acomb1  comb    ga1, icsc1, idel1
acomb2  comb    ga1, icsc2, idel2
acomb3  comb    ga1, icsc3, idel3
acomb4  comb    ga1, icsc4, idel4
acomb5  comb    ga1, icsc5, idel5
acomb6  comb    ga1, icsc6, idel6

acomball = acomb1 + acomb2 + acomb3 + acomb4 + acomb5 + acomb6

allp1           alpass  acomball, icsc7, idel7
allp2           alpass  allp1, icsc7, idel8
allp3           alpass  allp2, icsc7, idel9
alow            tone            allp3, ilowpass
allp4           alpass  alow, icsc7, idel10
allp5           alpass  allp4, icsc7, idel12
arevout1        =  allp5 * ioutputscale



acomb1  comb    ga2, icsc1, idel1
acomb2  comb    ga2, icsc2, idel2
acomb3  comb    ga2, icsc3, idel3
acomb4  comb    ga2, icsc4, idel4
acomb5  comb    ga2, icsc5, idel5
acomb6  comb    ga2, icsc6, idel6

acomball = acomb1 + acomb2 + acomb3 + acomb4 + acomb5 + acomb6

allp1   alpass  acomball, icsc7, idel7
allp2           alpass  allp1, icsc7, idel8
allp3           alpass  allp2, icsc7, idel9
alow            tone            allp3, ilowpass
allp4           alpass  alow, icsc7, idel10
allp6           alpass  allp4,icsc7, idel13
arevout2        =  allp6 * ioutputscale

outs arevout1, arevout2


ga1 = 0
ga2 = 0
endin