def _setup_device_and_transport_control(self):
     is_momentary = True
     device_bank_buttons = []
     device_param_controls = []
     bank_button_labels = ('Clip_Track_Button', 'Device_On_Off_Button', 'Previous_Device_Button', 'Next_Device_Button', 'Detail_View_Button', 'Rec_Quantization_Button', 'Midi_Overdub_Button', 'Metronome_Button')
     for index in range(8):
         device_bank_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 58 + index))
         device_bank_buttons[-1].name = bank_button_labels[index]
         ring_mode_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 24 + index)
         ringed_encoder = RingedEncoderElement(MIDI_CC_TYPE, 0, 16 + index, Live.MidiMap.MapMode.absolute)
         ringed_encoder.set_ring_mode_button(ring_mode_button)
         ringed_encoder.set_feedback_delay(-1)
         ringed_encoder.name = 'Device_Control_' + str(index)
         ring_mode_button.name = ringed_encoder.name + '_Ring_Mode_Button'
         device_param_controls.append(ringed_encoder)
     self._device = ShiftableDeviceComponent()
     self._device.name = 'Device_Component'
     self._device.set_bank_buttons(tuple(device_bank_buttons))
     self._device.set_shift_button(self._shift_button)
     self._device.set_parameter_controls(tuple(device_param_controls))
     self._device.set_on_off_button(device_bank_buttons[1])
     self.set_device_component(self._device)
     detail_view_toggler = DetailViewCntrlComponent()
     detail_view_toggler.name = 'Detail_View_Control'
     detail_view_toggler.set_shift_button(self._shift_button)
     detail_view_toggler.set_device_clip_toggle_button(device_bank_buttons[0])
     detail_view_toggler.set_detail_toggle_button(device_bank_buttons[4])
     detail_view_toggler.set_device_nav_buttons(device_bank_buttons[2], device_bank_buttons[3])
     
     transport = ShiftableTransportComponent()
     transport.name = 'Transport'
     play_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 91)
     stop_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 92)
     record_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 93)
     nudge_up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 100)
     nudge_down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 101)
     tap_tempo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 99)
     play_button.name = 'Play_Button'
     stop_button.name = 'Stop_Button'
     record_button.name = 'Record_Button'
     nudge_up_button.name = 'Nudge_Up_button'
     nudge_down_button.name = 'Nudge_Down_button'
     tap_tempo_button.name = 'Tap_Tempo_Button'
     transport.set_shift_button(self._shift_button)
     transport.set_play_button(play_button)
     transport.set_stop_button(stop_button)
     transport.set_record_button(record_button)
     transport.set_nudge_buttons(nudge_up_button, nudge_down_button)
     transport.set_undo_button(nudge_down_button)
     transport.set_redo_button(nudge_up_button)
     transport.set_tap_tempo_button(tap_tempo_button)
     self._device.set_lock_button(tap_tempo_button)
     transport.set_quant_toggle_button(device_bank_buttons[5])
     transport.set_overdub_button(device_bank_buttons[6])
     transport.set_metronome_button(device_bank_buttons[7])
     transport.set_tempo_encoder(self._prehear_control)
     bank_button_translator = ShiftTranslatorComponent()
     bank_button_translator.set_controls_to_translate(tuple(device_bank_buttons))
     bank_button_translator.set_shift_button(self._shift_button)
