当前位置: 首页>>代码示例>>Python>>正文


Python SliderElement.SliderElement类代码示例

本文整理汇总了Python中_Framework.SliderElement.SliderElement的典型用法代码示例。如果您正苦于以下问题:Python SliderElement类的具体用法?Python SliderElement怎么用?Python SliderElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SliderElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doStuff

	def doStuff(self,x):

		try:
			data, addr = self.sock.recvfrom(64) # buffer size is 1024 byte
			
			addressPattern = data[:data.find("\0")]

			#data = data.split(',i')
			#v = struct.unpack('>i',data[1][2:(2+4)])[0]
			data = data.split(',ii')
			v = struct.unpack('>ii',data[1][1:])

			track_number = v[0]
			midi_cc = v[1]

			b = SliderElement(1, 0, midi_cc)
			song = self.song()

			if (addressPattern == "/pan"):
				b.connect_to(song.tracks[track_number].mixer_device.panning)
			elif (addressPattern == "/volume"):
				b.connect_to(song.tracks[track_number].mixer_device.volume)
			self.show_message(addressPattern)
		except socket.error:
			pass
开发者ID:adamstark,项目名称:RemoteMidiMap,代码行数:25,代码来源:RemoteMidiMap.py

示例2: _setup_mixer_control

	def _setup_mixer_control(self):
		is_momentary = True # We use non-latching buttons (keys) throughout, so we'll set this as a constant
		num_tracks = 7 # Here we define the mixer width in tracks (a mixer has only one dimension)
		global mixer # We want to instantiate the global mixer as a MixerComponent object (it was a global "None" type up until now...)
		mixer = MixerComponent(num_tracks, 0) #(num_tracks, num_returns, with_eqs, with_filters)
		mixer.set_track_offset(0) #Sets start point for mixer strip (offset from left)
		"""set up the mixer buttons"""		  
		self.song().view.selected_track = mixer.channel_strip(0)._track
		mixer.selected_strip().set_mute_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 64))
		#mixer.selected_strip().set_solo_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 44))
		mixer.selected_strip().set_arm_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, 72))
		track_select_notes = [65, 73, 66, 74, 67, 75, 68, 76] #more note numbers need to be added if num_scenes is increased
		slider_select_notes = [23, 22, 15, 14, 5, 7, 6, 4]
		pan_select_notes = [21, 20, 13, 12, 3, 1, 0, 2]
		master_volume_control = SliderElement(MIDI_CC_TYPE, 0, 4)
		master_select_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 76)
		prehear_control = EncoderElement(MIDI_CC_TYPE, 0, 26, Live.MidiMap.MapMode.absolute)
		crossfader = SliderElement(MIDI_CC_TYPE, 0, 24)
		for index in range(num_tracks):
			mixer.channel_strip(index).set_select_button(ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, track_select_notes[index]))
			mixer.channel_strip(index).set_volume_control(SliderElement(MIDI_CC_TYPE, CHANNEL, slider_select_notes[index]))
			mixer.channel_strip(index).set_pan_control(EncoderElement(MIDI_CC_TYPE, CHANNEL, pan_select_notes[index], Live.MidiMap.MapMode.absolute))
		crossfader.name = 'Crossfader'
		master_volume_control.name = 'Master_Volume_Control'
		master_select_button.name = 'Master_Select_Button'
		prehear_control.name = 'Prehear_Volume_Control'
		mixer.set_crossfader_control(crossfader)
		mixer.set_prehear_volume_control(prehear_control)
		mixer.master_strip().set_volume_control(master_volume_control)
		mixer.master_strip().set_select_button(master_select_button)
开发者ID:Adamdma,项目名称:monomodular,代码行数:30,代码来源:ohm64.py

示例3: _setup_mixer_control

	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 = []
		for track in range(8):
			strip = self._mixer.channel_strip(track)
			strip.name = 'Channel_Strip_' + str(track)
			solo_button = FlashingButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 50, self)
			self._solo_buttons.append(solo_button)
			mute_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 49)
			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)
