def _setup_device(self):
        encoders = []
        for index in range(8):
            encoders.append(
                PeekableEncoderElement(
                    MIDI_CC_TYPE, 1, index,
                    Live.MidiMap.MapMode.relative_binary_offset))
            encoders[(-1)].set_feedback_delay(-1)
            encoders[(-1)].add_value_listener((self._encoder_value),
                                              identify_sender=True)
            encoders[(-1)].name = 'Device_Control_' + str(index)

        self._encoders = tuple(encoders)
        self._prev_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1,
                                               12)
        self._next_bank_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 1,
                                               11)
        self._prev_bank_button.name = 'Device_Bank_Down_Button'
        self._next_bank_button.name = 'Device_Bank_Up_Button'
        device = DeviceComponent(device_selection_follows_track_selection=True)
        device.name = 'Device_Component'
        self.set_device_component(device)
        device.set_parameter_controls(self._encoders)
        device.set_bank_nav_buttons(self._prev_bank_button,
                                    self._next_bank_button)
Esempio n. 2
0
 def _setup_device(self):
     encoders = [
         make_encoder(21 + index, 'Device_Control_%d' % index)
         for index in range(8)
     ]
     self._encoders = tuple(encoders)
     device = DeviceComponent(device_selection_follows_track_selection=True)
     device.name = 'Device_Component'
     self.set_device_component(device)
     device.set_parameter_controls(self._encoders)