本文整理汇总了Python中LC2Sysex.LC2Sysex.l9方法的典型用法代码示例。如果您正苦于以下问题:Python LC2Sysex.l9方法的具体用法?Python LC2Sysex.l9怎么用?Python LC2Sysex.l9使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LC2Sysex.LC2Sysex
的用法示例。
在下文中一共展示了LC2Sysex.l9方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _bank_left
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def _bank_left(self):
if LC2Sysex.l9():
if self.track_offset() > 0:
SessionComponent._bank_left(self)
self.send_offsets()
else:
self._bank_left_button.turn_off()
示例2: __init__
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def __init__(self):
ControlSurfaceComponent.__init__(self)
self._register_timer_callback(self._on_timer)
self._refresh = 0
self._clip = None
self._note_cache = []
self._last_note = 36
self._last_pos = 0
self._quantisation = 0.25
self._default_length = 1
self._default_velocity = 100
self._time_offset = 0
self._note_offset = 36
self._num_steps = 16
self._height = 16
self._root = 0
self._scale = 0
self._scales = [[], [0, 2, 4, 5, 7, 9, 11], [0, 2, 3, 5, 7, 8, 10], [0, 2, 3, 5, 7, 8, 11], [0, 2, 4, 7, 9]]
self._mutes = [0 for i in range(127)]
self._fader_type = 0
self._fold_notes = 0
self._save_note = 0
self._ltime = ""
self._chord_intervals = [[0, 4, 7], [0, 3, 7], [0, 4, 8], [0, 4, 6], [0, 3, 6], [0, 5, 7]]
self._quick_chord = 127
self._durations = [0.125, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4]
self._selection = [0, 0, 0, 0]
self._last_details = [-1, -1, -1, -1, -1]
if LC2Sysex.l9():
self._clisten = ("loop_start", "loop_end", "start_marker", "end_marker")
else:
self._clisten = ("loop_start", "loop_end")
示例3: _bank_right
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def _bank_right(self):
if LC2Sysex.l9():
if len(self.tracks_to_use()) > self.track_offset() + self.width():
SessionComponent._bank_right(self)
self.send_offsets()
if len(self.tracks_to_use()) == self.track_offset() + self.width():
self._bank_right_button.turn_off()
示例4: __init__
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
LC2Sysex.set_log(self.log_message)
if LC2Sysex.l9():
with self.component_guard():
self.do_setup()
else:
self.do_setup()
示例5: _bank_down
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def _bank_down(self):
if LC2Sysex.l9():
if len(self.song().scenes) > self.scene_offset() + self.height():
SessionComponent._bank_down(self)
self.send_offsets()
LC2Sysex.log_message(str(len(self.song().scenes)) + ' ' + str(self.scene_offset() + self.height()))
if len(self.song().scenes) == self.scene_offset() + self.height():
self._bank_down_button.turn_off()
示例6: _half
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def _half(self, args):
if self._clip is not None:
self._clip.loop_end -= self._clip.length / 2
if LC2Sysex.l9():
if self._clip.end_marker > self._clip.loop_end:
self._clip.end_marker = self._clip.loop_end
self._time_offset = 0
self.update()
self._send_offsets()
示例7: disconnect
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def disconnect(self):
self._do_uncombine()
if LC2Sysex.l9():
task = self._tasks.find(self._on_time_changed)
self._tasks.remove(task)
else:
self._unregister_timer_callback(self._on_time_changed)
self.song().remove_tempo_listener(self._on_tempo_changed)
ControlSurface.disconnect(self)
LC2Sysex.release_attributes()
LC2SessionBank.release_attributes()
示例8: __init__
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def __init__(self, num_tracks, num_scenes):
self._scene_count = LC2Sysex.l9() and -1 or 0
self._num_tracks = num_tracks
self._height = num_scenes
self._width = num_tracks
self._snapshot_bank = LC2SessionBank()
SessionComponent.__init__(self, num_tracks, num_scenes)
LC2SceneComponent.set_get_offsets(self._get_offset)
LC2ChannelStripComponent.set_get_offsets(self._get_offset)
LC2ClipSlotComponent.set_get_offsets(self._get_offset)
LC2ChannelStripComponent.set_playing_slot_changed(self._playing_slot_changed)
示例9: update
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def update(self):
DeviceComponent.update(self)
if self.is_enabled():
if self._lock_button != None:
if self._locked_to_device:
self._lock_button.turn_on()
else:
self._lock_button.turn_off()
if LC2Sysex.l9():
self._update_on_off_button()
else:
self._on_on_off_changed()
示例10: do_setup
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def do_setup(self):
if LC2Sysex.l9():
self._set_suppress_rebuild_requests(True)
else:
self.set_suppress_rebuild_requests(True)
self._suppress_session_highlight = True
self._suppress_send_midi = True
LC2Sysex.set_midi_callback(self._send_midi)
LC2SessionBank.set_song(self.song)
LC2SessionBank.set_timer_callback(self.schedule_message)
self._session = LC2SessionComponent(8, 12)
self._mixer = LC2MixerComponent(8)
self._session.set_mixer(self._mixer)
if LC2Sysex.l9():
self.set_highlighting_session_component(self._session)
bank_buttons = [ ButtonElement(False, MIDI_NOTE_TYPE, 0, 40 + i) for i in range(4) ]
self._session.set_scene_bank_buttons(bank_buttons[0], bank_buttons[1])
self._session.set_track_bank_buttons(bank_buttons[2], bank_buttons[3])
mixer_controls = [ SliderElement(MIDI_CC_TYPE, 0, i) for i in range(24) ]
mixer_d_controls = [ LC2ParameterElement(MIDI_CC_TYPE, 0, i + 64) for i in range(32) ]
toggle_controls = [ ButtonElement(True, MIDI_NOTE_TYPE, 0, i + 1) for i in range(24) ]
cf = [ ButtonElement(True, MIDI_NOTE_TYPE, 0, i + 30) for i in range(8) ]
mt = [ ButtonElement(True, MIDI_NOTE_TYPE, 0, i + 50) for i in range(8) ]
self._mixer.master_strip().set_volume_control(SliderElement(MIDI_CC_TYPE, 0, 33))
self._mixer.master_strip().set_pan_control(SliderElement(MIDI_CC_TYPE, 0, 34))
self._mixer.set_prehear_volume_control(SliderElement(MIDI_CC_TYPE, 0, 35))
self._mixer.set_crossfader_control(SliderElement(MIDI_CC_TYPE, 0, 40))
for i in range(8):
idx = i * 3
ch = self._mixer.channel_strip(i)
ch.set_invert_mute_feedback(True)
ch.set_mute_button(toggle_controls[idx])
ch.set_solo_button(toggle_controls[idx + 1])
ch.set_arm_button(toggle_controls[idx + 2])
ch.set_volume_control(mixer_controls[idx])
ch.set_pan_control(mixer_controls[idx + 1])
ch.set_send_control(mixer_controls[idx + 2])
ch.set_crossfade_toggle(cf[i])
ch.set_monitor_toggle(mt[i])
ch.set_device_controls(tuple(mixer_d_controls[i * 4:i * 4 + 4]))
self._modulator = LC2Modulator()
self.set_device_component(self._modulator)
device_controls = [ LC2ParameterElement(MIDI_CC_TYPE, 1, i, True) for i in range(16) ]
self._modulator.set_parameter_controls(tuple(device_controls))
device_buttons = [ ButtonElement(False, MIDI_NOTE_TYPE, 1, i) for i in range(4) ]
self._modulator.set_on_off_button(device_buttons[0])
self._modulator.set_lock_button(device_buttons[1])
self._modulator.set_bank_nav_buttons(device_buttons[2], device_buttons[3])
self._sequencer = LC2Sequencer()
self._session.set_sequencer(self._sequencer)
self._transport = LC2TransportComponent()
tbuttons = [ ButtonElement(True, MIDI_NOTE_TYPE, 0, 110 + i) for i in range(12) ]
self._transport.set_stop_button(tbuttons[0])
self._transport.set_play_button(tbuttons[1])
self._transport.set_record_button(tbuttons[2])
self._transport.set_overdub_button(tbuttons[3])
self._transport.set_back_to_arranger_button(tbuttons[4])
self._transport.set_follow_button(tbuttons[5])
self._transport.set_metronome_button(tbuttons[6])
self._transport.set_tap_tempo_button(tbuttons[7])
self._transport.set_tempo_buttons(tbuttons[9], tbuttons[8])
self._transport.set_launch_quant_button(SliderElement(MIDI_CC_TYPE, 0, 120))
self._transport.set_record_quant_button(SliderElement(MIDI_CC_TYPE, 0, 121))
self._last_time = ''
if LC2Sysex.l9():
def wrapper(delta):
self._on_time_changed()
return Task.RUNNING
self._tasks.add(Task.FuncTask(wrapper, self._on_time_changed))
else:
self._register_timer_callback(self._on_time_changed)
self.song().add_tempo_listener(self._on_tempo_changed)
for component in self.components:
component.set_enabled(False)
if LC2Sysex.l9():
self._set_suppress_rebuild_requests(False)
else:
self.set_suppress_rebuild_requests(False)
示例11: LC2ClipSlotComponent
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
#Embedded file name: /Applications/Ableton Live 9 Suite.app/Contents/App-Resources/MIDI Remote Scripts/LiveControl_2_1_31/LC2ClipSlotComponent.py
import Live
from LC2Sysex import LC2Sysex
from _Framework.ClipSlotComponent import ClipSlotComponent
if LC2Sysex.l9():
from _Framework.SubjectSlot import subject_slot
class LC2ClipSlotComponent(ClipSlotComponent):
def set_get_offsets(func):
LC2ClipSlotComponent._get_offset = func
set_get_offsets = staticmethod(set_get_offsets)
def release_attributes():
LC2ClipSlotComponent._get_offset = None
release_attributes = staticmethod(release_attributes)
def __init__(self, tid, sid):
ClipSlotComponent.__init__(self)
self._tid = tid
self._sid = sid
if not LC2Sysex.l9():
def _set_clip_slot(self, clip_slot):
if clip_slot != self._clip_slot:
if self._clip_slot is not None:
try:
self._clip_slot.remove_has_stop_button_listener(self._send_state)
示例12: _bank_up
# 需要导入模块: from LC2Sysex import LC2Sysex [as 别名]
# 或者: from LC2Sysex.LC2Sysex import l9 [as 别名]
def _bank_up(self):
if LC2Sysex.l9():
SessionComponent._bank_up(self)
self.send_offsets()
if self.scene_offset() == 0:
self._bank_up_button.turn_off()