示例#1
0
文件: MonoPedal.py 项目: aumhaa/m4m7
    def _setup_controls(self):
        self._pedal = [None for index in range(8)]
        for index in range(7):
            self._pedal[index] = DoublePressElement(
                MonoButtonElement(is_momentary=True,
                                  msg_type=MIDI_CC_TYPE,
                                  channel=0,
                                  identifier=PEDAL_DEFS[index],
                                  name='Pedal_' + str(index),
                                  script=self))
            self._pedal[index]._report = False
        self._pedal[7] = LoopPedalExpressionElement(
            script=self,
            msg_type=MIDI_CC_TYPE,
            channel=0,
            identifier=1,
            map_mode=Live.MidiMap.MapMode.absolute)
        self._pedal[7].name = 'Pedal_' + str(7)
        self._pedal[7]._report = False
        self._leds = [None for index in range(4)]
        for index in range(4):
            red_led = ButtonElement(True, MIDI_NOTE_TYPE, 0, LED_DEFS[index])
            green_led = ButtonElement(True, MIDI_NOTE_TYPE, 0,
                                      LED_DEFS[index] + 4)
            blue_led = ButtonElement(True, MIDI_NOTE_TYPE, 0,
                                     LED_DEFS[index] + 8)
            self._leds[index] = RGB_LED(red_led,
                                        green_led,
                                        blue_led,
                                        is_momentary=True,
                                        msg_type=MIDI_NOTE_TYPE,
                                        channel=0,
                                        identifier=index + 13,
                                        name='LED_' + str(index),
                                        script=self)
        self._select_buttons = ButtonMatrixElement()
        self._select_buttons.name = 'SelectMatrix'
        self._select_buttons.add_row(
            [self._pedal[6], self._pedal[5], self._pedal[4], self._pedal[3]])
        self._doublepress_select_buttons = ButtonMatrixElement()
        self._doublepress_select_buttons.name = 'DoublepressSelectMatrix'
        self._doublepress_select_buttons.add_row([
            self._pedal[6].double_press, self._pedal[5].double_press,
            self._pedal[4].double_press, self._pedal[3].double_press
        ])

        self._record_button = self._pedal[1]
        self._mute_button = self._pedal[2]
        self._overdub_button = self._pedal[0]
def create_button(identifier, name):
    return ButtonElement(False,
                         MIDI_CC_TYPE,
                         MIDI_CHANNEL,
                         identifier,
                         name=name,
                         skin=skin)
def make_button(identifier, name, **k):
    return ButtonElement(IS_MOMENTARY,
                         MIDI_NOTE_TYPE,
                         CHANNEL,
                         identifier,
                         name=name,
                         **k)
示例#4
0
def create_button(identifier, name, channel=0, skin=None):
    return ButtonElement(True,
                         MIDI_NOTE_TYPE,
                         channel,
                         identifier,
                         name=name,
                         skin=skin)
    def _make_note_button(self, channel, identifier, name, is_momentary=True, **k):
        return ButtonElement(
 is_momentary,
 MIDI_NOTE_TYPE,
 channel,
 identifier, skin=self._skin, 
         name=name, **k)
示例#6
0
def create_note_button(note, name, skin=None, **k):
    return ButtonElement(True,
                         MIDI_NOTE_TYPE,
                         0,
                         note,
                         skin=skin,
                         name=name,
                         **k)
