def _setup_global_control(self): is_momentary = True self._global_bank_buttons = [] self._global_param_controls = [] for index in range(8): ring_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 56 + index) ringed_encoder = RingedEncoderElement(MIDI_CC_TYPE, 0, 48 + index, Live.MidiMap.MapMode.absolute) ringed_encoder.name = 'Track_Control_' + str(index) ringed_encoder.set_feedback_delay(-1) ring_button.name = ringed_encoder.name + '_Ring_Mode_Button' ringed_encoder.set_ring_mode_button(ring_button) self._global_param_controls.append(ringed_encoder) self._global_bank_buttons = [] global_bank_labels = ('Pan_Button', 'Send_A_Button', 'Send_B_Button', 'Send_C_Button') for index in range(4): self._global_bank_buttons.append(ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 87 + index))#(not is_momentary, MIDI_NOTE_TYPE, 0, 87 + index)) self._global_bank_buttons[-1].name = global_bank_labels[index] self._encoder_modes = EncoderMixerModeSelectorComponent(self._mixer) self._encoder_modes.name = 'Track_Control_Modes' #self._encoder_modes.set_modes_buttons(self._global_bank_buttons) # set in ShiftableEncoderSelectorComponent self._encoder_modes.set_controls(tuple(self._global_param_controls)) #self._encoder_device_modes = EncoderDeviceModeSelectorComponent(self._mixer, self._device) #new self._encoder_device_modes = EncoderDeviceComponent(self._mixer, self._device, self) self._encoder_device_modes.name = 'Alt_Device_Control_Modes' #new self._encoder_eq_modes = EncoderEQComponent(self._mixer, self)#EncoderEQModeSelectorComponent(self._mixer) #new self._encoder_eq_modes.name = 'EQ_Control_Modes' #new global_translation_selector = ChannelTranslationSelector() #translate track encoders to channels 1 through 4, based on button selection (pan = 1, send A = 2, send B = 3, send C = 4) global_translation_selector.name = 'Global_Translations' global_translation_selector.set_controls_to_translate(tuple(self._global_param_controls)) global_translation_selector.set_mode_buttons(tuple(self._global_bank_buttons)) encoder_user_modes = EncoderUserModesComponent(self, self._encoder_modes, tuple(self._global_param_controls), tuple(self._global_bank_buttons), self._mixer, self._device, self._encoder_device_modes, self._encoder_eq_modes) #self._mixer, tuple(sliders)) #added encoder_user_modes.name = 'Encoder_User_Modes' #added self._encoder_shift_modes = ShiftableEncoderSelectorComponent(self, tuple(self._global_bank_buttons), encoder_user_modes, self._encoder_modes, self._encoder_eq_modes, self._encoder_device_modes) #tuple(select_buttons), master_select_button, tuple(arm_buttons), self._matrix, self._session, self._session_zoom, self._mixer, slider_modes, matrix_modes) #, self._send_introduction_message) #also added self for _parent self._encoder_shift_modes.name = 'Encoder_Shift_Modes' self._encoder_shift_modes.set_mode_toggle(self._shift_button)
def _setup_global_control(self): is_momentary = True global_bank_buttons = [] global_param_controls = [] for index in range(8): ring_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 56 + index) ringed_encoder = RingedEncoderElement( MIDI_CC_TYPE, 0, 48 + index, Live.MidiMap.MapMode.absolute) ringed_encoder.name = 'Track_Control_' + str(index) ring_button.name = ringed_encoder.name + '_Ring_Mode_Button' ringed_encoder.set_ring_mode_button(ring_button) global_param_controls.append(ringed_encoder) global_bank_buttons = [] global_bank_labels = ('Pan_Button', 'Send_A_Button', 'Send_B_Button', 'Send_C_Button') for index in range(4): global_bank_buttons.append( ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 87 + index)) global_bank_buttons[-1].name = global_bank_labels[index] encoder_modes = EncModeSelectorComponent(self._mixer) encoder_modes.name = 'Track_Control_Modes' encoder_modes.set_modes_buttons(global_bank_buttons) encoder_modes.set_controls(tuple(global_param_controls)) global_translation_selector = ChannelTranslationSelector() global_translation_selector.name = 'Global_Translations' global_translation_selector.set_controls_to_translate( tuple(global_param_controls)) global_translation_selector.set_mode_buttons( tuple(global_bank_buttons))
def _create_global_control(self): def set_pan_controls(): for index, control in enumerate(self._global_param_controls): self._mixer.channel_strip(index).set_pan_control(control) self._mixer.channel_strip(index).set_send_controls( (None, None, None)) control.set_channel(0) def set_send_controls(send_index): for index, control in enumerate(self._global_param_controls): self._mixer.channel_strip(index).set_pan_control(None) send_controls = [None] * 3 send_controls[send_index] = control self._mixer.channel_strip(index).set_send_controls( send_controls) control.set_channel(send_index + 1) encoder_modes = ModesComponent(name=u'Track_Control_Modes', is_enabled=False) encoder_modes.add_mode(u'pan', [set_pan_controls]) encoder_modes.add_mode(u'send_a', [partial(set_send_controls, 0)]) encoder_modes.add_mode(u'send_b', [partial(set_send_controls, 1)]) encoder_modes.add_mode(u'send_c', [partial(set_send_controls, 2)]) encoder_modes.selected_mode = u'pan' encoder_modes.layer = Layer(pan_button=self._global_bank_buttons[0], send_a_button=self._global_bank_buttons[1], send_b_button=self._global_bank_buttons[2], send_c_button=self._global_bank_buttons[3]) self._translation_selector = ChannelTranslationSelector( name=u'Global_Translations')
def __init__(self): DeviceComponent.__init__(self) self.device_listener = None self.device_parm_listener = None self._control_translation_selector = ChannelTranslationSelector(8) self.clear_mode = True self.touch_mode = False self.del_parm_map = {} self.del_clip_map = {} self.del_touch_buttons = []
def _create_device(self): self._device = DeviceComponent( name='Device_Component', is_enabled=False, layer=Layer(bank_buttons=self._device_bank_buttons, on_off_button=self._device_on_off_button), use_fake_banks=True) ChannelTranslationSelector(8, name='Control_Translations') self._device.set_parameter_controls( tuple(self._device_param_controls_raw))
def _create_transport(self): self._transport = TransportComponent( name=u'Transport', is_enabled=False, layer=Layer(play_button=self._play_button, stop_button=self._stop_button, record_button=self._record_button, nudge_up_button=self._nudge_up_button, nudge_down_button=self._nudge_down_button, tap_tempo_button=self._tap_tempo_button, quant_toggle_button=self._rec_quantization_button, overdub_button=self._overdub_button, metronome_button=self._metronome_button)) self._bank_button_translator = ChannelTranslationSelector( name=u'Bank_Button_Translations', is_enabled=False)
def _setup_device_control(self): is_momentary = True device_bank_buttons = [] device_param_controls = [] for index in range(8): device_bank_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, 12, 70 + index)) device_param_controls.append(EncoderElement(MIDI_CC_TYPE, 12, 12 + index, Live.MidiMap.MapMode.absolute)) device = DeviceComponent() device.set_bank_buttons(tuple(device_bank_buttons)) device.set_parameter_controls(tuple(device_param_controls)) device_translation_selector = ChannelTranslationSelector() device_translation_selector.set_controls_to_translate(tuple(device_param_controls)) device_translation_selector.set_mode_buttons(tuple(device_bank_buttons)) self.set_device_component(device)
def _setup_global_control(self): is_momentary = True self._global_bank_buttons = [] self._global_param_controls = [] for index in range(8): ring_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, 0, 56 + index) ringed_encoder = RingedEncoderElement( MIDI_CC_TYPE, 0, 48 + index, Live.MidiMap.MapMode.absolute) ringed_encoder.name = 'Track_Control_' + str(index) ringed_encoder.set_feedback_delay(-1) ring_button.name = ringed_encoder.name + '_Ring_Mode_Button' ringed_encoder.set_ring_mode_button(ring_button) self._global_param_controls.append(ringed_encoder) self._global_bank_buttons = [] global_bank_labels = ('Pan_Button', 'Send_A_Button', 'Send_B_Button', 'Send_C_Button') for index in range(4): self._global_bank_buttons.append( ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 87 + index)) self._global_bank_buttons[-1].name = global_bank_labels[index] self._encoder_modes = EncModeSelectorComponent(self._mixer) self._encoder_modes.name = 'Track_Control_Modes' self._encoder_modes.set_controls(tuple(self._global_param_controls)) self._encoder_device_modes = EncoderDeviceComponent( self._mixer, self._device, self) self._encoder_device_modes.name = 'Alt_Device_Control_Modes' self._encoder_eq_modes = EncoderEQComponent(self._mixer, self) self._encoder_eq_modes.name = 'EQ_Control_Modes' global_translation_selector = ChannelTranslationSelector() global_translation_selector.name = 'Global_Translations' global_translation_selector.set_controls_to_translate( tuple(self._global_param_controls)) global_translation_selector.set_mode_buttons( tuple(self._global_bank_buttons)) encoder_user_modes = EncoderUserModesComponent( self, self._encoder_modes, tuple(self._global_param_controls), tuple(self._global_bank_buttons), self._mixer, self._device, self._encoder_device_modes, self._encoder_eq_modes) encoder_user_modes.name = 'Encoder_User_Modes' self._encoder_shift_modes = ShiftableEncoderSelectorComponent( self, tuple(self._global_bank_buttons), encoder_user_modes, self._encoder_modes, self._encoder_eq_modes, self._encoder_device_modes) self._encoder_shift_modes.name = 'Encoder_Shift_Modes' self._encoder_shift_modes.set_mode_toggle(self._shift_button)
def __init__(self): DeviceComponent.__init__(self) self._shift_button = None self._shift_pressed = False self._control_translation_selector = ChannelTranslationSelector(8)
def __init__(self, surface): DeviceComponent.__init__(self) self.surface = surface self.device_listener = None self.device_parm_listener = None self._control_translation_selector = ChannelTranslationSelector(8)