 < This score illustrates the use of score11 "sets" and "move" keywords to
 < create 4 groups of output grains, each lasting 3 seconds.
 < "Sets", changing every 3 seconds, are applied to skip times {p8} and to
 < pitch transposition {p9}. The output is stereo, and the pan locations
 < of the grains also changes every 3 seconds {p10}.
 < In p3 we specify that 10 % of the grains have a comparatively long duration
 < {between .1 and .2 seconds}, producing "hesitation" rhythms.
 < The output is stereo

*f1 0 524288 -1 "/sflib/x/voicetest.wav" 0 0 0;  

instr gran 0 12;   < read in soundfile grains for 12 beats {12 seconds}
p3  .9 .02 .04  .1 .1 .2;   < 10 % of the grains have "long" duration
  < duty factor:  determines overlap of grains
  < normal range is between 100.02 and 100.2 {producing .02-.2 second overlaps}
du  mx 12. 100.03 100.04 100.3; < increase grain overlap at very end
   < p4 cross-fade time for both fade-in & fade-out ;
   <   p4  normally = c. 1/2 duty factor fraction { 1/2 the grain overlap time}
p4  mx 12. .02 .03 .2;  < increase fade times near end, as duty factor increases

   < p5 = output amplitude : raw amp {10.1-32767} or multiplier {.001 - 10.}
       < default 0 = same amplitude as input soundfile
am .75;  < reduce all amps : original p5 amps below resulted in clipping
p5  mx .5 1000 25000/ 10.5 25000 15000/ 1. 15000 1000;

   < p6 = gen1 function number
p6  1;    < gen1 function for "voicetest"
   < p7 = length of soundfile to be used, in seconds {duration} OR # of samples
p7  7.269;   < duration of "voicetest" 

   < p8 = skip time into gen1 func : if positive p8  = skip time in seconds
      < if negative {between -.001 and -.999}, p8 = % of soundfile skipped
 < Sets of skip times are used. Within each 3" of the output soundfile, all of
 < the grains begin at one of the times within the set, producing repetitions.
p8  se 3. .01 .4 .8 1.2/  3.  1.6 2. 2.4 2.8 /
   3.  3.2 3.6 4. 4.4 / 3. 4.8 5.2 5.6 6.0 6.6;

   < p9 = pitch multiplier {default 0 = no pitch change}
 < p9 creates 4 sets, each with 3  pitch tranpositions with ratios that outline
 < major triads in different registers
p9  se 3.  2. 1.682 1.334/ 3.  .787 .84 1.06 /
       3. .943 1.189 1.414 / 3.  .595  .749  .891;

   < for stereo output only p10 = pan location {1. = hard left, 0 = hard right}
p10 mo 3..01 .25 .01 .25/ 3. .75 .5 .75 .5/ 3. .5 .25 .25 .5/3. .99 .75 .99 .75;
 <     hard right       / left center    /  right center    /  hard left
  <  Added user p-fields: 
end;  <<< End of ### granvoice2 ### example score >>>
