def threadfunc(self): while True: msg = pyrawmidi.read() if self.threadid!=thread.get_ident(): break midimsg = MidiMsg(msg) self.gui.postEvent(midimsg) self.terminated = True
def threadfunc(self): self.running = True while True: msg = pyrawmidi.read() if not self.run: break if not self.analyse(msg): printcmd(msg) self.running = False
def threadfunc(self): self.running = True while True: cmd = pyrawmidi.read() if not self.run: break if cmd[0]==0xB0 and cmd[1]==0x11: self.frame.postsliderval(cmd[1], cmd[2]) else: printcmd(cmd) self.running = False
def midiinthread(): while 1: cmd = pyrawmidi.read() printcmd(cmd)
#!/usr/bin/env python import pyrawmidi def printcmd(cmd): for b in cmd: print "%02X " % b , print pyrawmidi.open("hw:1,0,1") while 1: cmd = pyrawmidi.read() printcmd(cmd)