I'm fiddling with SuperCollider + OSC and right now i don't seem to get the proper understanding of it.
This code should do:
- start a server
- define a synth
- start an instance of the synth
- mount a listener to alter the sin frequency through remote command
( Server.default = Server.internal; s = Server.default; s.boot; SynthDef(\fly, { arg freq = 500; Out.ar(0, SinOsc.ar(freq, 0, 0.1)) }).add; ~fly = Synth.new(\fly); OSCdef.new( \move, {arg msg; [msg].postln; ~fly.set(\freq, msg[0]); }, '/move', nil, 57120 ); )
Obviously it does not work as intented. The synth is not created by running the whole script. I need to run every block by itself. Also the call in OSCDef doesn't know about the ~fly
synth: FAILURE IN SERVER /n_set Node 1000 not found
.