开发者ID:Adamdma,项目名称:monomodular,代码行数:25,代码来源:AumPC20.py

示例4: _setup_mixer_control

    def _setup_mixer_control(self):
        is_momentary = True
        self._mixer = SpecialMixerComponent(self, 8) #added self for parent
        self._mixer.name = 'Mixer'
        self._mixer.master_strip().name = 'Master_Channel_Strip'
        master_select_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 80)
        master_select_button.name = 'Master_Select_Button'
        self._mixer.master_strip().set_select_button(master_select_button) #set in ShiftableSelectorComponent instead if used for Note Mode
        self._mixer.selected_strip().name = 'Selected_Channel_Strip'
        select_buttons = [] #added
        arm_buttons = [] #added
        sliders = [] #added     
        for track in range(8):
            strip = self._mixer.channel_strip(track)
            strip.name = 'Channel_Strip_' + str(track)
            #volume_control = SliderElement(MIDI_CC_TYPE, track, 7) #set in ShiftableSelectorComponent instead
            #arm_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 48) #see below
            solo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 49)
            solo_button.name = str(track) + '_Solo_Button'
            strip.set_solo_button(solo_button)

            if track < 4:
              mute_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 50)
              mute_button.name = str(track) + '_Mute_Button'
              strip.set_mute_button(mute_button)
              strip.set_invert_mute_feedback(True)

            strip.set_shift_button(self._shift_button)
            select_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 51)) #added
            select_buttons[-1].name = str(track) + '_Select_Button' #added            
            #strip.set_select_button(select_buttons[-1]) #added 
            arm_buttons.append(ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 48)) #added
            arm_buttons[-1].name = str(track) + '_Arm_Button' #added
            sliders.append(SliderElement(MIDI_CC_TYPE, track, 7)) #added
            sliders[-1].name = str(track) + '_Volume_Control' #added

        self._crossfader = SliderElement(MIDI_CC_TYPE, 0, 15)
        master_volume_control = SliderElement(MIDI_CC_TYPE, 0, 14)
        self._prehear_control = EncoderElement(MIDI_CC_TYPE, 0, 47, Live.MidiMap.MapMode.relative_two_compliment)
        self._crossfader.name = 'Crossfader' #not used in APC20
        master_volume_control.name = 'Master_Volume_Control'
        self._prehear_control.name = 'Prehear_Volume_Control'
        self._mixer.set_shift_button(self._shift_button) #added for shifting prehear
        self._mixer.set_crossfader_control(self._crossfader) #not used in APC20
        self._mixer.set_prehear_volume_control(self._prehear_control) #functionality overridden in SpecialMixerComponent
        self._mixer.master_strip().set_volume_control(master_volume_control)
        self._slider_modes = SliderModesComponent(self._mixer, tuple(sliders)) #added from APC20 script
        self._slider_modes.name = 'Slider_Modes' #added from APC20 script
        matrix_modes = MatrixModesComponent(self._matrix, self._session, self._session_zoom, tuple(self._track_stop_buttons), self) #added new
        matrix_modes.name = 'Matrix_Modes' #added new
        # Original method args for ShiftableSelectorComponent: (self, select_buttons, master_button, arm_buttons, matrix, session, zooming, mixer, transport, slider_modes, mode_callback)
        #self._shift_modes = ShiftableSelectorComponent(tuple(select_buttons), master_select_button, tuple(arm_buttons), self._matrix, self._session, self._session_zoom, self._mixer, transport, slider_modes, self._send_introduction_message)
        self._shift_modes = ShiftableSelectorComponent(self, tuple(select_buttons), master_select_button, tuple(arm_buttons), self._matrix, self._session, self._session_zoom, self._mixer, self._slider_modes, matrix_modes) #, self._send_introduction_message) #also added self for _parent
        self._shift_modes.name = 'Shift_Modes'
        self._shift_modes.set_mode_toggle(self._shift_button)
