<info>
i is ex5-8
ECMC Csound Tutorial example ex5-8
</info>
<tk_interface>
</tk_interface>
<mono>
   ;  #############################################################
;  soundfile ex5-8    :  Alpass filter  (same score as ex5-7)
;  #############################################################
; ### Eastman Orchestra Library Instrument  s_f ###
; mono soundfile input:

instr 39

; functions : optional : 98 (soundin. numbers) & 99 (durations)
; p4  = soundin. number or, if negative, index pointer to funcs. 98 & 99
; p5 = ampfac  ; p6 = skip from front of soundfile
; p7 = exponential fade in time ; p8 = exponential fade out time
isfnum init p4
idur init p3
if p4 > 0 goto gotit
	isfnum table abs(p4),98
	idur table abs(p4),99
 ; to prevent hangs, when true dur. is slightly < than dur. provided by sndinfo
          idur = idur - .005
	timout 0,idur,gotit
   	turnoff   ;shut down when duration in table 99 is reached
gotit:

a1 soundin isfnum,p6 

iampfac  = (p5 =0?1:p5 )     
; fade-in & fade-out defaults & checks:
	ip7  = (p7 =0?.001:p7 )
	ip8  = (p8 =0?.001:p8 )
	ip7  = (p7 >100? (p7 -100) * idur : ip7 )
	ip8  = (p8 >100? (p8 -100) * idur : ip8 )
        ip7 = (p7 < 0 ? abs(p7) * idur : ip7)
        ip8 = (p8 < 0 ? abs(p8) * idur : ip8)
	ifades = ip7 + ip8
	if ifades < idur goto noproblem
	print idur, ifades
noproblem:
a3 expseg .01,ip7 ,iampfac,idur-(ip7 +ip8 ),iampfac,ip8 ,.01
a1 = a1*a3

;Added users code ; ### alpass filter added to output of Library instrument s_f
 a2 alpass a1,p9,p10  
out a2
endin



</mono>
<stereo>
</stereo>
<score>

                  SCORE-11, Version 1.4
Copyright (C) 1982, 1990, 1992, 1995 by Alexander R. Brinkman
     Eastman School of Music, University of Rochester

  i39 0.000 1.900 16 0.500 0 0 0.050 0 0.002
  i39 2.000 1.900 16 0.500 0 0 0.050 0.100 0.002
  i39 4.000 1.900 16 0.500 0 0 0.050 0.250 0.002
  i39 6.000 1.900 16 0.500 0 0 0.050 0.700 0.002
  i39 8.000 1.900 16 0.500 0 0 0.050 0.300 0.005
  i39 10.000 1.900 16 0.500 0 0 0.050 0.300 0.017
  i39 12.000 1.900 16 0.500 0 0 0.050 0.300 0.033
e
</score>
