 < this example is similar to example "spxsyn1," with the following changes:
  <  changes in the driver notes {samplerp p-fields} :
  < notes 1 and 5 : glissandos are added {p15-p15}
  < note 3 : vibrato is added {p17-25} ; the vibrato speed moves from slow
     < to fast to slow; the vibrato depth changes from narrow to very wide
  < changes in the lpc cross-synthesis parameters :
  < notes 1 and 2 : the formants are dropped an octave (PAR5 & PAR5},
    < and brightness is decreased ( PAR6 & PAR7)
  < notes 3, 4 and 5 : the formants are shifted up (PAR4 & PAR5} and
     < the brightness is increased {PAR6 & PAR7}
  < note 4 : white noise added to make the snare drum roll more obvious
  
<   Score file for Library algorithm  ### samplerpxsyn ###
include(CSLIBDIR/Include/gen1tablesizes)
define(NEWPAR,36)dnl
   < (1) GEN1 function specifying soundfile path & name - change # below:
*f1 0 262144 1 "/sflib/string/pn.ef3.wav"  0 0;

 < Control functions: Required for glissando and/or vibrato
 * f100 0 1024 10 1.;	      < SINE WAVE  required for vibrato
 * f60 0 65 5 .01 64 1.;     < exponential slope, default gliss function for p16
ifdef([DETUNE],,define(DETUNE,0))dnl
ifdef([START],,define(START,0.000))dnl


SAMPLERP  START 0 5;
rd 
p3 nu  3.5 * 3/ 2.2/ 1.;
du nu 302.8* 3/  301.4/ 301;
  < p4 = new output pitch, cps or pch
p4  no ef3 / d3 / f3 / e3/ fs5; 
   < p5 = AMPLITUDE: {1} .01 - 1.= multiplier for source soundfile amplitude
   < {2} 100-32767 = new absolute amplitude ; {3} 60 - 90 = new amplitude in dB
   < default 0 = max amp { 32767 }
p5  .5;    
  < p6 - p8  OPTIONAL new envelope : if p6 + p7 = 0, no new envelope created
  < p6 = rise time { > 100 , or negative, = % p3}
p6 
   < p7 = decay time { > 100 , or negative, = % p3}
p7  
  < p8 = optional amplitude multiplier for end of note
  < normal range = ca. .1 - .9 {dim.} or 1.1 - 2. {cresc.}
p8

  <p9: skip: positive = skip time (seconds) into func, negative = starting phase
p9 nu .2 /// 0 / / ;  < skip off attack of piano tone
 < -----  p10,11 & 12: leave blank if using tables 99, 98, 97 & 96 to determine
 < GEN1 function number (source soundfile), its pitch and duration:
       < p10 = gen1 func. # of samples {0 default = func. 1}
   p10  1;     
       <  p11 = input pitch of p10 function {cps or pch}
   p11   no ef3;     
       < p12 = duration of p10 function to be used
   p12   3.402;
 <  ----- optional GLISSANDO { p13-p16} : if p14 + p15 = 0, no glissando -----
   < p13 = 2nd pitch {pch or cps} 0 = no gliss
p13 nu 7.05/ 0*3 / 7.08 ; < gliss up on first note 
   < p14 = duration for p4 pitch ( > 100 = % total dur)
p14 nu 100.25/ 0 * 3 / 100.1 ;   
   < p15 = duration of glissando{ > 100 = % total dur}
p15    nu 100.7/ 0 * 3 / 100.9 ;
   < p16 = glissando  function { default = 60 }
p16  
  < ----- Optional VIBRATO {p17-p24} : if p17+p19+p20 = 0, no vib. ------
   < p17 = initial vibrato rate
p17 nu 0// 1./ 0//;  < add vibrato to 3rd note  only 
   < p18 = time between p17 & p19 { >100 = % idur}
p18  nu 0// 100.4  / 0//;  < vibrato on 3rd note   
   < p19 = 2nd vibrato rate
p19  nu 0// 11. / 0//;   
   < p20 = final {3rd}  vibrato rate
p20  nu 0// 2. / 0//; 
   < p21 = initial vibrato depth { .01-.04 ord}
p21  nu 0// .02 / 0//;   
   < p22 = vibrato depth 2
p22 nu 0// .06/ 0//;  
    < p23 = closing {3rd}  vibrato depth
