Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- SynthDef(\rissetTone, {|fund, period|
- // I really don't know how to use addFunc within the SynthDef. Isn't that not possible because of the environment?
- // Doesn't addFunc need to be used outside of this therefore why are we passing in "fund"?
- var oscArray, ampEnv, freqs;
- freqs = Array.fill(10, {arg i; fund * (0.5.pow(i))});
- freqs.put(0, fund);
- ampEnv = Env([0, 0.25, 1, 0.25, 0], [period/4, period/4, period/4, period/4], 'sin').circle;
- oscArray = Array.fill(10, {|i|
- SinOsc.ar(EnvGen.kr(Env([freqs[i], freqs[i]/2], period, 'lin').circle),
- mul: IEnvGen.kr(ampEnv, LinLin.kr(freqs[i], freqs[0], freqs.last, 1, 0)))});
- oscArray = Mix.ar(oscArray); // mix to channels
- Out.ar([0,1], oscArray); // the [0,1] routes audio to both L and R channels
- }).add;
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement