<info>
i is ex5-1
ECMC Csound Tutorial example ex5-1
</info>
<tk_interface>
</tk_interface>
<mono>
;  #############################################################
;  soundfile ex5-1    :  Tone               Eastman Csound Tutorial
;  #############################################################

; mono soundfile input:
; p4  = soundin. number 
; p5 = ampfac  ; p6 = skip from front of soundfile
; p7 = exponential fade in time ; p8 = exponential fade out time
; for low pass filtering of soundfiles
; p9 = 1st half-power point, p10 = 2nd h.p. point
; p11 = rate of change between p9 & p10, p12= func. for change

instr 39
isfnum = p4
idur = p3

a1 soundin isfnum,p6 

; amplitude envelope
iampfac  = (p5 =0?1:p5 )     
; fade-in & fade-out defaults & checks:
ip7  = (p7 =0?.001:p7 )
ip8  = (p8 =0?.001:p8 )
ip7 = (p7 < 0 ? abs(p7) * idur : ip7)
ip8 = (p8 < 0 ? abs(p8) * idur : ip8)
a3 expseg .01,ip7 ,iampfac,idur-(ip7 +ip8 ),iampfac,ip8 ,.01
a1 = a1*a3

; low pass filtering:
irate = (p11=0? 1/p3 : p11)
k1 oscili p10-p9,irate,p12
khp = k1 + p9     ; changing half-power point
a1 tone a1, khp
out a1

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

f1 0 65 7 0 64 1
f2 0 65 7 0 32 1. 32 0
f3 0 65 5 .01 32 1. 32 .01
  i39 0.000 3.000 5 0.900 0.500 1.000 1.000 100 3000 0 1
  i39 3.500 3.000 5 0.900 0.500 1.000 1.000 2000 150 0 2
  i39 7.000 3.000 5 0.900 0.500 1.000 1.000 2000 100 0.750 3
  i39 10.500 3.000 5 0.900 0.500 1.000 1.000 200 900 4.000 3
e
</score>