开发者ID:bshmidt,项目名称:AbletonDJTemplate,代码行数:55,代码来源:APC40plus22.py

示例5: connect_to

    def connect_to(self, param):
        if self._parameter_to_map_to is not None:
            try:
                self._parameter_to_map_to.remove_value_listener(self._on_value_changed)
            except:
                pass

        SliderElement.connect_to(self, param)
        if param is not None:
            if not self._parameter_to_map_to.value_has_listener(self._on_value_changed):
                self._parameter_to_map_to.add_value_listener(self._on_value_changed)
        self._send_param_val(True)
开发者ID:AkiSyndicat,项目名称:AbletonLive9_RemoteScripts,代码行数:12,代码来源:LC2ParameterElement.py

示例6: _setup_transport

 def _setup_transport(self):
     is_momentary = True
     transport = TransportComponent()
     studiotransport = MaschineTransport()
     playButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 108)
     stopButton = StateButton(not is_momentary, MIDI_CC_TYPE, 0, 110)
     recordButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 109)
     overdubButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 107)
     metrononmeButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 104)
     eventRecButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 98)
     playButton.name = 'Play'
     stopButton.name = 'Stop'
     recordButton.name = 'Record'
     overdubButton.name = 'Overdub'
     metrononmeButton.name = 'Metronome'
     transport.set_play_button(playButton)
     transport.set_stop_button(stopButton)
     transport.set_record_button(recordButton)
     transport.set_overdub_button(overdubButton)
     transport.set_metronome_button(metrononmeButton)
     studiotransport.set_session_auto_button(eventRecButton)
     studiotransport.set_arrangement_overdub_button(StateButton(is_momentary, MIDI_CC_TYPE, 0, 106))
     studiotransport.set_back_arrange_button(StateButton(is_momentary, MIDI_CC_TYPE, 0, 105))
     transport.set_nudge_buttons(StateButton(is_momentary, MIDI_CC_TYPE, 1, 51), StateButton(is_momentary, MIDI_CC_TYPE, 1, 50))
     punchinbutton = ToggleButton(MIDI_CC_TYPE, 1, 52)
     punchoutbutton = ToggleButton(MIDI_CC_TYPE, 1, 53)
     punchinbutton.name = 'Punch In'
     punchoutbutton.name = 'Punch Out'
     transport.set_punch_buttons(punchinbutton, punchoutbutton)
     transport.set_loop_button(StateButton(is_momentary, MIDI_CC_TYPE, 1, 54))
     self.song_follow_button = ButtonElement(True, MIDI_CC_TYPE, 2, 98)
     self._do_song_follow.subject = self.song_follow_button
     self._song_follow_changed.subject = self.song().view
     self._song_follow_changed()
     self.prehear_knob = SliderElement(MIDI_CC_TYPE, 0, 41)
     self.prehear_knob.connect_to(self.song().master_track.mixer_device.cue_volume)
     self.transp_ff_button = ButtonElement(True, MIDI_CC_TYPE, 1, 59)
     self.transp_rw_button = ButtonElement(True, MIDI_CC_TYPE, 1, 58)
     transport.set_seek_buttons(self.transp_ff_button, self.transp_rw_button)
     self.xfadeKnob = SliderElement(MIDI_CC_TYPE, 1, 105)
     self.xfadeKnob.connect_to(self.song().master_track.mixer_device.crossfader)
     self.master_knob = SliderElement(MIDI_CC_TYPE, 0, 99)
     self.master_knob.connect_to(self.song().master_track.mixer_device.volume)
     self.tap_button = StateButton(is_momentary, MIDI_CC_TYPE, 0, 88)
     self._do_tap_tempo.subject = self.tap_button
     self.cue_add_delete_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 55)
     self.cue_prev_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 56)
     self.cue_next_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 57)
     self._do_toggle_cue.subject = self.cue_add_delete_button
     self._do_toggle_prev_cue.subject = self.cue_prev_button
     self._do_toggle_next_cue.subject = self.cue_next_button
