You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
210 lines
5.2 KiB
Plaintext
210 lines
5.2 KiB
Plaintext
s.options.numOutputBusChannels = 4;
|
|
|
|
(
|
|
s.waitForBoot({
|
|
~python_server = NetAddr("127.0.0.1", 57120);
|
|
~python_server.sendMsg("/hello", "supercollider");
|
|
~begin_00 = Condition();
|
|
~begin_01 = Condition();
|
|
|
|
~begin_02 = Condition();
|
|
~begin_03 = Condition();
|
|
|
|
~begin_04 = Condition();
|
|
~begin_05 = Condition();
|
|
|
|
~begin_06 = Condition();
|
|
~begin_07 = Condition();
|
|
|
|
(
|
|
OSCFunc({~begin_00.unhang()}, '/begin/00', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_01.unhang()}, '/begin/01', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_02.unhang()}, '/begin/02', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_03.unhang()}, '/begin/03', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_04.unhang()}, '/begin/04', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_05.unhang()}, '/begin/05', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_06.unhang()}, '/begin/06', recvPort: 58110);
|
|
);
|
|
|
|
(
|
|
OSCFunc({~begin_07.unhang()}, '/begin/07', recvPort: 58110);
|
|
);
|
|
|
|
Routine({
|
|
loop {
|
|
~begin_00.wait
|
|
(
|
|
OSCdef.new(\begin_00,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_00 = msg[1]}, '/begin/00', recvPort: 58110;)
|
|
);
|
|
~sig_00.postln;
|
|
~mono_00 = Mix.new(~sig_00);
|
|
~buffer_00 = Buffer.readChannel(s, ~mono_00,
|
|
channels: 0); // prevent errors
|
|
~synth_00 = SynthDef("zero",{ arg out = 0, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_00.play(s, [\bufnum, ~buffer_00]).onFree {~python_server.sendMsg(
|
|
"/done00", ~sig_00)};
|
|
~begin_01.wait
|
|
(
|
|
OSCdef.new(\begin_01,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_01 = msg[1]}, '/begin/01', recvPort: 58110;)
|
|
);
|
|
~sig_01.postln;
|
|
~mono_01 = Mix.new(~sig_01);
|
|
~buffer_01 = Buffer.readChannel(s, ~mono_01,
|
|
channels: 0); // prevent errors
|
|
~synth_01 = SynthDef("one",{ arg out = 0, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_01.play(s, [\bufnum, ~buffer_01]).onFree {~python_server.sendMsg(
|
|
"/done01", ~sig_01)};
|
|
}
|
|
}).play;
|
|
|
|
|
|
Routine({
|
|
loop {
|
|
~begin_02.wait
|
|
(
|
|
OSCdef.new(\begin_02,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_02 = msg[1]}, '/begin/02', recvPort: 58110;)
|
|
);
|
|
~sig_02.postln;
|
|
~mono_02 = Mix.new(~sig_02);
|
|
~buffer_02 = Buffer.readChannel(s, ~mono_02,
|
|
channels: 0); // prevent errors
|
|
~synth_02 = SynthDef("two",{ arg out = 1, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_02.play(s, [\bufnum, ~buffer_02]).onFree {~python_server.sendMsg(
|
|
"/done02", ~sig_02)};
|
|
~begin_03.wait
|
|
(
|
|
OSCdef.new(\begin_03,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_03 = msg[1]}, '/begin/03', recvPort: 58110;)
|
|
);
|
|
~sig_03.postln;
|
|
~mono_03 = Mix.new(~sig_03);
|
|
~buffer_03 = Buffer.readChannel(s, ~mono_03,
|
|
channels: 0); // prevent errors
|
|
~synth_03 = SynthDef("three",{ arg out = 1, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_03.play(s, [\bufnum, ~buffer_03]).onFree {~python_server.sendMsg(
|
|
"/done03", ~sig_03)};
|
|
}
|
|
}).play;
|
|
|
|
Routine({
|
|
loop {
|
|
~begin_04.wait
|
|
(
|
|
OSCdef.new(\begin_04,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_04 = msg[1]}, '/begin/04', recvPort: 58110;)
|
|
);
|
|
~sig_04.postln;
|
|
~mono_04 = Mix.new(~sig_04);
|
|
~buffer_04 = Buffer.readChannel(s, ~mono_04,
|
|
channels: 0); // prevent errors
|
|
~synth_04 = SynthDef("four",{ arg out = 2, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_04.play(s, [\bufnum, ~buffer_04]).onFree {~python_server.sendMsg(
|
|
"/done04", ~sig_04)};
|
|
~begin_05.wait
|
|
(
|
|
OSCdef.new(\begin_05,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_05 = msg[1]}, '/begin/05', recvPort: 58110;)
|
|
);
|
|
~sig_05.postln;
|
|
~mono_05 = Mix.new(~sig_05);
|
|
~buffer_05 = Buffer.readChannel(s, ~mono_05,
|
|
channels: 0); // prevent errors
|
|
~synth_05 = SynthDef("five",{ arg out = 2, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_05.play(s, [\bufnum, ~buffer_05]).onFree {~python_server.sendMsg(
|
|
"/done05", ~sig_05)};
|
|
}
|
|
}).play;
|
|
|
|
|
|
Routine({
|
|
loop {
|
|
~begin_06.wait
|
|
(
|
|
OSCdef.new(\begin_06,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_06 = msg[1]}, '/begin/06', recvPort: 58110;)
|
|
);
|
|
~sig_06.postln;
|
|
~mono_06 = Mix.new(~sig_06);
|
|
~buffer_06 = Buffer.readChannel(s, ~mono_06,
|
|
channels: 0); // prevent errors
|
|
~synth_06 = SynthDef("six",{ arg out = 3, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_06.play(s, [\bufnum, ~buffer_06]).onFree {~python_server.sendMsg(
|
|
"/done06", ~sig_06)};
|
|
~begin_07.wait
|
|
(
|
|
OSCdef.new(\begin_07,
|
|
{|msg, time, addr, recvPort|
|
|
~sig_07 = msg[1]}, '/begin/07', recvPort: 58110;)
|
|
);
|
|
~sig_07.postln;
|
|
~mono_07 = Mix.new(~sig_07);
|
|
~buffer_07 = Buffer.readChannel(s, ~mono_07,
|
|
channels: 0); // prevent errors
|
|
~synth_07 = SynthDef("seven",{ arg out = 3, bufnum;
|
|
Out.ar( out,
|
|
PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: 2)
|
|
);
|
|
});
|
|
~synth_07.play(s, [\bufnum, ~buffer_07]).onFree {~python_server.sendMsg(
|
|
"/done07", ~sig_07)};
|
|
}
|
|
}).play;
|
|
});
|
|
)
|