I’m tinkering around with a Bela and struggling a bit with OSC messages. Here’s the relevant Bela code:
s.waitForBoot({
OSCdef(\test, {
|msg|
"Received: %".format(msg).postln;
}, '/test');
SynthDef(\sine, {
|freq = 440|
var sig = SinOsc.ar(freq.postln) ! 2;
Out.ar(0, sig);
}).add;
});
I’ve assigned a remote server:
r = Server(\bela, NetAddr("192.168.6.2", 57120));
This works:
r.sendMsg('/test', "hello", 123, 0.5);
This doesn’t:
r.sendMsg("/s_new", "sine", x = r.nextNodeID, 1, 1, "freq", 440)
Am I doing something obviously wrong here?
Thanks in advance,
Jordan
Hm, that’s the language port, not the server port.
As the language and server are different processes, they can’t share the same port number.
I think you should create a NetAddr for the language on port 57120, while the remote server connects to port 57110.
hjh
Thanks!
I’ve corrected this. Now using:
r = Server(\bela, NetAddr("192.168.6.2", 57110));
q = NetAddr("192.168.6.2", 57120);
q.sendMsg('/test', "hello", 123, 0.5); // this works
r.sendMsg("/s_new", "sine", x = r.nextNodeID, 1, 1, "freq", 440) // this doesn't. q.sendMsg with the same command also doesn't
Thanks! Setting bindAddress = 0.0.0.0 took care of everything.