开发者ID:AkiSyndicat,项目名称:AbletonLive9_RemoteScripts,代码行数:51,代码来源:Maschine.py

示例7: __init__

 def __init__(self, c_instance):
     ControlSurface.__init__(self, c_instance)
     with self.component_guard():
         self.set_pad_translations(PAD_TRANSLATIONS)
         self._device_selection_follows_track_selection = True
         self._suggested_input_port = 'Impulse'
         self._suggested_output_port = 'Impulse'
         self._has_sliders = True
         self._current_midi_map = None
         self._display_reset_delay = -1
         self._shift_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 0, 39)
         self._preview_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 0, 41)
         self._master_slider = SliderElement(MIDI_CC_TYPE, 0, 8)
         self._shift_button.name = 'Shift_Button'
         self._master_slider.name = 'Master_Volume_Control'
         self._master_slider.add_value_listener(self._slider_value, identify_sender=True)
         self._preview_button.add_value_listener(self._preview_value)
         self._setup_mixer()
         self._setup_session()
         self._setup_transport()
         self._setup_device()
         self._setup_name_display()
         device_button = ButtonElement(not IS_MOMENTARY, MIDI_CC_TYPE, 1, 10)
         mixer_button = ButtonElement(not IS_MOMENTARY, MIDI_CC_TYPE, 1, 9)
         device_button.name = 'Encoder_Device_Mode'
         mixer_button.name = 'Encoder_Mixer_Mode'
         self._encoder_modes = EncoderModeSelector(self._device_component, self._mixer, self._next_bank_button, self._prev_bank_button, self._encoders)
         self._encoder_modes.set_device_mixer_buttons(device_button, mixer_button)
         self._string_to_display = None
         for component in self.components:
             component.set_enabled(False)
开发者ID:OwenPratt,项目名称:AbletonLive9_RemoteScripts,代码行数:31,代码来源:Novation_Impulse.py

示例8: _load_MIDI_map

 def _load_MIDI_map(self):
     is_momentary = True
     for note in range(128):
         button = ButtonElement(is_momentary, MESSAGETYPE, BUTTONCHANNEL, note)
         button.name = 'Note_' + str(note)
         self._note_map.append(button)
     self._note_map.append(None) #add None to the end of the list, selectable with [-1]
     if MESSAGETYPE == MIDI_CC_TYPE and BUTTONCHANNEL == SLIDERCHANNEL:
         for ctrl in range(128):
             self._ctrl_map.append(None)
     else:
         for ctrl in range(128):
             control = SliderElement(MIDI_CC_TYPE, SLIDERCHANNEL, ctrl)
             control.name = 'Ctrl_' + str(ctrl)
             self._ctrl_map.append(control)
         self._ctrl_map.append(None)
开发者ID:ajasver,项目名称:MidiScripts,代码行数:16,代码来源:FCB1020.py

示例9: __init__

    def __init__(self, c_instance):
        ControlSurface.__init__(self, c_instance)
        with self.component_guard():
            self.set_pad_translations(PAD_TRANSLATIONS)
            self._device_selection_follows_track_selection = True
            self._suggested_input_port = "DirectLink"
            self._suggested_output_port = "DirectLink"
            self._waiting_for_first_response = True
            self._has_sliders = True
            self._current_midi_map = None
            self._display_reset_delay = -1
            self._shift_pressed = False
            self._shift_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 15, 13)
            self._master_slider = SliderElement(MIDI_CC_TYPE, 15, 41)
            self._next_nav_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 15, 111)
            self._prev_nav_button = ButtonElement(IS_MOMENTARY, MIDI_CC_TYPE, 15, 110)
            self._device_bank_buttons = None
            self._device_navigation = None
            self._shift_button.name = "Shift_Button"
            self._master_slider.name = "Master_Volume_Control"
            self._next_nav_button.name = "Next_Track_Button"
            self._prev_nav_button.name = "Prev_Track_Button"
            self._master_slider.add_value_listener(self._slider_value, identify_sender=True)
            self._shift_button.add_value_listener(self._shift_value)
            self._setup_mixer()
            self._setup_transport_and_session()
            self._setup_device()
            self._setup_display()
            for component in self.components:
                component.set_enabled(False)

        return
