async def loop(): time.sleep(0.1) handshakeStatus = 1 print("done setup") osc.initSynthParams() client.send_message("/init", 0) while(t.check()): #t.check checks if timeout has triggered to cancel script await asyncio.sleep(0) #listen for OSC while(comms.available() > 0): currentMessage = comms.get() # can be None if nothing in input buffer if currentMessage != None: if PACKET_INCOMING_SERIAL_MONITOR == 0: if 2 < len(currentMessage) < 16: address, value = sensor.processInput(currentMessage) osc.mapSensor(address,value) client.send_message(address,value) else: print("packet", currentMessage) time.sleep(0.001)
async def loop(): time.sleep(0.1) handshakeStatus = 1 print("done setup") osc.initSynthParams() client.send_message("/init", 0) ledNum = 0 while (t.check()): #t.check checks if timeout has triggered to cancel script await asyncio.sleep(0) #listen for OSC while (comms.available() > 0): await asyncio.sleep(0) #listen for OSC currentMessage = comms.get( ) # can be None if nothing in input buffer if currentMessage != None: if PACKET_INCOMING_SERIAL_MONITOR == 0: if 2 < len(currentMessage) < 16: #print("packet3", currentMessage) address, value = sensor.processInput(currentMessage) # if address is not "/acc0" or "/gyro0": # print(address, value) osc.mapSensor(address, value) client.send_message(address, value) else: print("packet", currentMessage) if MIDI_ENABLE: msg = midi_input.available() if msg is not None: address, value = sensor.processMidi(msg) if PACKET_INCOMING_SERIAL_MONITOR == 1: print(address, value) osc.mapSensor(address, value) if MIDI_ENABLE: msg = midi_input.available() if msg is not None: address, value = sensor.processMidi(msg) time.sleep(0.001)