def OSCsend(name, oscaddress, oscargs=''): #print "OSCsend in plugins got for", name, ": oscaddress", oscaddress, "oscargs :", oscargs PluginPort = Port(name) #sendWSall("/status Checking "+ name + "...") osclientplugin = OSCClient() osclientplugin.connect((gstt.LjayServerIP, PluginPort)) oscmsg = OSCMessage() oscmsg.setAddress(oscaddress) oscmsg.append(oscargs) try: if gstt.debug > 0: print("Plugins manager : OSCsending", oscmsg, "to plugin", name, "at", gstt.LjayServerIP, ":", PluginPort) osclientplugin.sendto(oscmsg, (gstt.LjayServerIP, PluginPort)) oscmsg.clearData() if gstt.debug > 0: print(oscaddress, oscargs, "was sent to", name) return True except: if gstt.debug > 0: print('OSCSend : Connection to plugin IP', gstt.LjayServerIP, ':', PluginPort, 'refused : died ?') #sendWSall("/status No plugin.") #sendWSall("/status " + name + " is offline") #sendWSall("/" + name + "/start 0") #PluginStart(name) return False
def OSCsend(name, oscaddress, oscargs=''): ip = midi2OSC[name]["oscip"] port = midi2OSC[name]["oscport"] osclient = OSCClient() osclient.connect((ip, port)) oscmsg = OSCMessage() oscmsg.setAddress(oscaddress) oscmsg.append(oscargs) try: if gstt.debug > 0: print("Midi OSCSend : sending", oscmsg, "to", name, "at", ip, ":", port) osclient.sendto(oscmsg, (ip, port)) oscmsg.clearData() return True except: if gstt.debug > 0: print('Midi OSCSend : Connection to IP', ip, ':', port, 'refused : died ?') #sendWSall("/status No plugin.") #sendWSall("/status " + name + " is offline") #sendWSall("/" + name + "/start 0") #PluginStart(name) return False
def Send(oscaddress, oscargs=''): oscmsg = OSCMessage() oscmsg.setAddress(oscaddress) oscmsg.append(oscargs) osclient = OSCClient() osclient.connect((ip, port)) print("sending OSC message : ", oscmsg, "to", ip, ":", port) try: osclient.sendto(oscmsg, (ip, port)) oscmsg.clearData() return True except: print('Connection to', ip, 'refused : died ?') return False