def update(self): """This performs all registered callbacks. If used in a NodeBox animation, put a call to the upate method in your animation's update method.""" osc.getOSC(self.listener)
def myTest(): """ a simple function that creates the necesary sockets and enters an enless loop sending and receiving OSC """ osc.init() inSocket = osc.createListener("127.0.0.1", 9001) # in this case just using one socket ## inSocket = osc.createListener() # this defaults to port 9001 as well # bind addresses to functions -> printStuff() function will be triggered everytime a # "/test" labeled message arrives osc.bind(printStuff, "/test") import time # in this example we will have a small delay in the while loop print "ready to receive and send osc messages ..." while 1: ## osc.sendMsg("/test", [444], "127.0.0.1", 9000) # send normal msg to a specific ip and port osc.sendMsg("/test", [444]) # !! it sends by default to localhost ip "127.0.0.1" and port 9000 # create and send a bundle bundle = osc.createBundle() osc.appendToBundle(bundle, "/test/bndlprt1", [1, 2, 3]) # 1st message appent to bundle osc.appendToBundle(bundle, "/test/bndlprt2", [4, 5, 6]) # 2nd message appent to bundle ## osc.sendBundle(bundle, "127.0.0.1", 9000) # send it to a specific ip and port osc.sendBundle(bundle) # !! it sends by default to localhost ip "127.0.0.1" and port 9000 osc.getOSC(inSocket) # listen to incomming OSC in this socket time.sleep(0.5) # you don't need this, but otherwise we're sending as fast as possible.
def main(port): osc.init() listener = osc.createListener("",port) import time while 1: time.sleep(0.1) osc.getOSC(listener)
def myTest(): """ a simple function that creates the necesary sockets and enters an enless loop sending and receiving OSC """ osc.init() osc.bind(printStuff, "/gainSlider") inSocket = osc.createListener("127.0.0.1", 9001) import time while 1: osc.getOSC(inSocket) osc.dontListen()
def myTest(): """ a simple function that creates the necesary sockets and enters an enless loop sending and receiving OSC """ osc.init() inSocket = osc.createListener('127.0.0.1', 9001) # in this case just using one socket ## inSocket = osc.createListener() # this defaults to port 9001 as well # bind addresses to functions -> printStuff() function will be triggered everytime a # "/test" labeled message arrives osc.bind(printStuff, "/test") import time # in this example we will have a small delay in the while loop print 'ready to receive and send osc messages ...' while 1: ## osc.sendMsg("/test", [444], "127.0.0.1", 9000) # send normal msg to a specific ip and port osc.sendMsg("/test", [ 444 ]) # !! it sends by default to localhost ip "127.0.0.1" and port 9000 # create and send a bundle bundle = osc.createBundle() osc.appendToBundle(bundle, "/test/bndlprt1", [1, 2, 3]) # 1st message appent to bundle osc.appendToBundle(bundle, "/test/bndlprt2", [4, 5, 6]) # 2nd message appent to bundle ## osc.sendBundle(bundle, "127.0.0.1", 9000) # send it to a specific ip and port osc.sendBundle( bundle ) # !! it sends by default to localhost ip "127.0.0.1" and port 9000 osc.getOSC(inSocket) # listen to incomming OSC in this socket time.sleep( 0.5 ) # you don't need this, but otherwise we're sending as fast as possible.
def data(self): osc.getOSC(self._socket) return self._data