예제 #2
0
    def _setup_device_and_transport_control(self):
        is_momentary = True
        device_bank_buttons = []
        device_param_controls = []
        bank_button_labels = ('Clip_Track_Button', 'Device_On_Off_Button',
                              'Previous_Device_Button', 'Next_Device_Button',
                              'Detail_View_Button', 'Rec_Quantization_Button',
                              'Midi_Overdub_Button', 'Metronome_Button')
        for index in range(8):
            device_bank_buttons.append(
                ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 58 + index))
            device_bank_buttons[-1].name = bank_button_labels[index]
            ring_mode_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0,
                                             24 + index)
            ringed_encoder = RingedEncoderElement(
                MIDI_CC_TYPE, 0, 16 + index, Live.MidiMap.MapMode.absolute)
            ringed_encoder.set_ring_mode_button(ring_mode_button)
            ringed_encoder.name = 'Device_Control_' + str(index)
            ring_mode_button.name = ringed_encoder.name + '_Ring_Mode_Button'
            device_param_controls.append(ringed_encoder)

        device = ShiftableDeviceComponent()
        device.name = 'Device_Component'
        device.set_bank_buttons(tuple(device_bank_buttons))
        device.set_shift_button(self._shift_button)
        device.set_parameter_controls(tuple(device_param_controls))
        device.set_on_off_button(device_bank_buttons[1])
        self.set_device_component(device)
        detail_view_toggler = DetailViewCntrlComponent()
        detail_view_toggler.name = 'Detail_View_Control'
        detail_view_toggler.set_shift_button(self._shift_button)
        detail_view_toggler.set_device_clip_toggle_button(
            device_bank_buttons[0])
        detail_view_toggler.set_detail_toggle_button(device_bank_buttons[4])
        detail_view_toggler.set_device_nav_buttons(device_bank_buttons[2],
                                                   device_bank_buttons[3])
        transport = ShiftableTransportComponent()
        transport.name = 'Transport'
        play_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 91)
        stop_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 92)
        record_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 93)
        nudge_up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 100)
        nudge_down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 101)
        tap_tempo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 99)
        play_button.name = 'Play_Button'
        stop_button.name = 'Stop_Button'
        record_button.name = 'Record_Button'
        nudge_up_button.name = 'Nudge_Up_Button'
        nudge_down_button.name = 'Nudge_Down_Button'
        tap_tempo_button.name = 'Tap_Tempo_Button'
        transport.set_shift_button(self._shift_button)
        transport.set_play_button(play_button)
        transport.set_stop_button(stop_button)
        transport.set_record_button(record_button)
        transport.set_nudge_buttons(nudge_up_button, nudge_down_button)
        transport.set_tap_tempo_button(tap_tempo_button)
        transport.set_quant_toggle_button(device_bank_buttons[5])
        transport.set_overdub_button(device_bank_buttons[6])
        transport.set_metronome_button(device_bank_buttons[7])
        bank_button_translator = ShiftTranslatorComponent()
        bank_button_translator.set_controls_to_translate(
            tuple(device_bank_buttons))
        bank_button_translator.set_shift_button(self._shift_button)
 def _setup_device_and_transport_control(self):
     is_momentary = True
     self.device_bank_buttons = []
     self.device_param_controls = []
     bank_button_labels = ('Clip_Track_Button', 'Device_On_Off_Button', 'Previous_Device_Button', 'Next_Device_Button', 'Detail_View_Button', 'Rec_Quantization_Button', 'Midi_Overdub_Button', 'Metronome_Button')
     for index in range(8):
         self.device_bank_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 58 + index))
         self.device_bank_buttons[-1].name = bank_button_labels[index]
         ring_mode_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 24 + index)
         ringed_encoder = RingedEncoderElement(MIDI_CC_TYPE, 0, 16 + index, Live.MidiMap.MapMode.absolute)
         ringed_encoder.set_ring_mode_button(ring_mode_button)
         ringed_encoder.name = 'Device_Control_' + str(index)
         ring_mode_button.name = ringed_encoder.name + '_Ring_Mode_Button'
         
         ## Quirksmode
         ##### Link the cutoffs for the Scene Effect Parameters
         if (index == 0):
         	ringed_encoder.add_value_listener(self._linkCutoff)
         
         self.device_param_controls.append(ringed_encoder)
     self.device = ShiftableDeviceComponent()
     self.device.name = 'Device_Component'
     self.device.set_bank_buttons(tuple(self.device_bank_buttons))
     self.device.set_shift_button(self._shift_button)
     self.device.set_parameter_controls(tuple(self.device_param_controls))
     self.device.set_on_off_button(self.device_bank_buttons[1])
     self.set_device_component(self.device)
     self.detail_view_toggler = DetailViewCntrlComponent()
     self.detail_view_toggler.name = 'Detail_View_Control'
     self.detail_view_toggler.set_shift_button(self._shift_button)
     self.detail_view_toggler.set_device_clip_toggle_button(self.device_bank_buttons[0])
     self.detail_view_toggler.set_detail_toggle_button(self.device_bank_buttons[4])
     self.detail_view_toggler.set_device_nav_buttons(self.device_bank_buttons[2], self.device_bank_buttons[3])
     self.transport = ShiftableTransportComponent(self) ## Quirksmode added self
     self.transport.name = 'Transport'
     self.play_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 91)
     self.play_button.name = 'Play_Button'
     
     self.stop_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 92)
     self.record_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 93)
     nudge_up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 100)
     nudge_down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 101)
     tap_tempo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 99)
     self.stop_button.name = 'Stop_Button'
     self.record_button.name = 'Record_Button'
     nudge_up_button.name = 'Nudge_Up_Button'
     nudge_down_button.name = 'Nudge_Down_Button'
     tap_tempo_button.name = 'Tap_Tempo_Button'
     self.transport.set_shift_button(self._shift_button)
     self.transport.set_play_button(self.play_button)
     self.transport.set_stop_button(self.stop_button)
     self.transport.set_record_button(self.record_button)
     self.transport.set_nudge_buttons(nudge_up_button, nudge_down_button)
     self.transport.set_undo_button(nudge_down_button) #shifted nudge
     self.transport.set_redo_button(nudge_up_button) #shifted nudge
     self.transport.set_tap_tempo_button(tap_tempo_button)
     self.transport.set_quant_toggle_button(self.device_bank_buttons[5])
     self.transport.set_overdub_button(self.device_bank_buttons[6])
     self.transport.set_metronome_button(self.device_bank_buttons[7])
     self._prehear_control = EncoderElement(MIDI_CC_TYPE, 0, 47, Live.MidiMap.MapMode.relative_two_compliment)
     self.transport.set_tempo_encoder(self._prehear_control) #shifted prehear
     bank_button_translator = ShiftTranslatorComponent()
     bank_button_translator.set_controls_to_translate(tuple(self.device_bank_buttons))
     bank_button_translator.set_shift_button(self._shift_button)
