OSCReceiver


An object for remote controlling scLang by any other application through OSC-messages.


Uses [OSCReceiverFunction] as controllable objects.


*new(name, addr)

new instance listening for messages of type name from addr.

start

starts the receiver

stop

stops the receiver


// internal try

o = OSCReceiver("/dumbo", NetAddr("localhost", 57120))

o = OSCReceiver("/dumbo", nil)


OSCReceiverFunction(o, "fly", {"juchee".postln})

OSCReceiverFunction.all

OSCReceiverFunction("/dumbo", "fly", {|height = 0| 

(height>100).if({

"no, too high!".postln

},{

"juchee".postln

})

})


o.start

o.stop


n = NetAddr("localhost", 57120)




n.sendMsg("/dumbo", \fly)

n.sendMsg("/dumbo", \fly, 1000)


o.stop



// external try

o = OSCReceiver("/dumbo", NetAddr("localhost", nil))


OSCReceiverFunction("/dumbo", "fly", {"juchee".postln})

OSCReceiverFunction("/dumbo", "fly", {|height = 0| 

(height>100).if({

"no, too high!".postln

},{

"juchee".postln

})

})


o.start


/*

sendOSC -h localhost 57120

/dumbo fly

/dumbo fly 1000

*/


o.stop