Advertisement
Guest User

Untitled

a guest
Jan 1st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SynthDef.new(\testSynth, {  |bufnum|
  2.   var pb;
  3.   pb = PlayBuf.ar(
  4.     numChannels: 2,
  5.     rate: BufRateScale.kr(bufnum),
  6.     bufnum: bufnum,
  7.     doneAction: 3,
  8.   );
  9.   Out.ar(1, pb);
  10. }).add;
  11.  
  12. ~group = Group.new;
  13. ~nSeconds = 3;
  14. ~oneSecond = s.sampleRate;
  15. ~buf = Buffer.alloc(s, ~oneSecond * ~nSeconds, numChannels: 2);
  16.  
  17. SystemClock.sched(~nSeconds + 0.01, {
  18.   ("System clock done in" + ~nSeconds + "seconds").postln;
  19.   ~group.dumpTree;
  20. });
  21. Synth.new("testSynth", args: [\bufnum, ~buf.bufnum], target: ~group);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement