<info>
i is ex2-5
ECMC Csound Tutorial example ex2-5
</info>
<tk_interface>
</tk_interface>
<mono>
; this examples uses a STEREO orchestra
</mono>
<stereo>
;  #############################################################
;  soundfile ex2-5 : soundin 		Csound Tutorial
;  #############################################################

   ;  score p-fields:
   ;  p4 =  soundin.# number {source soundfile} , p6 = skip time
   ;  new amplitude envelope {p5, 7, 8 & 9} 
   ;     p5 = "peak" level multiplier
   ;     p7 = rise {fade-in} time
   ;     p8 = decay {fade-out} time
   ;     p9 = "steady-state" level  multiplier
   ;  moving stereo pan {p10 & p11} :
   ;     p10 =  number of left-right pans per note
   ;     p11 = function number for moving pans

instr 1
asig  soundin  p4, p6    ; read in the soundfile
   ; now apply a new envelope to these samples
kamp  expseg  .005 ,p7  , p5  , p3 - (p7 + p8) , p9 , p8 , .005; < amp. envelope
asig = asig * kamp
    ; supply a moving stereo pan between left & right channels
kpan oscili  1. ,  p10/p3 , p11    ; panning control signal
outs  kpan * asig , (1. - kpan) * asig 
endin
</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 32 1. 32 0 
f2 0 129 5 .01 64 1. 64 .01 
f3 0 1024 10 .5 
  i1 0.000 6.000 1 0.500 1.146 2.000 2.000 0.900 2.000 1
  i1 4.000 6.000 2 0.900 0.782 1.000 1.200 0.600 8.000 2
  i1 8.000 6.000 3 0.200 1.013 0.500 2.000 0.200 3.000 3
e
</score>