p23  nu 0// .12 / 0//;
    < p24 vibrato random deviation  : .2 - .4 ord
p24  .25;
   < ----- Note: samplerp PITCH RANDOM DEVIATION & ATTACK NOISE {p25-p28} currently
   < cannot be used with samplerpxsyn

< -----  Optional BRIGHTNESS {p30-p32}  --------
 < p30 = brightness : 0 = bypass brightness filtering; 1. = ord, range = .001-2.
p30  nu 0 * 3 / .1 / 1.9; 
   < Optional p31 = closing brightness { if 0, = p30 }
p31  nu 0 * 3/ 2.0 / .5; 
   < p32 = optional time between p30 & p31; 0 = full dur., > 100 = % full dur.
p32 
   < p33 = detuning {mostly for chorusing} { 1. = 1/2 step, .1 - .13 ord }
p33 DETUNE ;
   < p34 = sampling rate of INPUT soundfile, if different from output
p34
    < if p4 of your GEN1 function is >> -1 << rather than << 1 >> {normalization
    < of the soundfile is skipped}, place a >> -1 << flag in p35 below:
  p35
< XSYN POST-PROCESSING:
include(CSLIBDIR/Include/pfields.h)
    < functions 96 & 97 are optional, if tables are used for begin & end times
    < f96 specifies times to begin reading lp.m; start with 2nd location
    < f97 specifies times to end reading lp.m ; start with 2nd location
< *f96 0 size -2 0 
< *f97 0 size -2 0 

< anal files are of sop1.fs4 / fl.e4 / oboe.d4 / sdrum1.broll / vc.p.c3
PAR1  nu 1 / 5 / 6 /  7 / 8;          < lp.m number
  < PAR2 = time in orig. soundfile to BEGIN reading
PAR2 nu 0*3/ 1.63 / 2.28;
  < PAR3 = time in orig. soundfile to END reading;if neg. = index to f96 & f97
 < use only 3" of soprano analysis to avoid overly rapid vibrato/tremolo
PAR3 nu 3.0/  3.47/  2.62/ 0.001 / /;
<OPTIONAL PARAMETERS :PAR4 through PAR13 (any of these fields can be left blank)
    < PAR4 & PAR5 : TRANSPOSITION of FORMANTS; if PAR4 = 0 no change
    < if PAR4 = 1, PAR5 = multiplier ; if PAR4 = 2, PAR5 = semitone 
    < (integer portion) and/or microtonal (fractrional portion) transposition
PAR4  2;                   < Flag : 0,1 or 2
PAR5 nu .5  / / 1.5 / 2. /1.5  ;        < formant multiplier or transposition
    < BRIGHTNESS : PAR6 & PAR7  ; if PAR6 = 0 no change
    < if PAR6 = 1, ptrack pitch used for filter center freq.;
    <  any other PAR6 value = new filter center freq. in cps or pch
PAR6 nu 1 / 1 / 1 / 500 / 300;
  < PAR7 :  brightness modifier: range -1. (least bright) to +1. (brightest)
PAR7  nu -.6 / / 1. / .95 //;                  
    < PAR8 : Add White noise : if PAR8 = 0, no noise added; if positive
    < between .001 & 1., specifies constant noise % added; if negative
    < (e.g. -.01), specifies MINIMUM % noise added
PAR8 nu 0 * 3/ .05 / 0;
< Amplitude : PAR9 through PAR12
    < Envelope: if PAR9 = 0, lp.m file envelope used ;if PAR9 = -1,
    < internal mix of lp.m file & driver envelopes ; if PAR9 is between .001
    < and +1., a mix of the driver & lp.mfile envelopes is done, with PAR9
    < specifying the % of driver envelope
PAR9  
PAR10 nu .5/ .6 /.8 / .9 / .5;  < amplitude multiplier
PAR11                     < fade-in time
 < fade out 11st note, when only a portion of the soprano analysis file used
PAR12 nu .2/0*2/ .3 / .1;          < fade-out time
    < PAR13 : Attack hardness : if PAR13 = 0, no change . Range is -1.
    < (greatest smoothing of attack) to +1. (hardest attack)
PAR13 nu 0/// .5 / .8;
  <  Added user p-fields: 
end;  <<< End of ### samplerpxsyn ### score >>>
