;  #############################################################
;  soundfile ex4-7 : randh substituted for randi
;  #############################################################
instr 2
  i1 = (p4<15? cpspch(p4) : p4)   ; p4 can be in cps or pch
  a1 envlpx p5,p6,p3,p7,60,p8,.01
  i2 = (p9<15? p9*i1 : p9)  
  i3 = (p10=0 ? KR-1 : p10)     ; for maximum random rate, use 0 in p10
  knoise randh i2,i3            ; for p10 any value up to KR-1 is OK
  a1 oscili a1, i1+knoise, 100
  out a1
endin
