Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s.boot;
- //cambiar /path/to/ por el lugar donde tengas el sample corte usuario/nombre/documentos/whatever
- ~b0 = Buffer.read(s, "/path/to/BT0A0A7.wav")
- ~b1 =Buffer.read(s, "/path/to/000_hh3closedhh.wav")
- ~b0.play
- //dos synthdefs por que un sample es estereo y el otro mono, y creo que no podes pasar cantidad de channels como arg
- (
- SynthDef.new(\playbuf, {|amp=1, out=0, buf, da=2, rate =1|
- var sig;
- sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * rate, doneAction:da);
- sig = sig*amp;
- Out.ar(out, sig);
- }).add;
- )
- Synth.new(\playbuf, [\buf, ~b1.bufnum])
- (
- SynthDef.new(\playbufmono, {|amp=1, out=0, buf, da=2, rate =1|
- var sig;
- sig = PlayBuf.ar(1, buf, BufRateScale.kr(buf) * rate, doneAction:da);
- sig = sig*amp;
- Out.ar(out, sig);
- }).add;
- )
- Synth.new(\playbufmono, [\buf, ~b0.bufnum])
- (
- OSCdef.new(\texto,{
- |msg, time, addr, port|
- msg[1].postln;
- switch(msg[1],
- \imperturbable, {Synth.new(\playbuf, [\buf, ~b1.bufnum])},
- \noche, {Synth.new(\playbufmono, [\buf, ~b0.bufnum])},
- \toda, {Synth.new(\playbuf, [\buf, ~b1.bufnum])}
- );
- },
- '/supercollider',
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement