SHARE
TWEET

Untitled

a guest Feb 19th, 2018 97 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, freqs;
  6.     freqs = Array.fill(10, {arg i; fund * (0.5.pow(i))});
  7.     freqs.put(0, fund);
  8.     ampEnv = Env([0, 0.25, 1, 0.25, 0], [period/4, period/4, period/4, period/4], 'sin').circle;
  9.     oscArray = Array.fill(10, {|i|
  10.         SinOsc.ar(EnvGen.kr(Env([freqs[i], freqs[i]/2], period, 'lin').circle),
  11.             mul: IEnvGen.kr(ampEnv, LinLin.kr(freqs[i], freqs[0], freqs.last, 1, 0)))});
  12.     oscArray = Mix.ar(oscArray); // mix to channels
  13.     Out.ar([0,1], oscArray); // the [0,1] routes audio to both L and R channels
  14.  
  15. }).add;
  16. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top