SHARE
TWEET

Untitled

a guest Feb 26th, 2018 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (
  2. s.waitForBoot({  // waitForBoot evaluates the function only once the server is booted
  3.  
  4.     SynthDef(\amSynth, {|fund = 400, pan = 0, ampLevels = #[0,1,0], ampTimes = #[1,1], bus = 10|
  5.         e = Env.new(ampLevels, ampTimes);
  6.     x = SinOsc.ar(fund, mul:EnvGen.kr(e))*SinOsc.ar(fund/2, mul:EnvGen.kr(e));
  7.         x = Mix.ar(x);
  8.         x = Pan2.ar(x, pan);
  9.         Out.ar(bus, x);
  10.  
  11. }).add;
  12.  
  13.  
  14. SynthDef(\addSynth, {|fund = 400, amp = 1, pan = 0, bus = 10|
  15.     var x, y, z;
  16.     x = SinOsc.ar(fund, mul: amp);
  17.     y = SinOsc.ar(fund*2, mul: 0.5 * amp);
  18.     z = SinOsc.ar(fund*3, mul: 0.25 * amp);
  19.     a = Mix.ar([x, y, z]);
  20.     a = Pan2.ar(a, pan);
  21.     Out.ar(bus, a);
  22.  
  23. }).add;
  24.  
  25. SynthDef(\reverb, {|mix = 0.5, bus = 10|
  26.         ~signal = In.ar(bus, 1);
  27.         ~signal = Mix.ar(~signal);
  28.         ~signal = FreeVerb.ar(~signal, mix);
  29.         Out.ar(0, ~signal);
  30. }).add;
  31. })
  32. )
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