示例#7
0
def create_button(identifier, name, msg_type=MIDI_CC_TYPE, **k):
    return ButtonElement(True,
                         msg_type,
                         15,
                         identifier,
                         skin=skin,
                         name=name,
                         **k)
 def __init__(self, *a, **k):
     (super(ForceElements, self).__init__)(*a, **k)
     self.clip_select_button = self._make_note_button(12, 94, 'Clip_Select_Button')
     self.master_button = self._make_note_button(12, 88, 'Master_Button')
     self.track_assign_buttons_raw = [self._make_note_button(12, index + 8, 'Track_Assign_Button_{}'.format(index)) for index in range(NUM_TRACK_CONTROLS)]
     self.track_assign_buttons = ButtonMatrixElement(rows=[
      self.track_assign_buttons_raw],
       name='Track_Assign_Buttons')
     self.track_assign_color_controls_raw = [ButtonElement(True, MIDI_CC_TYPE, 12, (index + 32), skin=(self._skin), name=('Track_Assign_Color_Control_{}'.format(index))) for index in range(NUM_TRACK_CONTROLS)]
     self.track_assign_color_controls = ButtonMatrixElement(rows=[
      self.track_assign_color_controls_raw],
       name='Track_Assign_Color_Controls')
     physical_track_select_buttons_raw = [self._make_note_button(12, index, 'Physical_Track_Select_Button_{}'.format(index)) for index in range(NUM_TRACK_CONTROLS)]
     self.track_select_buttons = ButtonMatrixElement(rows=[
      [MultiElement((self._tui_track_select_buttons_raw[index]), (physical_track_select_buttons_raw[index]), name=('Track_Select_Button_{}'.format(index))) for index in range(NUM_TRACK_CONTROLS)]],
       name='Track_Select_Buttons')
     self.physical_track_select_buttons_with_shift = ButtonMatrixElement(rows=[
      [ComboElement((physical_track_select_buttons_raw[index]), modifier=[self.shift_button], name='Physical_Track_Select_Button_With_Shift') for index in range(NUM_TRACK_CONTROLS)]],
       name='Physical_Track_Select_Buttons_With_Shift')
     self.physical_track_color_controls = ButtonMatrixElement(rows=[
      [ButtonElement(True, MIDI_CC_TYPE, 12, (index + 24), skin=(self._skin), name=('Physical_Track_Color_Control_{}'.format(index))) for index in range(NUM_TRACK_CONTROLS)]],
       name='Physical_Track_Color_Controls')
     self.force_physical_scene_launch_buttons = ButtonMatrixElement(rows=[
      [self._make_note_button(12, (index + 80), name=('Force_Physical_Scene_Launch_Button_{}'.format(index))) for index in range(NUM_SCENE_CONTROLS)]],
       name='Force_Physical_Scene_Launch_Buttons')
     self.continue_button = ComboElement((self.play_button),
       modifier=[self.shift_button], name='Continue_Button')
     self.physical_metronome_button = ComboElement((self.track_assign_buttons_raw[4]),
       modifier=[
      self.shift_button],
       name='Physical_Metronome_Button')
     self.prev_device_button = self._tui_prev_device_button
     self.next_device_button = self._tui_next_device_button
     self.prev_bank_button = self._tui_prev_bank_button
     self.next_bank_button = self._tui_next_bank_button
     self.assign_a_button = self._make_note_button(12, 119, 'Assign_A_Button')
     self.assign_b_button = self._make_note_button(12, 120, 'Assign_B_Button')
     self.phase_nudge_up_button = self._tui_phase_nudge_up_button
     self.phase_nudge_down_button = self._tui_phase_nudge_down_button
     self.quantize_button = MultiElement((self._tui_quantize_button),
       ComboElement((self.track_assign_buttons_raw[0]),
       modifier=[
      self.shift_button],
       name='Physical_Quantize_Button'),
       name='Quantize_Button')
     self.launch_button = self._make_note_button(12, 91, 'Launch_Button')
