Advertisement
Guest User

Untitled

a guest
May 16th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s.boot;
  2.  
  3. //cambiar /path/to/ por el lugar donde tengas el sample corte usuario/nombre/documentos/whatever
  4.  
  5. ~b0 = Buffer.read(s, "/path/to/BT0A0A7.wav")
  6. ~b1 =Buffer.read(s, "/path/to/000_hh3closedhh.wav")
  7.  
  8. ~b0.play
  9.  
  10. //dos synthdefs por que un sample es estereo y el otro mono, y creo que no podes pasar cantidad de channels como arg
  11. (
  12. SynthDef.new(\playbuf, {|amp=1, out=0, buf, da=2, rate =1|
  13. var sig;
  14. sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * rate, doneAction:da);
  15. sig = sig*amp;
  16. Out.ar(out, sig);
  17. }).add;
  18. )
  19.  
  20. Synth.new(\playbuf, [\buf, ~b1.bufnum])
  21.  
  22. (
  23. SynthDef.new(\playbufmono, {|amp=1, out=0, buf, da=2, rate =1|
  24. var sig;
  25. sig = PlayBuf.ar(1, buf, BufRateScale.kr(buf) * rate, doneAction:da);
  26. sig = sig*amp;
  27. Out.ar(out, sig);
  28. }).add;
  29. )
  30.  
  31. Synth.new(\playbufmono, [\buf, ~b0.bufnum])
  32.  
  33. (
  34. OSCdef.new(\texto,{
  35.     |msg, time, addr, port|
  36.     msg[1].postln;
  37.     switch(msg[1],
  38.         \imperturbable, {Synth.new(\playbuf, [\buf, ~b1.bufnum])},
  39.         \noche, {Synth.new(\playbufmono, [\buf, ~b0.bufnum])},
  40.         \toda, {Synth.new(\playbuf, [\buf, ~b1.bufnum])}
  41.     );
  42. },
  43. '/supercollider',
  44. )
  45. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement