; ### Eastman Orchestra Library Instrument  r_e_v ###
instr revinst
ifelse(NCHNLS,1,[
; mono in and out ; global signal input is garevin11],[
; stereo output ; global input signals are garevin1 (left channel) and
; garevin2 (right channel)
])
; variable reverberation time (k1) :
; p4  = 1st reverb time  ; p5  = 2nd reverb time  
; p6  = rate of change btw p4  & p5 ;if 0 = 1/p3; if>100 = (p6 -100)/p3; 
;      if negative, = actual dur. in seconds
; p7  = function      p8  = starting phase
p6  = (p6 =0?1/p3:p6 )
p6  = (p6 >100?(p6 -100)/p3:p6 )
p6  = (p6 <0?1/abs(p6 ):p6 )
ip7 = (p7 = 0 ? 52 : p7)
k1 oscili p5 -p4 ,p6 ,ip7 ,p8 
k1 = k1+p4 

; decimal % sent to reverberator(s) (k2) :
; p9  = 1st decimal % signal sent to reverb unit  ; p10  = 2nd % 
; p11  = rate of change btw p9  & p10 ;if 0 = 1/p3;if>100 = (p11 -100)/p3
;   if negative, = actual dur. in seconds
; p12  = function         p13  = starting phase
p11  = (p11 =0?1/p3:p11 )
p11  = (p11 >100?(p11 -100)/p3:p11 )
p11  = (p11 <0? 1/abs(p11 ): p11 )
ip12 = (p12 = 0 ? 52 : p12)
k2 oscili p10 -p9 ,p11 , ip12 ,p13 
k2 = k2+p9 
a1 = garevin1               ; left channel or mono signal
a2 = (1-k2)*a1           ; % bypassing reverberator       
a1 = k2*a1               ; % sent to reverberator                       
a1 reverb a1,k1
a1 = a1+a2
garevin1 = 0
ifelse(NCHNLS,2,[
a3 = garevin2               ; right channel
a4 = (1-k2) *a3        ; % rc bypassing reverberator
a3 = k2 * a3          ; % rc sent to reverb
a3 reverb a3,k1
a2 = a3+a4
garevin2 = 0               
],[dnl])