def create_button(identifier,
                  name,
                  msg_type=MIDI_CC_TYPE,
                  is_momentary=True,
                  **k):
    return ButtonElement(is_momentary,
                         msg_type,
                         MIDI_CHANNEL,
                         identifier,
                         name=name,
                         skin=skin,
                         **k)
 def _create_controls(self):
     self._encoders = ButtonMatrixElement(rows=[[
         EncoderElement(MIDI_CC_TYPE,
                        0,
                        identifier,
                        map_mode=(Live.MidiMap.MapMode.absolute),
                        name=('Volume_Encoder_{}'.format(index)))
         for index, identifier in enumerate(range(12, 20))
     ]],
                                          name='Volume_Encoders')
     self._data_encoder = EncoderElement(
         MIDI_CC_TYPE,
         0,
         22,
         map_mode=(Live.MidiMap.MapMode.relative_smooth_two_compliment),
         name='Data_Encoder')
     self._data_encoder_button = ButtonElement(True,
                                               MIDI_CC_TYPE,
                                               0,
                                               23,
                                               name='Data_Encoder_Button',
                                               skin=skin)
     self._play_button = ButtonElement(False,
                                       MIDI_CC_TYPE,
                                       0,
                                       118,
                                       name='Play_Button',
                                       skin=skin)
     self._record_button = ButtonElement(False,
                                         MIDI_CC_TYPE,
                                         0,
                                         119,
                                         name='Record_Button',
                                         skin=skin)
     self._record_stop_button = ButtonElement(False,
                                              MIDI_CC_TYPE,
                                              0,
                                              116,
                                              name='Record_Stop_Button',
                                              skin=skin)
     self._stop_button = ButtonElement(False,
                                       MIDI_CC_TYPE,
                                       0,
                                       117,
                                       name='Stop_Button',
                                       skin=skin)
     self._pads = ButtonMatrixElement(rows=[[
         ButtonElement(True,
                       MIDI_NOTE_TYPE,
                       PAD_CHANNEL,
                       identifier,
                       name=('Pad_{}'.format(index)),
                       skin=skin)
         for index, identifier in enumerate(PAD_IDS)
     ]])
示例#11
0
def make_button(identifier, name, msg_type=MIDI_CC_TYPE, skin=None):
    return ButtonElement(True, msg_type, 0, identifier, name=name, skin=skin)
示例#12
0
def create_button(identifier,
                  name,
                  channel=DEFAULT_CHANNEL,
                  msg_type=MIDI_CC_TYPE,
                  **k):
    return ButtonElement(True, msg_type, channel, identifier, name=name, **k)
