Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. SynthDef(\rissetTone, {|fund, period|
  3.     // I really don't know how to use addFunc within the SynthDef. Isn't that not possible because of the environment?
  4.     // Doesn't addFunc need to be used outside of this therefore why are we passing in "fund"?
  5.     var oscArray, ampEnv, freqEnvGen;
  6.     oscArray = Array.fill(10, {|i|
  7.         SinOsc.ar(EnvGen.kr(Env.circle([~freq.at(i), (~freq.at(i))/2, ~freq.at(i)], [period, 0, 0])),
  8.             mul: IEnvGen.kr(Env.circle(levels: [(i+1)/10, 0, 0, (i+1)/10], times: [period/2, 0], curve: 'sin'), LinLin.kr(EnvGen.kr(Env.circle([0, 1, 0], [period/2, period/2, 0], 'sin')).poll, 0, 1, ((i+1)/10) * period, ((i)/10) * period).poll));
  9.     });
  10.     Out.ar([0,1], oscArray); // the [0,1] routes audio to both L and R channels
  11.  
  12. }).add;
  13. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement