COMMENT  looping example {p10, p11 & p12} ; also new envelopes {p14-16}, time varying
COMMENT  timbral brightness {p17-20} and stereo spatial placement {p13}
* f1 0 0 -1 "/sflib/wind/hn.bf3.wav" 0 0 0 ; 
* f2 0 0 -1 "/sflib/gamelan/anklung.2.wav" 0 0 0 ; 
* f3 0 0 -1 "/sflib/x/voicetest.wav" 0 0 0 ; 
<   Score file for Library algorithm  ### tsamp ###
* f100 0 1024 10 1.;      < SINE WAVE for vibrato
* f50 0 65 7 0 64 1.;           < linear change from value 1 to value 2
* f52 0 65 7 0 32 1. 32 0;      < linear change from value 1 to val 2 to val 1
* f60 0 65 5 .01 64 1.;         < exponential change from value 1 to value 2
<* f62 0 65 5 .01 32 1. 32 .01;  < expo. change from value 1 to value 2 to val 1
*f57 0 64 7 0 31 0 1 1. 31 1. 1 0 ; < square wave for trill
         < f58 creates 3 note trill {above & below center pitch}
*f58 0 64 7 0 21 0 1 1. 20 1. 1 -1 20 -1 1 0 ; 

ifdef([DETUNE],,define([DETUNE],0))dnl
ifdef([START],,define([START],0.000))dnl
ampfac 1;
define(CHORUSLOOP,[

TSAMP START 0 3;
rd    
p3  nu 1.4/ 2. ;
du  nu 315/ 312/ 312 /;
  < p4 = TRANSPOSITION : integer = number of 1/2 steps up or (ig negative) down
 < fraction = microtonal divisions: Ex: -2.5 = down a whole step + a quarter tone
p4   < no pitch transpositions -- original pitch levels used
   < p5 = AMPLITUDE : (1) .001 - 10 = multplier for input soundfile amplitude
   <   (2) 11 - 32767  new integer amplitude value : Default = 1.
p5 nu .3/ .15/ .9;       
   < p6 = additional detuning {used mostly when chorusing scores} :
   <  1. = 1/2 step up, -1. = 1/2 step down : Default = 0
p6   DETUNE;
  < ----- INPUT SOUNDFILE function number {p7} & dur {p9}----
p7  nu 1/ 2/ 3;   < horn, anklung, voicetest
   < p8 not used
 < p9 { optional} =  duration of input soundfile to be used 
 < Default  = entire soundfile  ; has no effect if looping used {if p10 != 0}
p9 

< ------Sustain LOOPING  {p10 - 12} : ---------------------------------
  < p10 = loop mode: 0 = no looping, 1 = forward, 2 = forward & backward
p10  nu 1/ 1 / 2 ;                    
  < p11 = loop begin point, in samples
p11  nu 13843/ 13600 / 15281 ;
  < p12 = loop end point, in samples
p12  nu 53679 / 54850 / 33891;  

  < p13 = spatial placement for mono in, stereo out {nchnls = 2}
  < 0 = hard left, 1. = hard right
  < flag : options : 
  <  -1 : the lower the pitch, the further the placement to the left
  <  -2 : the lower the pitch, the further the placement to the right
  <  -3 : random initial placement followed by random moving pan
  <  -4 : random initial placement followed by quasi-periodic  moving pan
  < -5  : no action taken : user supplies own stereo processing of mono signal a1
p13  nu .05/ .95 / .5;    

  < ------- NEW AMPLITUDE ENVELOPE {p14 - p16} {optional} ------------
  <  if p14 + p15 = 0, no new envelope created
  < p14 = rise time { > 100 , or negative, = % p3} : Default = 0
p14  nu 2. / 2. / 0;    
   < p15 = decay time { > 100 , or negative, = % p3} : Default = .04
p15  nu 6. / 5. / 3. ;     
  < p16 = optional "atss" amplitude multiplier for end of note : Default = 1.
  < normal range = ca. .1 - .9 {diminuendo} or 1.1 - 2. {crescendo}
p16  nu .2/ 1.6 / .1;    

   < ----- BRIGHTNESS {p17-p20}  {optional} --------------------
 < p17 = opening brightness: Range = .001 {mellowest} - 2.{brightest} : Def. = 1.
p17  nu 1.6 / .2 / 1.5;     
   < p18 = closing brightness { same range as p17; Default  = p17 }
p18  nu .1 / 1.6 / .5 ;     
   < p19 = time between p17 & p18: 0 = p3, > 100 or negative = % p3 : Def. = p3
p19  nu  -.9/ -.6 / -.9;    
 < p20 = Center frequency for filters : pch or cps : Default = 261 herz
p20  nu  250/ 500 / 300;

  <  Added user p-fields: 
end;  <<< End of ### tsamp ### score >>>
])dnl
CHORUSLOOP
