box-o-sand/sclang-play/oscfun.sc

41 lines
526 B
Python
Raw Normal View History

(
n = NetAddr("127.0.0.1", 8765);
n.sendMsg("/good/news", "haaay");
)
(
f = { |msg, time, addr|
if((addr.port == 8765) && (msg[0] != '/status.reply'), {
"time: % sender: %\nmessage: %\n".postf(time, addr, msg);
});
};
thisProcess.addOSCRecvFunc(f);
)
(
thisProcess.replaceOSCRecvFunc(f, f);
)
(
thisProcess.removeOSCRecvFunc(f);
)
(
thisProcess.openUDPPort(1121);
)
(
thisProcess.stop;
)
(
thisProcess.openPorts;
)
(
// OSCFunc.trace(false);
s.quit;
s.boot;
// OSCFunc.trace(true);
)