예제 #4
0
    def _setup_device_and_transport_control(self):
        is_momentary = True
        device_bank_buttons = []
        device_param_controls = []
        bank_button_labels = (
            "Clip_Track_Button",
            "Device_On_Off_Button",
            "Previous_Device_Button",
            "Next_Device_Button",
            "Detail_View_Button",
            "Rec_Quantization_Button",
            "Midi_Overdub_Button",
            "Metronome_Button",
        )
        for index in range(8):
            device_bank_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 58 + index))
            device_bank_buttons[-1].name = bank_button_labels[index]
            ring_mode_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 24 + index)
            ringed_encoder = RingedEncoderElement(MIDI_CC_TYPE, 0, 16 + index, Live.MidiMap.MapMode.absolute)
            ringed_encoder.set_ring_mode_button(ring_mode_button)
            ringed_encoder.name = "Device_Control_" + str(index)
            ring_mode_button.name = ringed_encoder.name + "_Ring_Mode_Button"
            device_param_controls.append(ringed_encoder)

        device = ShiftableDeviceComponent()
        device.name = "Device_Component"
        device.set_bank_buttons(tuple(device_bank_buttons))
        device.set_shift_button(self._shift_button)
        device.set_parameter_controls(tuple(device_param_controls))
        device.set_on_off_button(device_bank_buttons[1])
        self.set_device_component(device)
        detail_view_toggler = DetailViewCntrlComponent()
        detail_view_toggler.name = "Detail_View_Control"
        detail_view_toggler.set_shift_button(self._shift_button)
        detail_view_toggler.set_device_clip_toggle_button(device_bank_buttons[0])
        detail_view_toggler.set_detail_toggle_button(device_bank_buttons[4])
        detail_view_toggler.set_device_nav_buttons(device_bank_buttons[2], device_bank_buttons[3])
        transport = ShiftableTransportComponent()
        transport.name = "Transport"
        play_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 91)
        stop_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 92)
        record_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 93)
        nudge_up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 100)
        nudge_down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 101)
        tap_tempo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 99)
        play_button.name = "Play_Button"
        stop_button.name = "Stop_Button"
        record_button.name = "Record_Button"
        nudge_up_button.name = "Nudge_Up_Button"
        nudge_down_button.name = "Nudge_Down_Button"
        tap_tempo_button.name = "Tap_Tempo_Button"
        transport.set_shift_button(self._shift_button)
        transport.set_play_button(play_button)
        transport.set_stop_button(stop_button)
        transport.set_record_button(record_button)
        transport.set_nudge_buttons(nudge_up_button, nudge_down_button)
        transport.set_tap_tempo_button(tap_tempo_button)
        transport.set_quant_toggle_button(device_bank_buttons[5])
        transport.set_overdub_button(device_bank_buttons[6])
        transport.set_metronome_button(device_bank_buttons[7])
        bank_button_translator = ShiftTranslatorComponent()
        bank_button_translator.set_controls_to_translate(tuple(device_bank_buttons))
        bank_button_translator.set_shift_button(self._shift_button)