本文整理汇总了Python中SpecialSessionComponent.SpecialSessionComponent.selected_scene方法的典型用法代码示例。如果您正苦于以下问题:Python SpecialSessionComponent.selected_scene方法的具体用法?Python SpecialSessionComponent.selected_scene怎么用?Python SpecialSessionComponent.selected_scene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialSessionComponent.SpecialSessionComponent
的用法示例。
在下文中一共展示了SpecialSessionComponent.selected_scene方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Launchkey
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import selected_scene [as 别名]
#.........这里部分代码省略.........
self._master_slider = None
self._current_midi_map = None
self._transport_view_modes = None
self._send_midi(LED_FLASHING_OFF)
self._send_midi(LIVE_MODE_OFF)
def build_midi_map(self, midi_map_handle):
self._current_midi_map = midi_map_handle
ControlSurface.build_midi_map(self, midi_map_handle)
def _setup_mixer(self):
self._next_nav_button = make_button(103, "Next_Track_Button")
self._prev_nav_button = make_button(102, "Prev_Track_Button")
mute_solo_flip_button = make_button(59, "Master_Button")
self._mixer = SpecialMixerComponent(8)
self._mixer.name = "Mixer"
self._mixer.set_select_buttons(self._next_nav_button, self._prev_nav_button)
self._mixer.selected_strip().name = "Selected_Channel_Strip"
self._mixer.master_strip().name = "Master_Channel_Strip"
self._mixer.master_strip().set_volume_control(self._master_slider)
self._sliders = []
self._strip_buttons = []
for index in range(8):
strip = self._mixer.channel_strip(index)
strip.name = "Channel_Strip_" + str(index)
strip.set_invert_mute_feedback(True)
self._sliders.append(make_slider(41 + index, "Volume_Control_%d" % index))
strip.set_volume_control(self._sliders[-1])
self._strip_buttons.append(make_button(51 + index, "Mute_Button_%d" % index))
self._mixer.set_strip_mute_solo_buttons(tuple(self._strip_buttons), mute_solo_flip_button)
def _setup_session(self):
scene_launch_button = make_configurable_button(104, "Scene_Launch_Button")
scene_stop_button = make_configurable_button(120, "Scene_Stop_Button")
self._session = SpecialSessionComponent(8, 0)
self._session.name = "Session_Control"
self._session.selected_scene().name = "Selected_Scene"
self._session.selected_scene().set_launch_button(scene_launch_button)
self._session.selected_scene().set_triggered_value(GREEN_BLINK)
self._session.set_stop_all_clips_button(scene_stop_button)
scene_stop_button.set_on_off_values(AMBER_FULL, LED_OFF)
self._session.set_mixer(self._mixer)
self._session.set_track_banking_increment(8)
self._session.set_stop_track_clip_value(GREEN_BLINK)
clip_launch_buttons = []
clip_stop_buttons = []
for index in range(8):
clip_launch_buttons.append(make_configurable_button(96 + index, "Clip_Launch_%d" % index))
clip_stop_buttons.append(make_configurable_button(112 + index, "Clip_Stop_%d" % index))
clip_slot = self._session.selected_scene().clip_slot(index)
clip_slot.set_triggered_to_play_value(GREEN_BLINK)
clip_slot.set_triggered_to_record_value(RED_BLINK)
clip_slot.set_stopped_value(AMBER_FULL)
clip_slot.set_started_value(GREEN_FULL)
clip_slot.set_recording_value(RED_FULL)
clip_slot.set_launch_button(clip_launch_buttons[-1])
clip_slot.name = "Selected_Clip_Slot_" + str(index)
self._session.set_stop_track_clip_buttons(tuple(clip_stop_buttons))
def _setup_transport(self):
rwd_button = make_button(112, "Rwd_Button")
ffwd_button = make_button(113, "FFwd_Button")
stop_button = make_button(114, "Stop_Button")
play_button = make_button(115, "Play_Button")
loop_button = make_button(116, "Loop_Button")
rec_button = make_button(117, "Record_Button")
transport = TransportComponent()
transport.name = "Transport"
transport.set_stop_button(stop_button)
transport.set_play_button(play_button)
transport.set_record_button(rec_button)
transport.set_loop_button(loop_button)
self._transport_view_modes = TransportViewModeSelector(transport, self._session, ffwd_button, rwd_button)
self._transport_view_modes.name = "Transport_View_Modes"
def _setup_device(self):
encoders = [make_encoder(21 + index, "Device_Control_%d" % index) for index in xrange(8)]
self._encoders = tuple(encoders)
device = DeviceComponent()
device.name = "Device_Component"
self.set_device_component(device)
device.set_parameter_controls(self._encoders)
def _dummy_listener(self, value):
pass
def _on_selected_track_changed(self):
ControlSurface._on_selected_track_changed(self)
self._update_mixer_offset()
def _update_mixer_offset(self):
all_tracks = self._session.tracks_to_use()
selected_track = self.song().view.selected_track
num_strips = self._session.width()
if selected_track in all_tracks:
track_index = list(all_tracks).index(selected_track)
new_offset = track_index - track_index % num_strips
self._session.set_offsets(new_offset, self._session.scene_offset())
示例2: LaunchControl
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import selected_scene [as 别名]
class LaunchControl(ControlSurface):
def __init__(self, c_instance):
super(LaunchControl, self).__init__(c_instance)
with self.component_guard():
self._device_selection_follows_track_selection = True
self._init_mixer()
self._init_session()
self._init_device()
self._init_modes()
self._refresh_state_task = self._tasks.add(Task.sequence(Task.delay(3), Task.run(self._do_refresh_state)))
self._refresh_state_task.kill()
self.log_message('Launch Control script loaded')
def disconnect(self):
super(LaunchControl, self).disconnect()
for channel in xrange(16):
self._send_midi((CC_STATUS + channel, 0, 0))
def refresh_state(self):
self._refresh_state_task.restart()
def _do_refresh_state(self):
self._send_current_mode()
self._update_hardware()
self.schedule_message(3, super(LaunchControl, self).refresh_state)
def _update_hardware(self):
for channel in xrange(8, 11):
self._send_midi(Sysex.make_automatic_flashing_message(channel))
def _send_current_mode(self):
try:
self._send_midi(MODE_SYSEX_MAP[self._modes.selected_mode])
except KeyError:
pass
def _init_mixer(self):
make_button = partial(make_launch_control_button, channel=8)
make_encoder = partial(make_launch_control_encoder, channel=8)
bottom_encoders, top_encoders = make_all_encoders('Mixer', make_encoder)
pan_volume_layer = Layer(volume_controls=ButtonMatrixElement(rows=[bottom_encoders]), pan_controls=ButtonMatrixElement(rows=[top_encoders]))
sends_layer = Layer(sends_controls=ButtonMatrixElement(rows=[bottom_encoders, top_encoders]))
modes_layer = Layer(pan_volume_button=make_button(114, 'Pan_Volume_Mode_Button'), sends_button=make_button(115, 'Sends_Mode_Button'))
self._mixer = SpecialMixerComponent(8, modes_layer, pan_volume_layer, sends_layer)
self._mixer.set_enabled(False)
self._mixer.name = 'Mixer'
self._mixer.selected_strip().name = 'Selected_Channel_Strip'
self._mixer.master_strip().name = 'Master_Channel_Strip'
self._mixer_track_nav_layer = Layer(track_bank_left_button=make_button(116, 'Mixer_Track_Left_Button'), track_bank_right_button=make_button(117, 'Mixer_Track_Right_Button'))
for index in xrange(8):
strip = self._mixer.channel_strip(index)
strip.name = 'Channel_Strip_' + str(index)
strip.empty_color = Colors.LED_OFF
strip.set_invert_mute_feedback(True)
mute_button = make_button(pad_identifiers[index], 'Track_Mute_Button_' + str(index), is_pad=True)
mute_button.set_on_off_values(Colors.AMBER_FULL, Colors.AMBER_THIRD)
strip.set_mute_button(mute_button)
self._on_selected_send_index.subject = self._mixer
self._on_selected_mixer_mode.subject = self._mixer
def _init_session(self):
make_button = partial(make_launch_control_button, channel=9)
make_encoder = partial(make_launch_control_encoder, channel=9)
bottom_encoders, top_encoders = make_all_encoders('Session_Mixer', make_encoder)
pan_volume_layer = Layer(volume_controls=ButtonMatrixElement(rows=[bottom_encoders]), pan_controls=ButtonMatrixElement(rows=[top_encoders]))
self._session_mixer = SpecialMixerComponent(8, Layer(), pan_volume_layer, Layer())
self._session_mixer.set_enabled(False)
self._session_mixer.name = 'Session_Mixer'
clip_launch_buttons = [ make_button(identifier, 'Clip_Launch_Button_' + str(i), is_pad=True) for i, identifier in enumerate(pad_identifiers) ]
self._session = SpecialSessionComponent(num_tracks=8, num_scenes=0, name='Session')
self._session.set_enabled(False)
self._session.set_mixer(self._session_mixer)
self._session_layer = Layer(track_bank_left_button=make_button(116, 'Track_Bank_Left_Button'), track_bank_right_button=make_button(117, 'Track_Bank_Right_Button'), select_prev_button=make_button(114, 'Scene_Bank_Up_Button'), select_next_button=make_button(115, 'Scene_Bank_Down_Button'), clip_launch_buttons=ButtonMatrixElement(rows=[clip_launch_buttons]))
scene = self._session.selected_scene()
for index in range(8):
clip_slot = scene.clip_slot(index)
clip_slot.set_triggered_to_play_value(Colors.GREEN_BLINK)
clip_slot.set_triggered_to_record_value(Colors.RED_BLINK)
clip_slot.set_stopped_value(Colors.AMBER_FULL)
clip_slot.set_started_value(Colors.GREEN_FULL)
clip_slot.set_recording_value(Colors.RED_FULL)
clip_slot.name = 'Selected_Clip_Slot_' + str(index)
self._on_track_offset.subject = self._session
def _init_device(self):
make_button = partial(make_launch_control_button, channel=10)
make_encoder = partial(make_launch_control_encoder, channel=10)
bottom_encoders, top_encoders = make_all_encoders('Device', make_encoder)
parameter_controls = top_encoders[:4] + bottom_encoders[:4]
bank_buttons = [ make_button(identifier, 'Device_Bank_Button_' + str(i), is_pad=True) for i, identifier in enumerate(pad_identifiers) ]
for button in bank_buttons:
button.set_on_off_values(Colors.LED_ON, Colors.LED_OFF)
self._device_bank_registry = DeviceBankRegistry()
self._device = DeviceComponent(device_bank_registry=self._device_bank_registry, name='Device')
self._device.set_enabled(False)
self._device.layer = Layer(parameter_controls=ButtonMatrixElement(rows=[parameter_controls]), bank_buttons=ButtonMatrixElement(rows=[bank_buttons]))
#.........这里部分代码省略.........
示例3: FCB1020
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import selected_scene [as 别名]
class FCB1020(ControlSurface):
__doc__ = " Script for FCB1010 in APC emulation mode "
_active_instances = []
def _combine_active_instances():
track_offset = 0
scene_offset = 0
for instance in FCB1020._active_instances:
instance._activate_combination_mode(track_offset, scene_offset)
track_offset += instance._session.width()
_combine_active_instances = staticmethod(_combine_active_instances)
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
#self.set_suppress_rebuild_requests(True)
with self.component_guard():
self._note_map = []
self._ctrl_map = []
self._load_MIDI_map()
self._session = None
self._session_zoom = None
self._mixer = None
self._setup_session_control()
self._setup_mixer_control()
self._session.set_mixer(self._mixer)
self._setup_device_and_transport_control()
self.set_highlighting_session_component(self._session)
#self.set_suppress_rebuild_requests(False)
self._pads = []
self._load_pad_translations()
self._do_combine()
def disconnect(self):
self._note_map = None
self._ctrl_map = None
self._pads = None
self._do_uncombine()
self._shift_button = None
self._session = None
self._session_zoom = None
self._mixer = None
ControlSurface.disconnect(self)
def _do_combine(self):
if self not in FCB1020._active_instances:
FCB1020._active_instances.append(self)
FCB1020._combine_active_instances()
def _do_uncombine(self):
if ((self in FCB1020._active_instances) and FCB1020._active_instances.remove(self)):
self._session.unlink()
FCB1020._combine_active_instances()
def _activate_combination_mode(self, track_offset, scene_offset):
if TRACK_OFFSET != -1:
track_offset = TRACK_OFFSET
if SCENE_OFFSET != -1:
scene_offset = SCENE_OFFSET
self._session.link_with_track_offset(track_offset, scene_offset)
def _setup_session_control(self):
is_momentary = True
self._session = SpecialSessionComponent(8, 5)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(self._note_map[SESSIONRIGHT], self._note_map[SESSIONLEFT])
self._session.set_scene_bank_buttons(self._note_map[SESSIONDOWN], self._note_map[SESSIONUP])
self._session.set_select_buttons(self._note_map[SCENEDN], self._note_map[SCENEUP])
self._scene_launch_buttons = [self._note_map[SCENELAUNCH[index]] for index in range(5) ]
self._track_stop_buttons = [self._note_map[TRACKSTOP[index]] for index in range(8) ]
self._session.set_stop_all_clips_button(self._note_map[STOPALLCLIPS])
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.set_stop_track_clip_value(2)
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(self._note_map[SELSCENELAUNCH])
self._session.set_slot_launch_button(self._note_map[SELCLIPLAUNCH])
for scene_index in range(5):
scene = self._session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(self._scene_launch_buttons[scene_index])
scene.set_triggered_value(2)
for track_index in range(8):
button = self._note_map[CLIPNOTEMAP[scene_index][track_index]]
button_row.append(button)
clip_slot = scene.clip_slot(track_index)
clip_slot.name = str(track_index) + '_Clip_Slot_' + str(scene_index)
clip_slot.set_launch_button(button)
self._session_zoom = SpecialZoomingComponent(self._session)
self._session_zoom.name = 'Session_Overview'
self._session_zoom.set_nav_buttons(self._note_map[ZOOMUP], self._note_map[ZOOMDOWN], self._note_map[ZOOMLEFT], self._note_map[ZOOMRIGHT])
def _setup_mixer_control(self):
is_momentary = True
self._mixer = SpecialMixerComponent(8)
self._mixer.name = 'Mixer'
#.........这里部分代码省略.........
示例4: Axiom_AIR_25_49_61
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import selected_scene [as 别名]
#.........这里部分代码省略.........
self._name_display.name = "Name_Display"
self._name_display.set_message_parts(SYSEX_START + (21,), (0, 247))
self._name_display.set_clear_all_message(CLEAR_NAME)
self._name_display_data_source = DisplayDataSource()
self._name_display.segment(0).set_data_source(self._name_display_data_source)
self._value_display = NumericalDisplayElement(3, 1)
self._value_display.name = "Value_Display"
self._value_display.set_message_parts(SYSEX_START + (20, 48), (0, 247))
self._value_display.set_clear_all_message(CLEAR_VALUE)
self._value_display_data_source = DisplayDataSource()
self._value_display.segment(0).set_data_source(self._value_display_data_source)
self._bank_display = NumericalDisplayElement(3, 1)
self._bank_display.name = "Bank_Display"
self._bank_display.set_message_parts(SYSEX_START + (19,), (0, 247))
self._bank_display.set_clear_all_message(CLEAR_BANK)
self._bank_display_data_source = DisplayDataSource()
self._bank_display.segment(0).set_data_source(self._bank_display_data_source)
self._pad_display = NumericalDisplayElement(2, 1)
self._pad_display.name = "Pad_Display"
self._pad_display.set_message_parts(SYSEX_START + (18,), (0, 247))
self._pad_display.set_clear_all_message(CLEAR_PAD)
self._pad_display_data_source = DisplayDataSource()
self._pad_display.segment(0).set_data_source(self._pad_display_data_source)
def _setup_mixer(self):
self._mixer_for_encoders = SpecialMixerComponent(self._name_display, self._value_display, 8)
self._mixer_for_encoders.name = "Mixer_for_encoders"
self._mixer_for_faders = SpecialMixerComponent(self._name_display, self._value_display, 8)
self._mixer_for_faders.name = "Mixer_for_faders"
def _setup_session(self):
self._session = SpecialSessionComponent(8, 0)
self._session.name = "Session_Control"
self._session.selected_scene().name = "Selected_Scene"
self._session.set_mixer(self._mixer_for_encoders)
self._session.set_alt_mixer(self._mixer_for_faders)
self._session.add_offset_listener(self._update_bank_value)
def _setup_transport(self):
self._transport = TransportComponent()
self._transport.name = "Transport"
self._transport.set_stop_button(self._stop_button)
self._transport.set_play_button(self._play_button)
self._transport.set_record_button(self._rec_button)
transport_view_modes = TransportViewModeSelector(
self._transport, self._session, self._ffwd_button, self._rwd_button, self._loop_button
)
transport_view_modes.name = "Transport_View_Modes"
def _setup_device(self):
self._device_for_encoders = BestBankDeviceComponent()
self._device_for_encoders.name = "Device_Component_for_encoders"
self._device_for_faders = BestBankDeviceComponent()
self._device_for_faders.name = "Device_Component_for_faders"
self.set_device_component(self._device_for_encoders)
self.set_alt_device_component(self._device_for_faders)
self._device_nav = DeviceNavComponent()
self._device_nav.name = "Device_Nav_Component"
def _setup_modes(self):
self._fader_button_modes = FaderButtonModeSelector(self._mixer_for_faders, tuple(self._fader_buttons))
self._fader_button_modes.name = "Fader_Button_Modes"
self._fader_button_modes.set_mode_toggle(self._fader_group_mode_button)
self._fader_modes = FaderModeSelector(
self._mixer_for_faders,
self._device_for_faders,
示例5: X1MK2
# 需要导入模块: from SpecialSessionComponent import SpecialSessionComponent [as 别名]
# 或者: from SpecialSessionComponent.SpecialSessionComponent import selected_scene [as 别名]
class X1MK2(ControlSurface):
__doc__ = " Script for Traktor X1MK2 in APC emulation mode "
_active_instances = []
def _combine_active_instances():
track_offset = 0
scene_offset = 0
for instance in X1MK2._active_instances:
instance._activate_combination_mode(track_offset, scene_offset)
track_offset += instance._session.width()
_combine_active_instances = staticmethod(_combine_active_instances)
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
self._color_skin = make_rgb_skin()
#self.set_suppress_rebuild_requests(True)
with self.component_guard():
self._to_notify = []
self._clip_map = []
self._note_map = []
self._ctrl_map = []
self._enc_map = []
self._load_MIDI_map()
self._session = None
self._session_zoom = None
self._mixer = None
self._setup_session_control()
self._setup_mixer_control()
self._session.set_mixer(self._mixer)
self._setup_device_and_transport_control()
self.set_highlighting_session_component(self._session)
#self.set_suppress_rebuild_requests(False)
self._pads = []
self._load_pad_translations()
self._do_combine()
def disconnect(self):
self._clip_map = None
self._note_map = None
self._ctrl_map = None
self._pads = None
self._do_uncombine()
self._shift_button = None
self._session = None
self._session_zoom = None
self._mixer = None
ControlSurface.disconnect(self)
def _do_combine(self):
if self not in X1MK2._active_instances:
X1MK2._active_instances.append(self)
X1MK2._combine_active_instances()
def _do_uncombine(self):
if ((self in X1MK2._active_instances) and X1MK2._active_instances.remove(self)):
self._session.unlink()
X1MK2._combine_active_instances()
def _activate_combination_mode(self, track_offset, scene_offset):
if TRACK_OFFSET != -1:
track_offset = TRACK_OFFSET
if SCENE_OFFSET != -1:
scene_offset = SCENE_OFFSET
self._session.link_with_track_offset(track_offset, scene_offset)
def _setup_session_control(self):
is_momentary = True
self._session = SpecialSessionComponent(SESSION_WIDTH, SESSION_HEIGHT, self.log_message, enable_skinning = True)
self._session.set_rgb_mode(color_palette = CLIP_COLOR_TABLE(self.log_message), color_table = None, clip_slots_only = True)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(self._note_map[SESSIONRIGHT], self._note_map[SESSIONLEFT])
self._session.set_scene_bank_buttons(self._note_map[SESSIONDOWN], self._note_map[SESSIONUP])
self._session.set_select_buttons(self._note_map[SCENEDN], self._note_map[SCENEUP])
self._scene_launch_buttons = [self._note_map[SCENELAUNCH[index]] for index in range(5) ]
self._track_stop_buttons = [self._note_map[TRACKSTOP[index]] for index in range(SESSION_WIDTH)]
self._session.set_stop_all_clips_button(self._note_map[STOPALLCLIPS])
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(self._note_map[SELSCENELAUNCH])
self._session.set_slot_launch_button(self._note_map[SELCLIPLAUNCH])
for scene_index in range(SESSION_HEIGHT):
scene = self._session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(self._scene_launch_buttons[scene_index])
scene.set_triggered_value(2)
for track_index in range(SESSION_WIDTH):
button = self._clip_map[CLIPNOTEMAP[scene_index][track_index]]
button.num_delayed_messages = 3
delete_button = self._note_map[DELETECLIPNOTEMAP[scene_index][track_index]]
button_row.append(button)
clip_slot = scene.clip_slot(track_index)
clip_slot.name = str(track_index) + '_Clip_Slot_' + str(scene_index)
clip_slot.set_launch_button(button)
#.........这里部分代码省略.........