Advertisement
debug_calebs_code

Pan modulation

Oct 11th, 2020
2,555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SynthDef(\sin, {
  2.     arg freq=440, atk=0.01, rel=1, amp=1, pan=0, modAmp=1;
  3.     var sig, env, mod;
  4.     sig = SinOsc.ar(freq);
  5.     env = EnvGen.kr(Env.perc(atk, rel), doneAction:2);
  6.  
  7.     // Modulation signal
  8.     mod = SinOsc.kr(freq:20, mul:modAmp);
  9.     // Modulate the signal between L & R speakers
  10.     pan = pan * mod;
  11.  
  12.     sig = sig * env * amp;
  13.     sig = Pan2.ar(sig, pan);
  14.     Out.ar(0, sig);
  15. }).add;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement