Beispiel #1
0
	def __init__(self, c_instance):
		ControlSurface.__init__(self, c_instance)
		self._monomod_version = 'b994'
		self.hosts = []
		self._host_name = 'BlockPad'
		self._color_type = 'Monochrome'
		self._timer = 0
		is_momentary = True
		self._suggested_input_port = 'block (Controls)'
		self._suggested_output_port = 'block (Controls)'
		self._wrote_user_byte = False
		matrix = ButtonMatrixElement()
		for row in range(8):
			button_row = [ FlashingButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, ((column * 8) + row), 'Button_'+str(column)+'_'+str(row), self) for column in range(8) ]
			matrix.add_row(tuple(button_row))
		knobs = [ EncoderElement(MIDI_CC_TYPE, 0, KNOB_CC[index], Live.MidiMap.MapMode.absolute) for index in range(8) ]
		sliders = [ EncoderElement(MIDI_CC_TYPE, 0, SLIDER_CC[index], Live.MidiMap.MapMode.absolute) for index in range(2) ]
		self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0)
		self._config_button.add_value_listener(self._config_value)
		top_buttons = [ FlashingButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, TOP_NOTES[index], 'Top_Button'+str(index), self) for index in range(8) ]
		side_buttons = [ FlashingButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, SIDE_NOTES[index], 'Side_Button'+str(index), self) for index in range(8) ]
		self._setup_monobridge()
		self._setup_monomod()
		self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, tuple(knobs), tuple(sliders), self)
		self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
		self._user_byte_value(1)
		self._user_byte_write_button.add_value_listener(self._user_byte_value)
		self.set_enabled(True)
		self.log_message("--------------= BlockPad log opened =--------------") #Create entry in log file
		self.refresh_state()
Beispiel #2
0
 def _setup_controls(self):
   is_momentary = True
   self._knob = [None for index in range(16)]
   self._fader = [None for index in range(8)]
   self._button = [None for index in range(16)]
   self._mfader = [None for index in range(1)]
   self._lcd = [None for index in range(2)]
   self._encoder = [None for index in range(1)]
   for index in range(16):
     self._tfader[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL, ALIAS8_KNOBS[index], Live.MidiMap.MapMode.absolute)
     self._tfader[index].name = 'knob[' + str(index) + ']'
   for index in range(8):
     self._tfader_touch[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL, ALIAS8_FADERS[index], Live.MidiMap.MapMode.absolute)
     self._tfader_touch[index].name = 'fader[' + str(index) + ']'
   for index in range(16):
     self._pad[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, ALIAS8_BUTTONS[index])
     self._pad[index].name = 'btn[' + str(index) + ']'
   for index in range(1):
     self._pad_cc[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL, ALIAS8_MFADER[index], Live.MidiMap.MapMode.absolute)
     self._pad_cc[index].name = 'mfader[' + str(index) + ']'
   for index in range(1):
     self._tbutton[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL, ALIAS8_ENCODER[index], Live.MidiMap.MapMode.absolute)
     self._tbutton[index].name = 'enc[' + str(index) + ']'
   for index in range(2):
     self._button[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, ALIAS8_LCD[index])
     self._button[index].name = 'lcd[' + str(index) + ']' 
Beispiel #3
0
    def _create_controls(self):

        self._pad_leds = ButtonMatrixElement(rows=[[
            SysexValueControl(message_prefix=SETUP_MSG_PREFIX +
                              (WRITE_COMMAND, WORKING_MEMORY_ID,
                               COLOR_PROPERTY, column + 112 + row * 8),
                              default_value=(0, ),
                              name='Pad_LED_%d' % (column, ))
            for column in xrange(8)
        ] for row in xrange(pages)],
                                             name='Pad_LED_Matrix')

        self._device_controls = ButtonMatrixElement(rows=[[
            EncoderElement(MIDI_CC_TYPE,
                           self.encoder_msg_channel,
                           identifier,
                           Live.MidiMap.MapMode.relative_smooth_two_compliment,
                           name='Encoder_%d_%d' % (column_index, row_index))
            for column_index, identifier in enumerate(row)
        ] for row_index, row in enumerate((self.encoder_msg_ids[1:5],
                                           self.encoder_msg_ids[9:13]))])

        self._horizontal_scroll_encoder = EncoderElement(
            MIDI_CC_TYPE,
            self.encoder_msg_channel,
            self.encoder_msg_ids[0],
            Live.MidiMap.MapMode.relative_smooth_two_compliment,
            name='Horizontal_Scroll_Encoder')
        self._vertical_scroll_encoder = EncoderElement(
            MIDI_CC_TYPE,
            self.encoder_msg_channel,
            self.encoder_msg_ids[8],
            Live.MidiMap.MapMode.relative_smooth_two_compliment,
            name='Vertical_Scroll_Encoder')
        pass
Beispiel #4
0
    def __init__(self, hyperion, mod_num, *a, **kw):
        super(HyperionChan, self).__init__(*a, **kw)

        self.hyperion = hyperion
        self.mod_num = mod_num

        self._track_selector_encoder = EncoderElement(MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 0x15, Live.MidiMap.MapMode.relative_smooth_binary_offset) # Right encoder on Hyperion
        self._track_selector_encoder.add_value_listener(self._on_track_selector_encoder)

        self._fader = SliderElement(MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 0x25)
        self._pots = [
            EncoderElement(MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 0x1E + num, Live.MidiMap.MapMode.absolute, name='Pot{}'.format(num))
            for num in range(8)
        ]
        self._btns = [
            ButtonElement(True, MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 1 + num, name='Btn{}'.format(num))
            for num in range(8)
        ]
        self._enc_right_btn = ButtonElement(True, MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 10, name='EncRightBtn')
        self._enc_right_btn.add_value_listener(self._on_enc_right_btn)

        #self._cs = ChannelStripComponent()
        #self._cs.set_volume_control(self._fader)
        self._vu_slider = SliderElement(MIDI_CC_TYPE, MIDI_MASTER_CH + 1 + mod_num, 60)

        self._vu = VUMeter(self)

        self._track = None

        tracks = self._get_all_tracks(self.hyperion.song().tracks)
        if len(tracks) > self.mod_num:
            self._bind_to_track(tracks[self.mod_num])
        else:
            self._bind_to_track(None)
Beispiel #5
0
 def _setup_controls(self):
     self.log('_setup_controls')
     self._track_offset_control = EncoderElement(MIDI_CC_TYPE, 15, 120, Live.MidiMap.MapMode.absolute)
     self._track_offset_control.value = 0
     self._track_offset_control.name = 'Track_Offset'
     self._scene_offset_control = EncoderElement(MIDI_CC_TYPE, 15, 121, Live.MidiMap.MapMode.absolute)
     self._scene_offset_control.value = 0
     self._scene_offset_control.name = 'Scene_Offset'
Beispiel #6
0
 def _setup_mixer_control(self):
     is_momentary = True
     self._mixer = SpecialMixerComponent(8)
     self._mixer.name = 'Mixer'
     self._mixer.master_strip().name = 'Master_Channel_Strip'
     self._mixer.selected_strip().name = 'Selected_Channel_Strip'
     self._solo_buttons = []  # added a
     self._select_buttons = []  # added a
     for track in range(8):
         strip = self._mixer.channel_strip(track)
         strip.name = 'Channel_Strip_' + str(track)
         volume_control = EncoderElement(
             MIDI_CC_TYPE, track, 7, Live.MidiMap.MapMode.absolute
         )  # 'Slider_' + str(track), track, self)
         arm_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 48)
         solo_button = AumPCMonoButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              track, 50,
                                              str(track) + '_Solo_Button',
                                              self)
         self._solo_buttons.append(solo_button)  # added a
         mute_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track,
                                     49)
         select_button = AumPCMonoButtonElement(
             is_momentary, MIDI_NOTE_TYPE, track, 51,
             str(track) + '_Select_Button', self)
         self._select_buttons.append(select_button)  # added a
         #volume_control.name = str(track) + '_Volume_Control'
         arm_button.name = str(track) + '_Arm_Button'
         #solo_button.name = str(track) + '_Solo_Button'
         mute_button.name = str(track) + '_Mute_Button'
         #select_button.name = str(track) + '_Select_Button'
         strip.set_volume_control(volume_control)
         strip.set_arm_button(arm_button)
         strip.set_solo_button(solo_button)
         strip.set_mute_button(mute_button)
         strip.set_select_button(select_button)
         strip.set_shift_button(self._shift_button)
         strip.set_invert_mute_feedback(True)
     crossfader = SliderElement(MIDI_CC_TYPE, 0, 15)
     self._crossfader = crossfader
     self._crossfader.name = 'Crossfader'
     master_volume_control = SliderElement(MIDI_CC_TYPE, 0, 14)
     master_select_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0,
                                          80)
     self._master_select_button = master_select_button
     prehear_control = EncoderElement(
         MIDI_CC_TYPE, 0, 47, Live.MidiMap.MapMode.relative_two_compliment)
     crossfader.name = 'Crossfader'
     master_volume_control.name = 'Master_Volume_Control'
     master_select_button.name = 'Master_Select_Button'
     prehear_control.name = 'Prehear_Volume_Control'
     self._mixer.set_crossfader_control(crossfader)
     self._mixer.set_prehear_volume_control(prehear_control)
     self._mixer.master_strip().set_volume_control(master_volume_control)
     self._mixer.master_strip().set_select_button(master_select_button)
Beispiel #7
0
    def _setup_mixer_control(self):
        is_momentary = True
        mixer = MixerComponent(NUM_TRACKS, 2)
        for track in range(NUM_TRACKS):
            strip = mixer.channel_strip(track)
            strip.set_volume_control(SliderElement(MIDI_CC_TYPE, track, 23))
            strip.set_pan_control(
                EncoderElement(MIDI_CC_TYPE, track, 10,
                               Live.MidiMap.MapMode.absolute))
            strip.set_send_controls(
                (EncoderElement(MIDI_CC_TYPE, track, 19,
                                Live.MidiMap.MapMode.absolute),
                 EncoderElement(MIDI_CC_TYPE, track, 20,
                                Live.MidiMap.MapMode.absolute)))
            strip.set_solo_button(
                ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 64))
            strip.set_mute_button(
                ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 63))
            strip.set_crossfade_toggle(
                ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 65))
            eq = mixer.track_eq(track)
            eq.set_gain_controls(
                tuple([
                    EncoderElement(MIDI_CC_TYPE, track, 18 - index,
                                   Live.MidiMap.MapMode.absolute)
                    for index in range(3)
                ]))
            eq.set_cut_buttons(
                tuple([
                    ButtonElement(is_momentary, MIDI_NOTE_TYPE, track,
                                  62 - index) for index in range(3)
                ]))
            filter = mixer.track_filter(track)
            filter.set_filter_controls(
                EncoderElement(MIDI_CC_TYPE, track, 22,
                               Live.MidiMap.MapMode.absolute),
                EncoderElement(MIDI_CC_TYPE, track, 21,
                               Live.MidiMap.MapMode.absolute))

        for ret_track in range(2):
            strip = mixer.return_strip(ret_track)
            strip.set_volume_control(
                SliderElement(MIDI_CC_TYPE, 12, 22 + ret_track))
            strip.set_pan_control(
                EncoderElement(MIDI_CC_TYPE, 12, 20 + ret_track,
                               Live.MidiMap.MapMode.absolute))
            strip.set_mute_button(
                ButtonElement(is_momentary, MIDI_NOTE_TYPE, 12,
                              78 + ret_track))

        mixer.set_crossfader_control(SliderElement(MIDI_CC_TYPE, 12, 8))
        mixer.set_prehear_volume_control(
            EncoderElement(MIDI_CC_TYPE, 12, 24,
                           Live.MidiMap.MapMode.absolute))
        mixer.master_strip().set_volume_control(
            SliderElement(MIDI_CC_TYPE, 12, 7))
        mixer.master_strip().set_pan_control(
            EncoderElement(MIDI_CC_TYPE, 12, 10,
                           Live.MidiMap.MapMode.absolute))
        return mixer
Beispiel #8
0
 def _setup_controls(self):
     is_momentary = True
     self._tfader = [None for index in range(9)]
     self._tfader_touch = [None for index in range(9)]
     self._pad = [None for index in range(32)]
     self._pad_cc = [None for index in range(32)]
     self._button = [None for index in range(8)]
     self._tbutton = [None for index in range(8)]
     self._runnerled = [None for index in range(8)]
     self._sideled = [None for index in range(8)]
     self._lcd = [None for index in range(2)]
     for index in range(9):
         self._tfader[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                              BASE_TOUCHSTRIPS[index],
                                              Live.MidiMap.MapMode.absolute)
         self._tfader[index].name = 'fader[' + str(index) + ']'
     for index in range(9):
         self._tfader_touch[index] = ButtonElement(is_momentary,
                                                   MIDI_NOTE_TYPE, CHANNEL,
                                                   BASE_TOUCHSTRIPS[index])
         self._tfader_touch[index].name = 'fadertouch[' + str(index) + ']'
     for index in range(32):
         self._pad[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                          CHANNEL, BASE_PADS[index])
         self._pad[index].name = 'pad[' + str(index) + ']'
     for index in range(32):
         self._pad_cc[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                              BASE_PADS[index],
                                              Live.MidiMap.MapMode.absolute)
         self._pad_cc[index].name = 'padcc[' + str(index) + ']'
     for index in range(8):
         self._button[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                             CHANNEL, BASE_BUTTONS[index])
         self._button[index].name = 'btn[' + str(index) + ']'
     for index in range(8):
         self._tbutton[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              CHANNEL,
                                              BASE_TOUCHPADS[index])
         self._tbutton[index].name = 'topbtn[' + str(index) + ']'
     for index in range(8):
         self._runnerled[index] = ButtonElement(is_momentary,
                                                MIDI_NOTE_TYPE, CHANNEL,
                                                BASE_RUNNERS[index])
         self._runnerled[index].name = 'runnerled[' + str(index) + ']'
     for index in range(8):
         self._sideled[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              CHANNEL, BASE_SIDES[index])
         self._sideled[index].name = 'sideled[' + str(index) + ']'
     for index in range(2):
         self._lcd[index] = ButtonElement(is_momentary, MIDI_CC_TYPE,
                                          CHANNEL, BASE_LCDS[index])
         self._lcd[index].name = 'lcd[' + str(index) + ']'
 def _setup_controls(self):
     is_momentary = True
     self._tfader = [None for index in range(9)]
     self._tfader_touch = [None for index in range(9)]
     self._pad = [None for index in range(32)]
     self._pad_cc = [None for index in range(32)]
     self._button = [None for index in range(8)]
     self._tbutton = [None for index in range(8)]
     self._runnerled = [None for index in range(8)]
     self._sideled = [None for index in range(8)]
     self._lcd = [None for index in range(2)]
     for index in range(3):
         self._tfader[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                              GW_TOUCHSTRIPS[index],
                                              Live.MidiMap.MapMode.absolute)
         self._tfader[index].name = 'fader[' + str(index) + ']'
     for index in range(3):
         self._tfader_touch[index] = ButtonElement(is_momentary,
                                                   MIDI_NOTE_TYPE, CHANNEL,
                                                   GW_TOUCHSTRIPS[index])
         self._tfader_touch[index].name = 'fadertouch[' + str(index) + ']'
     for index in range(4):
         self._pad[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                          CHANNEL, GW_PADS[index])
         self._pad[index].name = 'pad[' + str(index) + ']'
     for index in range(4):
         self._pad_cc[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                              GW_PADS[index],
                                              Live.MidiMap.MapMode.absolute)
         self._pad_cc[index].name = 'padcc[' + str(index) + ']'
     for index in range(4):
         self._button[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                             CHANNEL, GW_BUTTONS[index])
         self._button[index].name = 'btn[' + str(index) + ']'
     for index in range(2):
         self._tbutton[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              CHANNEL, GW_ARROWS[index])
         self._tbutton[index].name = 'arrow[' + str(index) + ']'
     for index in range(4):
         self._sideled[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              CHANNEL, GW_SIDES[index])
         self._sideled[index].name = 'sidebtn[' + str(index) + ']'
     for index in range(1):
         self._sideled[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                              CHANNEL,
                                              GW_MOTIONBUTTON[index])
         self._sideled[index].name = 'motionbtn[' + str(index) + ']'
     for index in range(3):
         self._sideled[index] = EncoderElement(
             MIDI_CC_TYPE, CHANNEL, GW_MOTION[index],
             Live.MidiMap.MapMode.absolute)
         self._sideled[index].name = 'motion[' + str(index) + ']'
Beispiel #10
0
 def _setup_controls(self):
     is_momentary = True
     self._fader = [None for index in range(8)]
     self._dial = [None for index in range(16)]
     self._button = [None for index in range(8)]
     self._menu = [None for index in range(6)]
     for index in range(8):
         self._fader[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                             OHM_FADERS[index],
                                             Live.MidiMap.MapMode.absolute)
         self._fader[index].name = 'Fader_' + str(index), self
     for index in range(8):
         self._button[index] = MonoButtonElement(is_momentary,
                                                 MIDI_NOTE_TYPE, CHANNEL,
                                                 OHM_BUTTONS[index],
                                                 'Button_' + str(index),
                                                 self)
     for index in range(16):
         self._dial[index] = EncoderElement(MIDI_CC_TYPE, CHANNEL,
                                            OHM_DIALS[index],
                                            Live.MidiMap.MapMode.absolute)
         self._dial[index].name = 'Dial_' + str(index)
     for index in range(6):
         self._menu[index] = MonoButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                               CHANNEL, OHM_MENU[index],
                                               'Menu_' + str(index), self)
     self._crossfader = EncoderElement(MIDI_CC_TYPE, CHANNEL, CROSSFADER,
                                       Live.MidiMap.MapMode.absolute)
     self._crossfader.name = "Crossfader"
     self._livid = MonoButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL,
                                     LIVID, 'Livid_Button', self)
     self._shift_l = MonoButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                       CHANNEL, SHIFT_L, 'Page_Button_Left',
                                       self)
     self._shift_r = MonoButtonElement(is_momentary, MIDI_NOTE_TYPE,
                                       CHANNEL, SHIFT_R,
                                       'Page_Button_Right', self)
     self._matrix = ButtonMatrixElement()
     self._matrix.name = 'Matrix'
     self._grid = [None for index in range(8)]
     for column in range(8):
         self._grid[column] = [None for index in range(8)]
         for row in range(8):
             self._grid[column][row] = MonoButtonElement(
                 is_momentary, MIDI_NOTE_TYPE, CHANNEL, (column * 8) + row,
                 'Grid_' + str(column) + '_' + str(row), self)
     for row in range(6):
         button_row = []
         for column in range(7):
             button_row.append(self._grid[column][row])
         self._matrix.add_row(tuple(button_row))
Beispiel #11
0
 def _create_encoders(self):
     # hack, placeholder control so we can get to arbitrary parameters
     # in a device
     self._dummy_encoder = EncoderElement(MIDI_CC_TYPE, CHAN + 1, 0x7f,
                                          Live.MidiMap.MapMode.absolute)
     self._encoders = []
     self._sliders = []
     for row in (ROW1_ENCODERS_CCS, ROW2_ENCODERS_CCS, ROW3_ENCODERS_CCS,
                 ROW4_ENCODERS_CCS):
         for n in row:
             self._encoders.append(
                 EncoderElement(MIDI_CC_TYPE, CHAN, n,
                                Live.MidiMap.MapMode.absolute))
             self._sliders.append(SliderElement(MIDI_CC_TYPE, CHAN, n))
Beispiel #12
0
    def _create_controls(self):
        self._device_encoders = ButtonMatrixElement(rows=[[
            EncoderElement(MIDI_CC_TYPE,
                           ENCODER_CHANNEL,
                           identifier,
                           Live.MidiMap.MapMode.relative_smooth_binary_offset,
                           name=b'Device_Encoder_%d_%d' %
                           (col_index, row_index))
            for col_index, identifier in enumerate(row)
        ] for row_index, row in enumerate((ENCODER_MSG_IDS[:4],
                                           ENCODER_MSG_IDS[4:8]))])
        self._horizontal_scroll_encoder = EncoderElement(
            MIDI_CC_TYPE,
            ENCODER_CHANNEL,
            ENCODER_MSG_IDS[(-2)],
            Live.MidiMap.MapMode.relative_smooth_binary_offset,
            name=b'Horizontal_Scroll_Encoder')
        self._vertical_scroll_encoder = EncoderElement(
            MIDI_CC_TYPE,
            ENCODER_CHANNEL,
            ENCODER_MSG_IDS[(-1)],
            Live.MidiMap.MapMode.relative_smooth_binary_offset,
            name=b'Vertical_Scroll_Encoder')
        self._volume_sliders = ButtonMatrixElement(rows=[[
            SliderElement(MIDI_CC_TYPE, ENCODER_CHANNEL, identifier)
            for identifier in SLIDER_MSG_IDS[:-1]
        ]])
        self._master_slider = SliderElement(MIDI_CC_TYPE, ENCODER_CHANNEL,
                                            SLIDER_MSG_IDS[(-1)])

        def make_keylab_button(name):
            button = ButtonElement(True,
                                   MIDI_CC_TYPE,
                                   0,
                                   get_button_identifier_by_name(name),
                                   name=name.title())
            return button

        for button_name in BUTTON_HARDWARE_AND_MESSAGE_IDS.keys():
            setattr(self, b'_' + button_name, make_keylab_button(button_name))

        self._pads = ButtonMatrixElement(rows=[[
            ButtonElement(True,
                          MIDI_CC_TYPE,
                          PAD_CHANNEL,
                          col_index + row_offset,
                          name=b'Pad_%d_%d' % (col_index, row_index))
            for col_index in xrange(4)
        ] for row_index, row_offset in enumerate(xrange(48, 35, -4))])
Beispiel #13
0
 def setup_mixer(self):
     global mixer
     mixer = MixerComponent(2, 2)
     mixer.set_track_offset(0)
     self.song().view.selected_track = mixer.channel_strip(
         0
     )._track  # set the selected strip to the first track, so that we don't, for example, try to assign a button to arm the master track, which would cause an assertion error
     send_a = EncoderElement(MIDI_CC_TYPE, CHANNEL, SEND_A, mode_absolute)
     send_b = EncoderElement(MIDI_CC_TYPE, CHANNEL, SEND_B, mode_absolute)
     send_c = EncoderElement(MIDI_CC_TYPE, CHANNEL, SEND_C, mode_absolute)
     send_d = EncoderElement(MIDI_CC_TYPE, CHANNEL, SEND_D, mode_absolute)
     pan = EncoderElement(MIDI_CC_TYPE, CHANNEL, PAN, mode_absolute)
     mixer.selected_strip().set_send_controls(
         [send_a, send_b, send_c, send_d])
     mixer.selected_strip().set_pan_control(pan)
 def make_mixer_encoder(cc, channel, name):
     if is_valid_midi_identifier(cc) and is_valid_midi_channel(channel):
         return EncoderElement(MIDI_CC_TYPE,
                               channel,
                               cc,
                               volume_map_mode,
                               name=name)
Beispiel #15
0
    def __init__(self, c_instance):
        ControlSurface.__init__(self, c_instance)
        #self.log_message(time.strftime("%d.%m.%Y %H:%M:%S", time.localtime()) + "--------------= PocketDial log opened =--------------")

        # turn off rebuild MIDI map until after setup
        #self._set_suppress_rebuild_requests(True)
        with self.component_guard():
            self._controls = [
                EncoderElement(MIDI_CC_TYPE, settings.CHANNEL, cc,
                               settings.MAP_MODE) for cc in settings.CCS
            ]

            mixer = MixerControl(self)
            session = SessionControl(self)
            device = DeviceControl(self)
            track = TrackControl(self)

            # bind mixer to session
            session.component.set_mixer(mixer.component)
            self.set_highlighting_session_component(session.component)

            # "magic" internal self._device_component, which enables lock to device, etc.
            self.set_device_component(device.component)

            # register components (Live 8 only?)
            #self._register_component(session.component)
            #self._register_component(mixer.component)
            #self._register_component(device.component)

            self._device = device
            self._track = track
Beispiel #16
0
	def _setup_controls(self):
		is_momentary = True
		self._dial = [None for index in range(DIALCOUNT)]
		self._trackbtns = [None for index in range(8)]
		self._modebtns = [None for index in range(5)]
		for index in range(DIALCOUNT):
			self._dial[index] = EncoderElement(MIDI_CC_TYPE, CH, matrix_nums[index], Live.MidiMap.MapMode.absolute)
			self._dial[index].name = 'Dial_' + str(index)
			self._dial[index].set_feedback_delay(-1)
		for index in range(8):
			self._trackbtns[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CH, track_select_notes[index])
			self._trackbtns[index].name =  'Button_' + str(index)
		for index in range(5):
			self._modebtns[index] = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CH, mode_select_notes[index])
			self._modebtns[index].name = 'ModeButton_' + str(index)
		self._matrix = ButtonMatrixElement()
		self._matrix.name = 'Matrix'
		self._grid = [None for index in range(COLS)]
		for column in range(COLS):
			self._grid[column] = [None for index in range(COLS)]
			for row in range(ROWS):
				nn = 1+(column * ROWS) + row
				self._grid[column][row] = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CH, nn) #comment out if you don't want clip launch
				self._grid[column][row].name = 'Grid_' + str(column) + '_' + str(row)
		for row in range(ROWS):
			button_row = []
			for column in range(COLS):
				button_row.append(self._grid[column][row])
			self._matrix.add_row(tuple(button_row)) 
Beispiel #17
0
 def _setup_mixer_control(self):
     is_momentary = True
     mixer = MixerComponent(1)
     mixer.selected_strip().set_mute_button(
         SysexButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL,
                            KMK_PAD[9]))
     mixer.selected_strip().set_solo_button(
         SysexButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL,
                            KMK_PAD[13]))
     mixer.set_select_buttons(
         SysexButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL,
                            KMK_PAD[15]),
         SysexButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL,
                            KMK_PAD[14]))
     send_faders = []
     NUM_CONTROLLABLE_SENDS = 4
     for index in range(NUM_CONTROLLABLE_SENDS):
         send_faders.append(
             SliderElement(MIDI_CC_TYPE, CHANNEL, KMK_FADER[index + 2]))
     mixer.selected_strip().set_volume_control(
         SliderElement(MIDI_CC_TYPE, CHANNEL, KMK_FADER[0]))
     mixer.selected_strip().set_pan_control(
         SliderElement(MIDI_CC_TYPE, CHANNEL, KMK_FADER[1]))
     mixer.selected_strip().set_send_controls(tuple(send_faders))
     mixer.set_prehear_volume_control(
         EncoderElement(MIDI_CC_TYPE, CHANNEL, KMK_FADER[6],
                        Live.MidiMap.MapMode.absolute))
     mixer.master_strip().set_volume_control(
         SliderElement(MIDI_CC_TYPE, CHANNEL, KMK_FADER[7]))
     return mixer
Beispiel #18
0
    def _setup_device_and_transport_control(self):
        is_momentary = True
        device_param_controls = []
        for index in range(8):
            device_param_controls.append(
                EncoderElement(MIDI_CC_TYPE, 15, 62 - index,
                               Live.MidiMap.MapMode.absolute))

        device = SpecialDeviceComponent()
        device.set_bank_nav_buttons(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 107),
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 106))
        device.set_parameter_controls(tuple(device_param_controls))
        self.set_device_component(device)
        transport = SpecialTransportComponent()
        transport.set_play_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 20))
        transport.set_stop_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 21))
        transport.set_record_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 22))
        transport.set_seek_buttons(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 24),
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 25))
        transport.set_tap_tempo_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 94))
        transport.set_undo_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 23))
        transport.set_redo_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 27))
        transport.set_bts_button(
            ButtonElement(is_momentary, MIDI_CC_TYPE, 15, 26))
Beispiel #19
0
    def __init__(self, c_instance):
        ControlSurface.__init__(self, c_instance)
        with self.component_guard():
            is_momentary = True
            self._suggested_input_port = 'Oxygen'
            self._suggested_output_port = 'Oxygen'
            self._has_slider_section = True
            self._device_selection_follows_track_selection = True
            self._shift_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 57)
            self._shift_button.add_value_listener(self._shift_value)
            self._mixer = SpecialMixerComponent(NUM_TRACKS)
            self._mute_solo_buttons = []
            self._track_up_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 111)
            self._track_down_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 110)
            self._master_slider = SliderElement(MIDI_CC_TYPE, GLOBAL_CHANNEL, 41)
            for index in range(NUM_TRACKS):
                self._mute_solo_buttons.append(ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 49 + index))
                self._mixer.channel_strip(index).set_volume_control(SliderElement(MIDI_CC_TYPE, GLOBAL_CHANNEL, 33 + index))

            self._shift_value(0)
            self._mixer.master_strip().set_volume_control(self._master_slider)
            self._mixer.selected_strip().set_volume_control(None)
            device = DeviceComponent()
            device.set_parameter_controls(tuple([ EncoderElement(MIDI_CC_TYPE, GLOBAL_CHANNEL, 17 + index, Live.MidiMap.MapMode.absolute) for index in range(8) ]))
            self.set_device_component(device)
            ffwd_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 115)
            rwd_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 114)
            loop_button = ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 113)
            transport = TransportComponent()
            transport.set_stop_button(ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 116))
            transport.set_play_button(ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 117))
            transport.set_record_button(ButtonElement(is_momentary, MIDI_CC_TYPE, GLOBAL_CHANNEL, 118))
            session = SessionComponent(0, 0)
            transport_view_modes = TransportViewModeSelector(transport, session, ffwd_button, rwd_button, loop_button)
Beispiel #20
0
	def _create_controls(self):
		make_color_button = partial(make_button, skin=self._skin)
		self._shift_button = make_button(0, 81, name='Shift_Button', num = 0, cs = self)
		self._matrix = ButtonMatrixElement(name='Button_Matrix')
		self._scene_launch_buttons_raw = [ make_color_button(0, index + 82, name='Scene_%d_Launch_Button' % index, num = index, cs = self) for index in xrange(SESSION_HEIGHT) ]
		self._track_stop_buttons = [ make_color_button(index, 52, name='Track_%d_Stop_Button' % index, num = index, cs = self) for index in xrange(SESSION_WIDTH) ]
		self._matrix_rows_raw = []
		for scene_index in xrange(SESSION_HEIGHT):
			row = [ make_color_button(track_index, scene_index + 53, name='%d_Clip_%d_Button' % (track_index, scene_index), num = index, cs = self) for track_index in xrange(SESSION_WIDTH) ]
			self._matrix_rows_raw.append(row)
			self._matrix.add_row(row)

		self._selected_scene_launch_button = make_pedal_button(64, name='Selected_Scene_Launch_Button')
		self._scene_launch_buttons = ButtonMatrixElement(rows=[self._scene_launch_buttons_raw])
		self._solo_buttons = [ make_button(track_index, 49, name='%d_Solo_Button' % track_index, num = track_index, cs = self) for track_index in xrange(MIXER_SIZE) ]
		self._mute_buttons = [ make_button(track_index, 50, name='%d_Mute_Button' % track_index, num = track_index, cs = self) for track_index in xrange(MIXER_SIZE) ]
		self._master_volume_control = make_slider(0, 14, name='Master_Volume_Control', num = 0, script = self)
		self._prehear_control = EncoderElement(MIDI_CC_TYPE, 0, 47, MapMode.relative_two_compliment, name='Prehear_Volume_Control', num = 0, script = self)
		self._master_select_button = make_button(0, 80, name='Master_Select_Button', num = index, cs = self)
		self._select_buttons = [ make_button(track_index, 51, name='%d_Select_Button' % track_index, num = track_index, cs = self ) for track_index in xrange(8) ]
		self._arm_buttons = [ make_button(track_index, 48, name='%d_Arm_Button' % track_index, num = track_index, cs = self) for track_index in xrange(8) ]
		self._sliders = [ make_slider(track_index, 7, name='%d_Volume_Control' % track_index, num = track_index, script = self) for track_index in xrange(8) ]

		self._monomod = ButtonMatrixElement(name = 'Monomod')
		for row in self._matrix_rows_raw:
			self._monomod.add_row(row)
		self._monomod.add_row(self._track_stop_buttons)
		self._monomod.add_row(self._select_buttons)
		self._monomod.add_row(self._mute_buttons)

		self._setup_monobridge()	#had to put this here b/c the original author foolishly placed assignment methods inside of creation methods...argh.
Beispiel #21
0
 def sequencer_init_rotaries(self):
     for rotary_encoder_cc in self.sequencer_page_cc:
         self.rotary_encoder_potis[rotary_encoder_cc] = EncoderElement(
             MIDI_CC_TYPE, 0, rotary_encoder_cc,
             Live.MidiMap.MapMode.absolute)
         self.rotary_encoder_potis[rotary_encoder_cc].add_value_listener(
             self.sequencer_rotary_change, identify_sender=True)
Beispiel #22
0
def make_encoder(channel, cc, name):
    map_mode = Live.MidiMap.MapMode.absolute
    return EncoderElement(MIDI_CC_TYPE,
                          channel,
                          cc,
                          map_mode=map_mode,
                          name=name)
    def _setup_mixer_control(self):
        is_momentary = True
        self._mixer = SpecialMixerComponent(8)
        self._mixer.name = 'Mixer'
        self._mixer.master_strip().name = 'Master_Channel_Strip'
        self._mixer.selected_strip().name = 'Selected_Channel_Strip'
        for track in range(8):
            strip = self._mixer.channel_strip(track)
            strip.name = 'Channel_Strip_' + str(track)
            solo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track,
                                        49)
            mute_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track,
                                        50)
            solo_button.name = str(track) + '_Solo_Button'
            mute_button.name = str(track) + '_Mute_Button'
            strip.set_solo_button(solo_button)
            strip.set_mute_button(mute_button)
            strip.set_shift_button(self._shift_button)
            strip.set_invert_mute_feedback(True)

        master_volume_control = SliderElement(MIDI_CC_TYPE, 0, 14)
        prehear_control = EncoderElement(
            MIDI_CC_TYPE, 0, 47, Live.MidiMap.MapMode.relative_two_compliment)
        master_volume_control.name = 'Master_Volume_Control'
        prehear_control.name = 'Prehear_Volume_Control'
        self._mixer.set_prehear_volume_control(prehear_control)
        self._mixer.master_strip().set_volume_control(master_volume_control)
def make_launch_control_encoder(identifier, name, channel=0):
    encoder = EncoderElement(MIDI_CC_TYPE, channel, identifier,
                             Live.MidiMap.MapMode.absolute)
    encoder.reset = nop
    encoder.set_feedback_delay(-1)
    encoder.name = name
    return encoder
Beispiel #25
0
	def _setup_controls( self ):  
		self._log( "_setup_controls", True )
		self._track_offset = EncoderElement( MIDI_CC_TYPE, 15, 118, Live.MidiMap.MapMode.absolute )
		self._track_offset.value = 0
		self._track_offset.name = "Track_Offset" 
		self._scene_offset = EncoderElement( MIDI_CC_TYPE, 15, 119, Live.MidiMap.MapMode.absolute ) 
		self._scene_offset.value = 0
		self._scene_offset.name = "Scene_Offset" 
		self._session_width = EncoderElement( MIDI_CC_TYPE, 15, 120, Live.MidiMap.MapMode.absolute )
		self._session_width.value = 0
		self._session_width.name = "Session_Height" 
		self._session_height = EncoderElement( MIDI_CC_TYPE, 15, 121, Live.MidiMap.MapMode.absolute ) 
		self._session_height.value = 0
		self._session_height.name = "Session_Width" 
		self.touchAble.request_rebuild_midi_map()
		self._log( "_setup_controls complete", True )
Beispiel #26
0
def make_rel_encoder(identifier, name, ch=0, skin=None):
    return EncoderElement(
        MIDI_CC_TYPE,
        ch,
        identifier,
        map_mode=Live.MidiMap.MapMode.relative_two_compliment,
        name=name)
Beispiel #27
0
	def _setup_transport_control(self):
		is_momentary = True # We'll only be using momentary buttons here
		transport = TransportComponent() #Instantiate a Transport Component
		"""set up the buttons"""
		transport.set_play_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 69)) #ButtonElement(is_momentary, msg_type, channel, identifier) Note that the MIDI_NOTE_TYPE constant is defined in the InputControlElement module
		transport.set_stop_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 70))
		#transport.set_record_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 66))
		#transport.set_overdub_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 68))
		#transport.set_nudge_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 80), ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 73)) #(up_button, down_button)
		#transport.set_tap_tempo_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 80))
		#transport.set_metronome_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 80)) #For some reason, in Ver 7.x.x this method's name has no trailing "e" , and must be called as "set_metronom_button()"...
		#transport.set_loop_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 82))
		#transport.set_punch_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 85), ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 87)) #(in_button, out_button)
		#transport.set_seek_buttons(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 90), ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 92)) # (ffwd_button, rwd_button)
		#"""set up the sliders"""
		#transport.set_tempo_control(SliderElement(MIDI_CC_TYPE, CHANNEL, 26), SliderElement(MIDI_CC_TYPE, CHANNEL, 25)) #(control, fine_control)
		#transport.set_song_position_control(SliderElement(MIDI_CC_TYPE, CHANNEL, 24))
		
		device_param_controls = []
		effects_knob_cc = [17,16,9,8,19,18,11,10]
		device = DeviceComponent()
		for index in range(8):
			device_param_controls.append(EncoderElement(MIDI_CC_TYPE, 0, effects_knob_cc[index], Live.MidiMap.MapMode.absolute))
		device.set_parameter_controls(tuple(device_param_controls))
		self.set_device_component(device)