开发者ID:cce,项目名称:buttons,代码行数:32,代码来源:Axiom_DirectLink.py

示例10: _setup_mixer_control

	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)
开发者ID:Adamdma,项目名称:monomodular,代码行数:45,代码来源:AumPC40.py

示例11: _load_MIDI_map

 def _load_MIDI_map(self):
     is_momentary = True
     rgb_skin = make_rgb_skin()
     for note in range(128):
         button = ButtonElement(is_momentary, MESSAGETYPE, BUTTONCHANNEL, note,)
         button.name = 'Button Note_' + str(note)
         button.is_rgb = True
         self._note_map.append(button)
     self._note_map.append(None) #add None to the end of the list, selectable with [-1]
     
     for note in range(128):
         clip_button = ColorButtonElement(self.log_message,is_momentary, MESSAGETYPE, BUTTONCHANNEL, note, skin = rgb_skin)
         clip_button.name = 'Clip Note_' + str(note)
         button.num_delayed_messages = 3
         self._clip_map.append(clip_button)
     self._clip_map.append(None) #add None
     
     if MESSAGETYPE == MIDI_CC_TYPE and BUTTONCHANNEL == SLIDERCHANNEL:
         for i in range(128):
             self._ctrl_map.append(None)
             self._enc_map.append(None)
     else:
         for ctrl in range(128):
             control = SliderElement(MIDI_CC_TYPE, SLIDERCHANNEL, ctrl)
             control.name = 'Ctrl_' + str(ctrl)
             self._ctrl_map.append(control)
         self._ctrl_map.append(None)
         
         for enc in range(128):
             encoder = EncoderElement(MIDI_CC_TYPE, SLIDERCHANNEL, enc, Live.MidiMap.MapMode.absolute)
             encoder.name = "Encoder_" + str(enc)
             self._enc_map.append(encoder)
         self._enc_map.append(None)
         
     self.log_message('Note Map: %s' % self._note_map)
     self.log_message('Ctrl Map: %s' % self._ctrl_map)
     self.log_message('Enc Map: %s' % self._enc_map)
开发者ID:ajasver,项目名称:MidiScripts,代码行数:37,代码来源:X1MK2.py

