 < Tiny grains from random points within a source flute soundfile are read in at
 < a VERY rapid rate {p3}. In p9 we create wedge-like textural pitch movement,
 < beginning with a "unison" onthe original pitch, spreading to a "cluster" or
 < rapid "tremolo" covering the interval of a major third, decreasing to another
 < unison a major second below the original pitch, then spreading to a very wide
 < {one octave} cluster, then narrowing to a tone a fifth above the original
 < pitch.

*f1 0 262144 -1 "/sflib/wind/fl.e4.wav"  0 0 0;  < source soundfile

instr gran 0 18;  < produce grains for 18 seconds
p3   .01;   < produce a new grain every 10 milliseconds
  < duty factor:  determines overlap of grains
  < normal range is between 100.02 and 100.2 {producing .02-.2 second overlaps}
  < overlap grains by 30 milliseconds {each grain lasts 40 milliseconds}
du 100.03;
   < 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  .01;  < fade-ins & fade-outs last 10 milliseconds each

   < p5 = output amplitude : raw amp {10.1-32767} or multiplier {.001 - 10.}
       < default 0 = same amplitude as input soundfile
am .8;   < added because original p5 amps below produced clipping
p5  mx 1. 500 10000/ 16. 10000 16000/ 1. 16000 500;

   < p6 = gen1 function number
p6  1;
   < p7 = length of soundfile to be used, in seconds {duration} OR # of samples
p7  3.479;  < duration of the source flute soundfile

   < p8 = skip time into gen1 func : if positive p8  = skip time in seconds
      < if negative {between -.001 and -.999}, p8 = % of soundfile skipped
p8  1.  .001  3.2 ;   <  skip randomly through the source soundfile

   < p9 = pitch multiplier {default 0 = no pitch change}
p9  mo 3.  1. 1. 1.12 .88/ 3. 1.12 .88 1.12 .88/ 3. 1.12 .88  .891 /
 3. .891 .891  1.334 .667 / 3. 1.334 .667 1.334 .667 / 2. 1.334 .667 1.334/
    1. 1.33;
   < for stereo output only p10 = pan location {1. = hard left, 0 = hard right}
p10
  <  Added user p-fields: 
end;  <<< End of ### granflute ### example score >>>
