I’m new to SC and the whole music programming thing in general. I’ve done a python app, that reads a text and sends word by word to SC through OSC. The text is only the words ‘miau’ and ‘guau’ repeated for fun and to try it out.
Another thing kind of weird happening, is that on the SC console I get three times the same word than on the text and on terminal (that python prints each word). So for each ‘miau’ on the txt/terminal, I get ‘miau miau miau’ on the SC console.
The OSC communication is working, but I hear no sound. I’ve played my buffers separately, and they are working. When I play the buffers or the SynthDef I can hear the samples being played, so I assume the issue is on the switch.
s.boot;
~b0 = Buffer.read(s, "/path/to/bd/BT0A0A7.wav")
~b1 =Buffer.read(s, "/path/to/hh/000_hh3closedhh.wav")
~b0.play;
(
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]);
(
OSCdef.new("texto",{
|msg, time, addr, port|
msg[1].postln;
switch(msg[1],
"miau", {Synth.new(\playbuf, [\buf, ~b1.bufnum])},
"guau", {Synth.new(\playbuf, [\buf, ~b0.bufnum])}
);
},
'/supercollider',
)
)
Although it copies the text, so I know the OSC is working, the samples won't play. Any tip appreciated!