示例#13
0
    def __init__(self, product_id=None, skin=None, *a, **k):
        super(Elements, self).__init__(*a, **k)
        self._product_id = product_id
        self._skin = skin
        volume_encoder_touch_elements = [ self._make_note_button(13, index, (b'Volume_Encoder_Touch_Element_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                        ]
        tui_volume_sliders = [ SliderElement(MIDI_CC_TYPE, index + 1, 0, name=(b'TUI_Volume_Slider_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                             ]
        for slider in tui_volume_sliders:
            slider.set_feedback_delay(1)

        physical_volume_encoders = [ TouchEncoderElement(MIDI_CC_TYPE, 13, index, Live.MidiMap.MapMode.relative_smooth_two_compliment, name=(b'Physical_Volume_Encoder_{}').format(index), touch_element=volume_encoder_touch_elements[index]) for index in xrange(NUM_TRACK_CONTROLS)
                                   ]
        for encoder in physical_volume_encoders:
            encoder.set_feedback_delay(1)

        self.volume_sliders = ButtonMatrixElement(rows=[
         [ MultiElement(tui_volume_sliders[index], physical_volume_encoders[index]) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Volume_Controls')
        self.pan_sliders = ButtonMatrixElement(rows=[
         [ SliderElement(MIDI_CC_TYPE, index + 1, 1, name=(b'TUI_Pan_Slider_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'TUI_Pan_Sliders')
        tui_device_controls = [ SliderElement(MIDI_CC_TYPE, 9, index, name=(b'TUI_Device_Control_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
                              ]
        for slider in tui_device_controls:
            slider.set_feedback_delay(1)

        self.tui_device_controls = ButtonMatrixElement(rows=[
         tui_device_controls], name=b'TUI_Device_Controls')
        self.physical_device_control_touch_elements = ButtonMatrixElement(rows=[
         [ self._make_note_button(13, index + 8, (b'Physical_Device_Control_Touch_Element_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'Physical_Device_Control_Touch_Elements')
        physical_device_controls = [ EncoderElement(MIDI_CC_TYPE, 13, index + 8, Live.MidiMap.MapMode.relative_smooth_two_compliment, name=(b'Physical_Device_Control_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
                                   ]
        for encoder in physical_device_controls:
            encoder.set_feedback_delay(1)

        self.physical_device_controls = ButtonMatrixElement(rows=[
         physical_device_controls], name=b'Physical_Device_Controls')
        self.device_parameter_enable_controls = ButtonMatrixElement(rows=[
         [ self._make_note_button(9, index + 112, (b'Device_Parameter_Enable_Control_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'Device_Parameter_Enable_Controls')
        self.solo_buttons_raw = [ MultiElement(self._make_note_button(index + 1, 0, (b'TUI_Solo_Button_{}').format(index)), name=(b'Solo_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                ]
        self.solo_buttons = ButtonMatrixElement(rows=[
         self.solo_buttons_raw], name=b'Solo_Buttons')
        self.mute_buttons_raw = [ MultiElement(self._make_note_button(index + 1, 1, (b'TUI_Mute_Button_{}').format(index)), name=(b'Mute_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                ]
        self.mute_buttons = ButtonMatrixElement(rows=[
         self.mute_buttons_raw], name=b'Mute_Buttons')
        self.solo_mute_buttons_raw = [ MultiElement(self._make_note_button(index + 1, 2, (b'TUI_Solo_Mute_Button_{}').format(index)), name=(b'Solo_Mute_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                     ]
        self.solo_mute_buttons = ButtonMatrixElement(rows=[
         self.solo_mute_buttons_raw], name=b'Solo_Mute_Buttons')
        self.arm_buttons_raw = [ MultiElement(self._make_note_button(index + 1, 5, (b'TUI_Arm_Button_{}').format(index)), name=(b'Arm_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                               ]
        self.arm_buttons = ButtonMatrixElement(rows=[
         self.arm_buttons_raw], name=b'Arm_Buttons')
        self.clip_stop_buttons_raw = [ MultiElement(self._make_note_button(0, index + 16, (b'Clip_Stop_TUI_Button_{}').format(index)), name=(b'Clip_Stop_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                     ]
        self.clip_stop_buttons = ButtonMatrixElement(rows=[
         self.clip_stop_buttons_raw], name=b'Clip_Stop_Buttons')
        self.stop_all_clips_button = MultiElement(self._make_note_button(12, 89, name=b'Physical_Stop_All_Clips_Button'), self._make_note_button(10, 20, name=b'TUI_Stop_All_Clips_Button'), name=b'Stop_All_Clips_Button')
        self.send_encoders = ButtonMatrixElement(rows=[ [ EncoderElement(MIDI_CC_TYPE, row_index + 1, col_index + 3, Live.MidiMap.MapMode.absolute, name=(b'TUI_Send_Encoder_{}_{}').format(row_index, col_index)) for col_index in xrange(MAX_NUM_SENDS) ] for row_index in xrange(NUM_TRACK_CONTROLS)
                                                      ], name=b'TUI_Send_Encoders')
        self.send_value_displays = ButtonMatrixElement(rows=[ [ self._create_text_display_element((1, row_index + col_index * NUM_TRACK_CONTROLS + 24), (b'Send_Value_Display_{}_{}').format(row_index, col_index)) for col_index in xrange(MAX_NUM_SENDS) ] for row_index in xrange(NUM_TRACK_CONTROLS)
                                                            ], name=b'Send_Value_Displays')
        self.track_type_controls = ButtonMatrixElement(rows=[
         [ self._make_note_button(0, index + 8, (b'Track_Type_Control_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Track_Type_Controls')
        self.mute_button = self._make_note_button(12, 100, b'Mute_Button')
        self.solo_button = self._make_note_button(12, 101, b'Solo_Button')
        self.rec_arm_button = self._make_note_button(12, 102, b'Rec_Arm_Button')
        self.clip_stop_button = self._make_note_button(12, 103, b'Clip_Stop_Button')
        self.meter_controls_left = ButtonMatrixElement(rows=[
         [ SliderElement(MIDI_CC_TYPE, index + 1, 124, send_should_depend_on_forwarding=False, name=(b'Output_Meter_Display_Left_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Output_Meter_Displays_Left')
        self.meter_controls_right = ButtonMatrixElement(rows=[
         [ SliderElement(MIDI_CC_TYPE, index + 1, 125, send_should_depend_on_forwarding=False, name=(b'Output_Meter_Display_Right_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Output_Meter_Displays_Right')
        self._tui_track_select_buttons_raw = [ self._make_note_button(0, index, (b'TUI_Track_Select_Button_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
                                             ]
        self.track_name_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((0, index), (b'Track_Name_Display_{}').index) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Track_Name_Display')
        self.num_sends_control = ButtonElement(True, MIDI_CC_TYPE, 1, 2, name=b'Num_Sends_Control', send_should_depend_on_forwarding=False)
        self.tui_track_color_controls = ButtonMatrixElement(rows=[
         [ ButtonElement(True, MIDI_CC_TYPE, 0, index + 16, skin=skin, name=(b'TUI_Track_Color_Control_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'TUI_Track_Color_Controls')
        self.oled_display_style_controls_bank_1 = ButtonMatrixElement(rows=[
         [ self._make_note_button(13, index + 16, (b'OLED_Display_Style_Control_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'OLED_Display_Style_Controls_Bank_1')
        self.oled_display_style_controls_bank_2 = ButtonMatrixElement(rows=[
         [ self._make_note_button(13, index + 24, (b'OLED_Display_Style_Control_{}').format(index + NUM_PARAM_CONTROLS)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'OLED_Display_Style_Controls_Bank_2')
        self.track_name_or_volume_value_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((18, index + 16), (b'Track_Name_Or_Volume_Value_Display_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Track_Name_Or_Volume_Value_Displays')
        self.device_parameter_name_or_value_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((18, index + 24), (b'Device_Parameter_Name_Or_Value_Display_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'Device_Parameter_Name_Or_Value_Displays')
        self.crossfade_assign_controls = ButtonMatrixElement(rows=[
         [ self._make_note_button(index + 1, 4, name=(b'Crossfade_Assign_Controk_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Crossfade_Assign_Controls')
        self.crossfader = SliderElement(MIDI_CC_TYPE, 13, 16, name=b'Crossfader')
        self.physical_clip_launch_buttons_raw = [ [ self._make_note_button(12, col_index + self.physical_clip_launch_button_id_offset + row_index * NUM_TRACK_CONTROLS, (b'Physical_Clip_Launch_Button_{}_{}').format(col_index, row_index)) for col_index in xrange(NUM_TRACK_CONTROLS) ] for row_index in xrange(NUM_SCENE_CONTROLS)
                                                ]
        self.clip_launch_buttons_raw = [ [ MultiElement(self._make_note_button(0, col_index + 24 + row_index * NUM_TRACK_CONTROLS, (b'TUI_Clip_Launch_Button_{}_{}').format(col_index, row_index)), name=(b'Clip_Launch_Button_{}_{}').format(col_index, row_index)) for col_index in xrange(NUM_TRACK_CONTROLS) ] for row_index in xrange(NUM_SCENE_CONTROLS)
                                       ]
        self.clip_launch_buttons = ButtonMatrixElement(rows=self.clip_launch_buttons_raw, name=b'Clip_Launch_Buttons')
        self.scene_launch_buttons = ButtonMatrixElement(rows=[
         [ self._make_note_button(0, index + 88, name=(b'TUI_Scene_Launch_Button_{}').format(index)) for index in xrange(NUM_SCENE_CONTROLS)
         ]], name=b'TUI_Scene_Launch_Buttons')
        self.clip_name_displays = ButtonMatrixElement(rows=[ [ self._create_text_display_element((0, row_index + 16 + col_index * NUM_SCENE_CONTROLS), (b'Clip_Name_Display_{}_{}').format(col_index, row_index)) for col_index in xrange(NUM_TRACK_CONTROLS) ] for row_index in xrange(NUM_SCENE_CONTROLS)
                                                           ])
        self.scene_name_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((0, index + 80), (b'Scene_Name_Display_{}').format(index)) for index in xrange(NUM_SCENE_CONTROLS)
         ]], name=b'Scene_Name_Displays')
        self.tui_scene_color_controls = ButtonMatrixElement(rows=[
         [ ButtonElement(True, MIDI_CC_TYPE, 0, index + 88, skin=skin, name=(b'TUI_Scene_Color_Control_{}').format(index)) for index in xrange(NUM_SCENE_CONTROLS)
         ]], name=b'TUI_Scene_Color_Controls')
        self.physical_clip_color_controls_raw = [ [ ButtonElement(True, MIDI_CC_TYPE, 12, row_index + self.pad_identifier_offset + col_index * NUM_SCENE_CONTROLS, skin=skin, name=(b'Physical_Clip_Color_Control_{}_{}').format(col_index, row_index)) for col_index in xrange(NUM_TRACK_CONTROLS) ] for row_index in xrange(NUM_SCENE_CONTROLS)
                                                ]
        self.clip_color_controls_raw = [ [ MultiElement(ButtonElement(True, MIDI_CC_TYPE, 0, row_index + 24 + col_index * NUM_SCENE_CONTROLS, skin=skin, name=(b'TUI_Clip_Color_Control_{}_{}').format(col_index, row_index)), name=(b'Clip_Color_Control_{}_{}').format(col_index, row_index)) for col_index in xrange(NUM_TRACK_CONTROLS) ] for row_index in xrange(NUM_SCENE_CONTROLS)
                                       ]
        self.clip_color_controls = ButtonMatrixElement(rows=self.clip_color_controls_raw, name=b'Clip_Color_Controls')
        self.playing_position_controls = ButtonMatrixElement(rows=[
         [ SliderElement(MIDI_CC_TYPE, 0, index, send_should_depend_on_forwarding=False, name=(b'Playing_Position_Control_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Playing_Position_Controls')
        self.shift_button = self._make_note_button(12, self.shift_button_id, b'Shift_Button', resource_type=PrioritizedResource)
        self.up_button = self._make_note_button(12, self.up_button_id, b'Up_Button')
        self.down_button = self._make_note_button(12, self.down_button_id, b'Down_Button')
        self.left_button = self._make_note_button(12, self.left_button_id, b'Left_Button')
        self.right_button = self._make_note_button(12, self.right_button_id, b'Right_Button')
        self.up_button_with_shift = ComboElement(self.up_button, modifier=[self.shift_button], name=b'Up_Button_With_Shift')
        self.down_button_with_shift = ComboElement(self.down_button, modifier=[self.shift_button], name=b'Down_Button_With_Shift')
        self.left_button_with_shift = ComboElement(self.left_button, modifier=[self.shift_button], name=b'Left_Button_With_Shift')
        self.right_button_with_shift = ComboElement(self.right_button, modifier=[
         self.shift_button], name=b'Right_Button_With_Shift')
        self.scene_selection_controls = ButtonMatrixElement(rows=[
         [ self._make_note_button(0, index + 96, (b'Scene_Selection_Control_{}').format(index)) for index in xrange(NUM_SCENE_CONTROLS)
         ]], name=b'Scene_Selection_Controls')
        self.duplicate_button = self._make_note_button(12, self.duplicate_button_id, b'Duplicate_Button')
        self.undo_button = self._make_note_button(12, self.undo_button_id, b'Undo_Button')
        self.redo_button = ComboElement(self.undo_button, modifier=[self.shift_button], name=b'Redo_Button')
        self.tui_device_parameter_name_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((2, index + 16), (b'TUI_Device_Parameter_Name_Display_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'TUI_Device_Parameter_Name_Displays')
        self.tui_device_parameter_value_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((2, index + 32), (b'TUI_Device_Parameter_Value_Display_{}').format(index)) for index in xrange(NUM_PARAM_CONTROLS)
         ]], name=b'TUI_Device_Parameter_Value_Displays')
        self.tui_arrangement_position_display = self._create_text_display_element((3,
                                                                                   16), b'TUI_Arrangement_Position_Display')
        self.tui_loop_start_display = self._create_text_display_element((3, 17), b'TUI_Loop_Start_Display')
        self.tui_loop_length_display = self._create_text_display_element((3, 18), b'TUI_Loop_Length_Display')
        self.tui_arrangement_position_control = EncoderElement(MIDI_CC_TYPE, 10, 0, Live.MidiMap.MapMode.relative_smooth_two_compliment, name=b'TUI_Arrangement_Position_Control')
        self.tui_loop_start_control = EncoderElement(MIDI_CC_TYPE, 10, 1, Live.MidiMap.MapMode.relative_smooth_two_compliment, name=b'TUI_Loop_Start_Control')
        self.tui_loop_length_control = EncoderElement(MIDI_CC_TYPE, 10, 2, Live.MidiMap.MapMode.relative_smooth_two_compliment, name=b'TUI_Loop_Length_Control')
        tempo_control_identifier = (3, 0)
        self.tempo_display = self._create_text_display_element(tempo_control_identifier, b'Tempo_Display')
        self.tempo_control = SysexElement(sysex_identifier=sysex.SYSEX_MSG_HEADER + (self._product_id, sysex.TEXT_MSG_TYPE) + tempo_control_identifier, name=b'Tempo_Control')
        self.play_button = self._make_note_button(12, self.play_button_id, b'Play_Button')
        self.stop_button = self._make_note_button(12, self.stop_button_id, b'Stop_Button')
        self.session_record_button = self._make_note_button(12, self.session_record_button_id, b'Session_Record_Button')
        self.tap_tempo_button = self._make_note_button(12, self.tap_tempo_button_id, b'Tap_Tempo_Button')
        self._tui_prev_device_button = self._make_note_button(9, 1, b'TUI_Prev_Device_Button')
        self._tui_next_device_button = self._make_note_button(9, 2, b'TUI_Next_Device_Button')
        self.device_lock_button = self._make_note_button(10, 10, b'Device_Lock_Button', is_momentary=False)
        self.num_devices_control = ButtonElement(True, MIDI_CC_TYPE, 9, 16, name=b'Num_Devices_Control')
        self.device_index_control = ButtonElement(True, MIDI_CC_TYPE, 9, 17, name=b'Device_Index_Control')
        self.device_name_display = self._create_text_display_element((2, 1), b'Device_Name_Display')
        self.device_enable_button = self._make_note_button(9, 0, b'Device_Enable_Button', is_momentary=False)
        self._tui_prev_bank_button = self._make_note_button(9, 3, b'TUI_Prev_Bank_Button')
        self._tui_next_bank_button = self._make_note_button(9, 4, b'TUI_Next_Bank_Button')
        self.device_bank_name_display = self._create_text_display_element((2, 0), b'Device_Bank_Name_Display')
        self._tui_phase_nudge_down_button = self._make_note_button(10, 12, b'TUI_Phase_Nudge_Down_Button')
        self._tui_phase_nudge_up_button = self._make_note_button(10, 13, b'TUI_Phase_Nudge_Up_Button')
        self.tui_metronome_button = self._make_note_button(10, 0, b'TUI_Metronome_Button', is_momentary=False)
        self.tui_automation_arm_button = self._make_note_button(10, 4, b'TUI_Automation_Arm_Button', is_momentary=False)
        self.loop_button = self._make_note_button(10, 5, b'Loop_Button', is_momentary=False)
        self.arrangement_overdub_button = self._make_note_button(10, 3, b'Arrangement_Overdub_Button', is_momentary=False)
        self.follow_song_button = self._make_note_button(10, 8, b'Follow_Song_Button', is_momentary=False)
        self.quantization_value_control = self._make_note_button(10, 15, b'Quantization_Value_Control')
        self._tui_quantize_button = self._make_note_button(10, 16, b'TUI_Quantize_Button')
        self.clip_trigger_quantization_control = self._make_note_button(10, 6, b'Clip_Trigger_Quantization_Control')
        self.delete_button = MultiElement(self._make_note_button(10, 14, b'TUI_Delete_Button'), self._make_note_button(12, self.delete_button_id, b'Physical_Delete_Button'), name=b'Delete_Button')
        self.volume_value_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((1, index), (b'Volume_Value_Display_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Volume_Value_Displays')
        self.pan_value_displays = ButtonMatrixElement(rows=[
         [ self._create_text_display_element((1, 16 + index), (b'Pan_Value_Display_{}').format(index)) for index in xrange(NUM_TRACK_CONTROLS)
         ]], name=b'Pan_Value_Displays')
        self.tui_arrangement_record_button = self._make_note_button(10, 22, b'TUI_Arrangement_Record_Button', False)
        self.insert_scene_button = self._make_note_button(10, 21, b'Insert_Scene_Button')
        self.launch_mode_switch = self._make_note_button(10, 23, b'Launch_Mode_Switch')