示例12: __init__

 def __init__(self, *a, **k):
     super(AudioClipEditComponent, self).__init__(*a, **k)
     self._loop_start_slider = SliderElement(MIDI_CC_TYPE, 2, 60)
     self._action_loop_start.subject = self._loop_start_slider
     self._loop_end_slider = SliderElement(MIDI_CC_TYPE, 2, 61)
     self._action_loop_end.subject = self._loop_end_slider
     self._mark_start_slider = SliderElement(MIDI_CC_TYPE, 2, 62)
     self._action_mark_start.subject = self._mark_start_slider
     self._mark_end_slider = SliderElement(MIDI_CC_TYPE, 2, 63)
     self._action_mark_end.subject = self._mark_end_slider
     self._pitch_c_slider = SliderElement(MIDI_CC_TYPE, 2, 64)
     self._pitch_f_slider = SliderElement(MIDI_CC_TYPE, 2, 65)
     self._gain_slider = SliderElement(MIDI_CC_TYPE, 2, 66)
     self._action_pitch_c.subject = self._pitch_c_slider
     self._action_pitch_f.subject = self._pitch_f_slider
     self._action_gain.subject = self._gain_slider
     self._loop_inc_slider = SliderElement(MIDI_CC_TYPE, 2, 67)
     self._action_loop_inc.subject = self._loop_inc_slider
     self._loop_move_button = ButtonElement(False, MIDI_CC_TYPE, 2, 74)
     self._action_mv_loop.subject = self._loop_move_button
     self._loop_set_button = ButtonElement(False, MIDI_CC_TYPE, 2, 70)
     self._action_loop_toggle.subject = self._loop_set_button
     self._warp_set_button = ButtonElement(False, MIDI_CC_TYPE, 2, 71)
     self._action_warp_toggle.subject = self._warp_set_button
     self._zoom_scroll_button = ButtonElement(False, MIDI_CC_TYPE, 2, 73)
     self._action_scroll_mode.subject = self._zoom_scroll_button
     self.selected_clip_slot = None
     self.inc_index = 4
     self.loop_inc = INC_STEPS[self.inc_index]
     self.start_inc = INC_STEPS[self.inc_index]
     self.mv_loop = False
     self._on_pitch_c_changed.subject = None
     self._on_pitch_f_changed.subject = None
     self._on_gain_changed.subject = None
     self._scroll_mode = False
     self.update_selected_clip()
开发者ID:k100094,项目名称:AbletonLive9_RemoteScripts,代码行数:36,代码来源:AudioClipEditComponent.py

示例13: _init_mixer_component

    def _init_mixer_component(self):
        is_momentary = True
        global mixer
        mixer = MixerComponent(8)
        mixer.name = 'Mixer'
        mixer.set_track_offset(0)
        self.song().view.selected_track = mixer.channel_strip(0)._track

        for track in range(8):
            #self.log_message("Adding track " + str(track))
            strip = mixer.channel_strip(track)
            strip.name = 'Channel_Strip_' + str(track)
            volume_control = SliderElement(MIDI_CC_TYPE, track, VOL_CC)
            snd_A_control = SliderElement(MIDI_CC_TYPE, track, SND_A_CC)
            snd_B_control = SliderElement(MIDI_CC_TYPE, track, SND_B_CC)
            pan_control = SliderElement(MIDI_CC_TYPE, track, PAN_CC)

            arm_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, track, ARM_CC)
            select_button = ButtonElement(is_momentary, MIDI_CC_TYPE, track, SEL_CC)
            mute_button = ButtonElement(not is_momentary, MIDI_CC_TYPE, track, MUTE_CC)


            volume_control.name = str(track) + '_Volume_Control'
            snd_A_control.name = str(track) + '_Send_A_Control'
            snd_B_control.name = str(track) + '_Send_B_Control'
            pan_control.name = str(track) + '_Pan_Control'

            arm_button.name = str(track) + '_arm_Button'
            select_button.name = str(track) + '_Select_Button'
            mute_button.name = str(track) + '_Mute_Button'


            strip.set_volume_control(volume_control)
            strip.set_send_controls([snd_A_control, snd_B_control])
            strip.set_pan_control(pan_control)

            strip.set_arm_button(arm_button)
            strip.set_select_button(select_button)
            strip.set_mute_button(mute_button)

        return mixer
开发者ID:CesarPantoja,项目名称:MPK49pp,代码行数:41,代码来源:MPK49pp.py

