def rotary1_callback(path, tags, args, source): print str(path) + " " + str(args[0]) json.send({'command':'put', 'key':'rotary1', 'value':'%i' % int(args[0])}) #create feedback for faders label: msg = OSCMessage("/1/label_rotary1") msg.insert(0, int(args[0])) client.connect( (source[0], 9000) ) client.send(msg)
def fader_callback(path, tags, args, source): global fader1Feedback if path=="/1/fader1": fader1Feedback = float(args[0]) msg = OSCMessage("/1/label1") msg.insert(0, fader1Feedback) print "%i" % fader1Feedback json.send({'command':'put', 'key':'D13', 'value':'%i' % (fader1Feedback)}) client.send(msg)
def multiselectPalette_callback(path, tags, args, source): print "received: " +repr(source)+ " " + str(path) split = path.split("/") Palette = split.pop() Palette = split.pop() if args[0]==1: #requests.get("http://192.168.1.104/arduino/state/"+str(int(state)-1)) json.send({'command':'put', 'key':'palette', 'value':'%i' % int(int(Palette)-1)}) msg = OSCMessage(path) msg.insert(0, 1) client.connect( (source[0], 9000) ) client.send(msg)
def fader2_callback(path, tags, args, source): global fader2Feedback if path=="/1/fader2": fader2Feedback = int(args[0]) msg = OSCMessage("/1/label2") msg.insert(0, fader2Feedback) print "Fader 2 %i" % fader2Feedback client.send(msg) arduino.write('Y') arduino.write('\n') arduino.write('%i' % fader2Feedback) arduino.write('\n')
def rotary1_callback(path, tags, args, source): print str(path) + " " + str(args[0]) json.send({ 'command': 'put', 'key': 'rotary1', 'value': '%i' % int(args[0]) }) #create feedback for faders label: msg = OSCMessage("/1/label_rotary1") msg.insert(0, int(args[0])) client.connect((source[0], 9000)) client.send(msg)
def faderFPS_callback(path, tags, args, source): global faderFPSFeedback if path=="/1/fps": #extract parameter: faderFPSFeedback = int(args[0]) #put parameter to the bridge: json.send({'command':'put', 'key':'fps', 'value':'%i' % (faderFPSFeedback)}) #create feedback for faders label: msg = OSCMessage("/1/label_fps") msg.insert(0, faderFPSFeedback) client.connect( (source[0], 9000) ) client.send(msg) print "received: " +repr(source)+ " " + str(path)
def faderLight_callback(path, tags, args, source): global faderLightFeedback if path=="/1/light": #extract parameter: faderLightFeedback = int(args[0]) #put parameter to the bridge: json.send({'command':'put', 'key':'brightness', 'value':'%i' % (faderLightFeedback)}) print str(path) +" "+ str(faderLightFeedback) #create feedback for faders label: msg = OSCMessage("/1/label_light") msg.insert(0, faderLightFeedback) client.connect( (source[0], 9000) ) client.send(msg)
def fader_callback(path, tags, args, source): global fader1Feedback if path == "/1/fader1": fader1Feedback = float(args[0]) msg = OSCMessage("/1/label1") msg.insert(0, fader1Feedback) print "%i" % fader1Feedback json.send({ 'command': 'put', 'key': 'D13', 'value': '%i' % (fader1Feedback) }) client.send(msg)
def multiselectPalette_callback(path, tags, args, source): print "received: " + repr(source) + " " + str(path) split = path.split("/") Palette = split.pop() Palette = split.pop() if args[0] == 1: #requests.get("http://192.168.1.104/arduino/state/"+str(int(state)-1)) json.send({ 'command': 'put', 'key': 'palette', 'value': '%i' % int(int(Palette) - 1) }) msg = OSCMessage(path) msg.insert(0, 1) client.connect((source[0], 9000)) client.send(msg)
def faderFPS_callback(path, tags, args, source): global faderFPSFeedback if path == "/1/fps": #extract parameter: faderFPSFeedback = int(args[0]) #put parameter to the bridge: json.send({ 'command': 'put', 'key': 'fps', 'value': '%i' % (faderFPSFeedback) }) #create feedback for faders label: msg = OSCMessage("/1/label_fps") msg.insert(0, faderFPSFeedback) client.connect((source[0], 9000)) client.send(msg) print "received: " + repr(source) + " " + str(path)
def faderLight_callback(path, tags, args, source): global faderLightFeedback if path == "/1/light": #extract parameter: faderLightFeedback = int(args[0]) #put parameter to the bridge: json.send({ 'command': 'put', 'key': 'brightness', 'value': '%i' % (faderLightFeedback) }) print str(path) + " " + str(faderLightFeedback) #create feedback for faders label: msg = OSCMessage("/1/label_light") msg.insert(0, faderLightFeedback) client.connect((source[0], 9000)) client.send(msg)
def fader_callback(path, tags, args, source): global fader1Feedback if path=="/1/fader1": fader1Feedback = int(args[0]) msg = OSCMessage("/1/label1") msg.insert(0, fader1Feedback) print "Fader 1 %i" % fader1Feedback client.send(msg) if (fader1Feedback > 100): arduino.write('F') arduino.write('\n') arduino.write('%i' % fader1Feedback) arduino.write('\n') if (fader1Feedback < 90): arduino.write('B') arduino.write('\n') arduino.write('%i' % fader1Feedback) arduino.write('\n') elif ((fader1Feedback < 100) and (fader1Feedback > 90)): arduino.write('S') arduino.write('\n') arduino.write('%i' % fader1Feedback) arduino.write('\n')