def draw(self): # global BackgroundThread # if BackgroundThread == None: # BackgroundThread = Background() # BackgroundThread.start() global MidiStarted if not MidiStarted: MidiStarted = True Midi.startup() m = MidiPypmHardware() outname = "loopMIDI Port 1" # Open MIDI output named try: # if outname is None, it opens default output self.o = m.get_output(outname) self.o.open() except: print "Error opening output: %s, exception: %s" % (outname,format_exc()) # Midi.shutdown() # sys.exit(1) self.quicknote() return "" # plugins (classes that extend Processor) should define this # debug("draw in Processor!") while True: e = next_event() if e == None: break debug("Processor.draw2 type="+e["type"]+" region="+e["region"]) return ""
def run(self): debug("Background run start") while True: e = next_event() if e != None: if e["type"] != "CursorDrag": debug("Background event type="+e["type"]+" region="+e["region"]) dt = 0.001 else: dt = 0.01