Exemplo n.º 1
0
def _panic_bypass():
    # send all notes off (CC #123) and sustain off (CC #64) to all output
    # ports and on all channels
    for p in _engine.out_ports():
        for c in range(16):
            _engine.output_event(_event.CtrlEvent(p, _util.offset(c), 123, 0))
            _engine.output_event(_event.CtrlEvent(p, _util.offset(c), 64, 0))
Exemplo n.º 2
0
def printSysex(ev):                                                                                                                                            
#  print ev.sysex                                                                                                                                              
  asciiSysex = binascii.hexlify(ev.sysex)                                                                                                                      
  print(binascii.hexlify(ev.sysex))                                                                                                                            
  print '%.5s' % (binascii.hexlify(ev.sysex))                                                                                                                  
  print asciiSysex[16:18]                                                                                                                                      
  print asciiSysex[18:20]                                                                                                                                      
  midiCC = int(asciiSysex[18:20],16)                                                                                                                           
  print midiCC                                                                                                                                                 
  print event.CtrlEvent(1,1,9,midiCC )                                                                                                                         
  print Ctrl(1,1,9,midiCC)                                                                                                                                     
  return event.CtrlEvent(1,1,9,midiCC )                                                                                                                        
Exemplo n.º 3
0
 def matrix_button_event(this, x, y, type):
     events = []
     if type == Launchpad.PRESS:
         pedal_value = this.sustains[this.selected_channel]
         this.selected_channel = y * this.rect.w + x + 1
         # If pedal was depressed before switching, transfer its CC value to
         # the new channel:
         if pedal_value > 0:
             this.sustains[this.selected_channel] = pedal_value
             events.append(
                 mididings_event.CtrlEvent(this.output_port,
                                           this.selected_channel, CC_PEDAL,
                                           pedal_value))
         print "ChannelRouter: switched to channel %d" % this.selected_channel
         this.update_colors()
     return events
Exemplo n.º 4
0
 def track_notes(this, event):
     events = []
     if event.type == NOTEON:
         this.noteons[this.selected_channel][event.note] = this.NOTE_PRESSED
     elif event.type == NOTEOFF:
         for channel, notes in this.noteons.iteritems():
             if channel != this.selected_channel and notes.get(
                     event.note) == this.NOTE_PRESSED:
                 del notes[event.note]
                 events.append(
                     mididings_event.NoteOffEvent(this.output_port, channel,
                                                  event.note))
     elif event.type == CTRL and event.ctrl == CC_PEDAL:
         this.sustains[this.selected_channel] = event.value
         for channel, pedal_value in this.sustains.iteritems():
             if channel != this.selected_channel and pedal_value > 0:
                 this.sustains[channel] = event.value
                 events.append(
                     mididings_event.CtrlEvent(this.output_port, channel,
                                               CC_PEDAL, event.value))
     return events
Exemplo n.º 5
0
 def set_ctrl_button(this, x, color):
     return [
         mididings_event.CtrlEvent(this.control_output_port, 1,
                                   ctrl_button_id(x), color)
     ]