Beispiel #28
0
    def _create_controls(self):
        make_color_button = partial(make_button, skin=self._skin)
        self._shift_button = make_button(0, 81, name='Shift_Button')
        self._matrix = ButtonMatrixElement(name='Button_Matrix')
        self._scene_launch_buttons = [ make_color_button(0, index + 82, name='Scene_%d_Launch_Button' % index) for index in xrange(SESSION_HEIGHT) ]
        self._track_stop_buttons = [ make_color_button(index, 52, name='Track_%d_Stop_Button' % index) for index in xrange(SESSION_WIDTH) ]
        for scene_index in xrange(SESSION_HEIGHT):
            row = [ make_color_button(track_index, scene_index + 53, name='%d_Clip_%d_Button' % (track_index, scene_index)) for track_index in xrange(SESSION_WIDTH) ]
            self._matrix.add_row(row)

        self._selected_scene_launch_button = make_pedal_button(64, name='Selected_Scene_Launch_Button')
        self._scene_launch_buttons = ButtonMatrixElement(name='Scene_Launch_Buttons', rows=[self._scene_launch_buttons])
        self._solo_buttons = [ make_button(track_index, 49, name='%d_Solo_Button' % track_index) for track_index in xrange(MIXER_SIZE) ]
        self._mute_buttons = [ make_button(track_index, 50, name='%d_Mute_Button' % track_index) for track_index in xrange(MIXER_SIZE) ]
        self._master_volume_control = make_slider(0, 14, name='Master_Volume_Control')
        self._prehear_control = EncoderElement(MIDI_CC_TYPE, 0, 47, MapMode.relative_two_compliment, name='Prehear_Volume_Control')
        self._master_select_button = make_button(0, 80, name='Master_Select_Button')
        self._select_buttons = [ make_button(track_index, 51, name='%d_Select_Button' % track_index) for track_index in xrange(8) ]
        self._arm_buttons = [ make_button(track_index, 48, name='%d_Arm_Button' % track_index) for track_index in xrange(8) ]
        self._sliders = [ make_slider(track_index, 7, name='%d_Volume_Control' % track_index) for track_index in xrange(8) ]
        self._note_matrix = ButtonMatrixElement(name='Note_Button_Matrix')
        self._note_buttons = [ [ make_button(9, note + i, name='Note_%d_Button' % (note + i)) for i in xrange(4) ] for note in xrange(36, 75, 4) ]
        for row in self._note_buttons:
            for button in row:
                button.send_depends_on_forwarding = False

            self._note_matrix.add_row(row)
Beispiel #29
0
 def setup_session(self):
     num_tracks = 7
     num_scenes = 1
     track_offset = 0
     scene_offset = 0
     # elements
     self.clip_launch_buttons = ButtonMatrixElement(rows=[[
         ButtonElement(True, MIDI_NOTE_TYPE, 0, 76 + i)
         for i in range(num_tracks)
     ]])
     self.clip_stop_buttons = [
         ButtonElement(True, MIDI_NOTE_TYPE, 0, 68 + i)
         for i in range(num_tracks)
     ]
     self.scene_launch_buttons = ButtonMatrixElement(rows=[[
         ButtonElement(True, MIDI_NOTE_TYPE, 0, 83 + i)
         for i in range(num_scenes)
     ]])
     self.scene_stop_button = ButtonElement(True, MIDI_NOTE_TYPE, 0, 75)
     self.session_scene_nav_encoder = EncoderElement(
         MIDI_CC_TYPE, 0, 15, Live.MidiMap.MapMode.relative_binary_offset)
     # session
     self.session = SessionComponent(num_tracks, num_scenes)
     self.session.set_offsets(track_offset, scene_offset)
     self.session.add_offset_listener(self.on_session_offset_changed)
     self.set_highlighting_session_component(self.session)
     # clips
     self.session.set_clip_launch_buttons(self.clip_launch_buttons)
     self.session.set_stop_track_clip_buttons(self.clip_stop_buttons)
     self.session.set_scene_launch_buttons(self.scene_launch_buttons)
     self.session.set_stop_all_clips_button(self.scene_stop_button)
     # nav
     self.session_scene_nav_encoder.add_value_listener(
         self.on_session_scene_nav)
 def _create_controls(self):
     self._device_controls = ButtonMatrixElement(rows=[ [ EncoderElement(MIDI_CC_TYPE, 0, identifier, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Encoder_%d_%d' % (column_index, row_index)) for column_index, identifier in enumerate(row) ] for row_index, row in enumerate((ENCODER_MSG_IDS[:4], ENCODER_MSG_IDS[8:12])) ])
     self._horizontal_scroll_encoder = EncoderElement(MIDI_CC_TYPE, 0, 75, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Horizontal_Scroll_Encoder')
     self._vertical_scroll_encoder = EncoderElement(MIDI_CC_TYPE, 0, 72, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Vertical_Scroll_Encoder')
     self._volume_encoder = EncoderElement(MIDI_CC_TYPE, 0, 91, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Volume_Encoder')
     self._pan_encoder = EncoderElement(MIDI_CC_TYPE, 0, 17, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Pan_Encoder')
     self._send_a_encoder = EncoderElement(MIDI_CC_TYPE, 0, 77, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Send_A_Encoder')
     self._send_b_encoder = EncoderElement(MIDI_CC_TYPE, 0, 93, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Send_B_Encoder')
     self._send_encoders = ButtonMatrixElement(rows=[[self._send_a_encoder, self._send_b_encoder]])
     self._return_a_encoder = EncoderElement(MIDI_CC_TYPE, 0, 73, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Return_A_Encoder')
     self._return_b_encoder = EncoderElement(MIDI_CC_TYPE, 0, 79, Live.MidiMap.MapMode.relative_smooth_two_compliment, name='Return_B_Encoder')
     self._return_encoders = ButtonMatrixElement(rows=[[self._return_a_encoder, self._return_b_encoder]])
     self._pads = ButtonMatrixElement(rows=[ [ ButtonElement(True, MIDI_NOTE_TYPE, PAD_CHANNEL, col + 36 + 8 * row, name='Pad_%d_%d' % (col, row)) for col in xrange(8) ] for row in xrange(2) ])