def handle_sysex(self, sysex):
     cmds = [
         self._note_press, self._fader_press, self._select_note,
         self._mute_note, self._scroll_time, self._scroll_note, self._zoom,
         self._set_quick_chord, self._set_selection, self._midi_action,
         self._set_root_scale, self._randomise_fader, self._set_defaults,
         self._set_fader_fn, self._set_height, self._set_fold,
         self._set_save
     ]
     cmd = sysex[0]
     if cmd < len(cmds):
         if self._clip is not None:
             cmds[cmd](LC2SysexParser(sysex[1:]))
 def handle_sysex(self, sysex):
     cmds = [self._launch_clip,
      self._launch_scene,
      self._jump_clip,
      self._set_rows,
      self._set_cols,
      self._track_stop,
      self._stop_all,
      self._set_size,
      self._select_clip,
      self._snapshot,
      self._select_send]
     if sysex[0] < len(cmds):
         cmds[sysex[0]](LC2SysexParser(sysex[1:]))
Пример #3
0
    def handle_sysex(self, sysex):
        if list(sysex).count(247) == 0:
            count = 1
        else:
            count = list(sysex).count(247)
        LC2Sysex.log_message(str(sysex))
        LC2Sysex.log_message('sysex count' + str(count))
        msysex = [ [] for i in range(count + 1) ]
        id = 0
        start = list(sysex).index(240)
        for i, b in enumerate(sysex):
            if i >= start:
                msysex[id].append(b)
                if b == 247:
                    id += 1

        LC2Sysex.log_message(str(msysex))
        pages = [self._session,
         self._mixer,
         self._sequencer,
         self._modulator]
        for sysex in msysex:
            if len(sysex) > 1:
                if sysex[1] == 5:
                    if sysex[2] == 1:
                        self._init()
                    elif sysex[2] == 2:
                        sysex = LC2SysexParser(sysex[3:])
                        interface = sysex.parse('b')
                        LC2Sysex.log_message('interface change: ' + str(interface))
                        if interface == 0 or interface == 1 or interface == 2:
                            self._mixer.set_enabled(1)
                        else:
                            self._mixer.set_enabled(0)
                elif sysex[1] < len(pages):
                    pages[sysex[1]].handle_sysex(sysex[2:])