<info>
ESM Csound Library
instrument algorithm: sf   sco: sf2
Creates stuttering on the beginning of /sflib/x/voicetest.
Before running this job click on "mktutsflinks"
under te "Utilities" menu.

Allan Schindler  1/97
</info>
<tk_interface>


</tk_interface>
<mono>
; ### 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

;Standard out statement
out a1
endin
    
</mono>
<stereo>


</stereo>
<quad>


</quad>
<score>
; p4 points to soundin.12, which points to sflib/x/voicetest
  i39 0.000 0.307 12 0.100 0 0 0.020 0.222
  i39 0.500 0.307 12 0.214 0 0 0.020 0.625
  i39 0.958 0.307 12 0.329 0 0 0.020 0.687
  i39 1.378 0.307 12 0.444 0 0 0.020 0.089
  i39 1.764 0.307 12 0.559 0 0 0.020 0.850
  i39 2.117 0.307 12 0.671 0 0 0.020 0.599
  i39 2.440 0.307 12 0.782 0 0 0.020 0.676
  i39 2.737 0.307 12 0.889 0 0 0.020 0.151
  i39 3.009 0.307 12 0.946 0 0 0.020 0.309
  i39 3.260 0.307 12 0.848 0 0 0.020 0.700
  i39 3.549 0.307 12 0.741 0 0 0.020 0.223
  i39 3.882 0.307 12 0.626 0 0 0.020 0.907
  i39 4.264 0.307 12 0.502 0 0 0.020 0.278
  i39 4.703 0.307 12 0.372 0 0 0.020 0.187
  i39 5.209 0.307 12 0.236 0 0 0.020 0.660
  i39 5.790 0.307 12 0.096 0 0 0.020 0.563
e

</score>