示例14: _setup_mixer_control

 def _setup_mixer_control(self):
     is_momentary = True
     
     ## Quirksmode
     self.arm_buttons = []
     
     self._mixer = SpecialMixerComponent(self, 8) #added self for parent
     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):
         self.strip = self._mixer.channel_strip(track)
         self.strip.name = 'Channel_Strip_' + str(track)
         volume_control = SliderElement(MIDI_CC_TYPE, track, 7)
         arm_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 48)
         solo_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 49)
         mute_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 50)
         select_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track, 51)
         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'
         self.strip.set_volume_control(volume_control)
         
         ##Quirksmode
         self.arm_buttons.append(arm_button)
         
         self.strip.set_arm_button(arm_button)
         self.strip.set_solo_button(solo_button)
         self.strip.set_mute_button(mute_button)
         self.strip.set_select_button(select_button)
         self.strip.set_shift_button(self._shift_button)
         self.strip.set_invert_mute_feedback(True)
     crossfader = SliderElement(MIDI_CC_TYPE, 0, 15)
     
     
     master_volume_control = SliderElement(MIDI_CC_TYPE, 0, 14)
     master_select_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 80)
     ##self._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'
     ##self._prehear_control.name = 'Prehear_Volume_Control'
     self._mixer.set_crossfader_control(crossfader)
     ##self._mixer.set_prehear_volume_control(self._prehear_control)
     self._mixer.master_strip().set_volume_control(master_volume_control)
     self._mixer.master_strip().set_select_button(master_select_button)
开发者ID:Quirksmode,项目名称:Custom-DJ-Template-for-APC-40-and-Ableton,代码行数:48,代码来源:APC40.py

示例15: _setup_transport

 def _setup_transport(self):
     is_momentary = True
     transport = TransportComponent()
     playButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 108)
     stopButton = StateButton(not is_momentary, MIDI_CC_TYPE, 0, 110)
     recordButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 109)
     overdubButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 107)
     metrononmeButton = StateButton(is_momentary, MIDI_CC_TYPE, 0, 104)
     playButton.name = 'Play'
     stopButton.name = 'Stop'
     recordButton.name = 'Record'
     overdubButton.name = 'Overdub'
     metrononmeButton.name = 'Metronome'
     transport.set_play_button(playButton)
     transport.set_stop_button(stopButton)
     transport.set_record_button(recordButton)
     transport.set_overdub_button(overdubButton)
     transport.set_metronome_button(metrononmeButton)
     transport.set_nudge_buttons(StateButton(is_momentary, MIDI_CC_TYPE, 1, 51), StateButton(is_momentary, MIDI_CC_TYPE, 1, 50))
     punchinbutton = ToggleButton(MIDI_CC_TYPE, 1, 52)
     punchoutbutton = ToggleButton(MIDI_CC_TYPE, 1, 53)
     punchinbutton.name = 'Punch In'
     punchoutbutton.name = 'Punch Out'
     transport.set_punch_buttons(punchinbutton, punchoutbutton)
     transport.set_loop_button(StateButton(is_momentary, MIDI_CC_TYPE, 1, 54))
     self.transp_ff_button = ButtonElement(True, MIDI_CC_TYPE, 1, 59)
     self.transp_rw_button = ButtonElement(True, MIDI_CC_TYPE, 1, 58)
     transport.set_seek_buttons(self.transp_ff_button, self.transp_rw_button)
     self.xfadeKnob = SliderElement(MIDI_CC_TYPE, 1, 100)
     self.xfadeKnob.connect_to(self.song().master_track.mixer_device.crossfader)
     self.tap_button = StateButton(is_momentary, MIDI_CC_TYPE, 0, 88)
     self.tap_button.add_value_listener(self._do_tap_tempo)
     self.cue_add_delete_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 55)
     self.cue_prev_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 56)
     self.cue_next_button = StateButton(is_momentary, MIDI_CC_TYPE, 1, 57)
     self.cue_add_delete_button.add_value_listener(self._do_toggle_cue)
     self.cue_prev_button.add_value_listener(self._do_toggle_prev_cue)
     self.cue_next_button.add_value_listener(self._do_toggle_next_cue)
开发者ID:AngeousaQ,项目名称:AbletonLive9_RemoteScripts,代码行数:38,代码来源:MaschineMk2.py


注:本文中的_Framework.SliderElement.SliderElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。