本文整理汇总了Python中_Framework.ControlSurfaceComponent.ControlSurfaceComponent类的典型用法代码示例。如果您正苦于以下问题:Python ControlSurfaceComponent类的具体用法?Python ControlSurfaceComponent怎么用?Python ControlSurfaceComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ControlSurfaceComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent, buttons):
ControlSurfaceComponent.__init__(self)
self.set_enabled(False)
self._parent = parent
self._clip = None
self._notes = None
self._playhead = None
self._loop_end = 0
self._loop_start = 0
self._blocksize = 8 # number of note per block
self._block = 0 # current block
# used for loop selection
self._last_button = -1
self._last_button_time = time.time()
self._loop_point1 = -1
self._loop_point2 = -1
self._cache = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
self._buttons = buttons
for button in self._buttons :
assert isinstance(button, ButtonElement)
button.remove_value_listener(self._loop_button_value)
button.add_value_listener(self._loop_button_value, identify_sender=True)
示例2: __init__
def __init__(self):
ControlSurfaceComponent.__init__(self)
self._track = None
self._device = None
self._gain_controls = None
self._cut_buttons = None
return
示例3: __init__
def __init__(self, parent, rack, name, track):
ControlSurfaceComponent.__init__(self)
self._parent = parent
self._on_off_param = []
self._devices_to_operate_on = []
self._track = track
self.setup_device(rack, name)
示例4: __init__
def __init__(self):
ControlSurfaceComponent.__init__(self)
self._stop_button = None
self._play_button = None
self._ffwd_button = None
self._rwd_button = None
self._loop_button = None
self._punch_in_button = None
self._punch_out_button = None
self._record_button = None
self._tap_tempo_button = None
self._nudge_up_button = None
self._nudge_down_button = None
self._metronome_button = None
self._overdub_button = None
self._tempo_control = None
self._tempo_fine_control = None
self._song_position_control = None
self._rwd_button_pressed = False
self._ffwd_button_pressed = False
self._fine_tempo_needs_pickup = True
self._prior_fine_tempo_value = -1
self.song().add_loop_listener(self._on_loop_status_changed)
self.song().add_punch_in_listener(self._on_punch_in_status_changed)
self.song().add_punch_out_listener(self._on_punch_out_status_changed)
self.song().add_record_mode_listener(self._on_record_status_changed)
self.song().add_is_playing_listener(self._on_playing_status_changed)
self.song().add_nudge_down_listener(self._on_nudge_down_changed)
self.song().add_nudge_up_listener(self._on_nudge_up_changed)
self.song().add_metronome_listener(self._on_metronome_changed)
self.song().add_overdub_listener(self._on_overdub_changed)
示例5: __init__
def __init__(self, script):
ControlSurfaceComponent.__init__(self)
self._sub_components = []
self._script = script
self._host_name = 'AumPad'
self._dial_matrix = None
self._grid = None
self._keys = None
self._menu = None
self._active_client = None
self._shift_button = None
self._shift_pressed = 0
self._alt_button = None
self._alt_pressed = 0
self._locked = 0
self._x = 0
self._y = 0
self._client_buttons = []
self._channel_buttons = []
self._color_maps = [range(128) for index in range(16)]
self._colors = self._color_maps[0]
self._offsets = [[0, 0] for index in range(16)]
self._is_enabled = False
self._is_connected = False
self._key_buttons = None
self._bank_buttons = None
return None
示例6: __init__
def __init__(self, parent):
# Boilerplate
ControlSurfaceComponent.__init__(self)
self._parent = parent
# Default the L/R/Master levels to 0
self._meter_level = 0
self._left_level = 0
self._right_level = 0
# We don't start clipping
self._clipping = False
# The tracks we'll be pulling L and R RMS from
self._left_track = self.song().tracks[LEFT_SOURCE]
self._right_track = self.song().tracks[RIGHT_SOURCE]
#setup classes
self.left_meter = VUMeter(self, self._left_track,
CHANNEL_SCALE_MAX,
CHANNEL_SCALE_MIN, CHANNEL_SCALE_INCREMENTS,
LEFT_COLUMN_VUS)
self.right_meter = VUMeter(self, self._right_track,
CHANNEL_SCALE_MAX,
CHANNEL_SCALE_MIN, CHANNEL_SCALE_INCREMENTS,
RIGHT_COLUMN_VUS)
self.master_meter = VUMeter(self, self.song().master_track,
MASTER_SCALE_MAX,
MASTER_SCALE_MIN, MASTER_SCALE_INCREMENTS,
None, True)
# Listeners!
self._left_track.add_output_meter_left_listener(self.left_meter.observe)
self._right_track.add_output_meter_left_listener(self.right_meter.observe)
self.song().master_track.add_output_meter_left_listener(self.master_meter.observe)
示例7: __init__
def __init__(self):
ControlSurfaceComponent.__init__(self)
self._track = None
self._device = None
self._freq_control = None
self._reso_control = None
return
示例8: on_selected_track_changed
def on_selected_track_changed(self):
""" Handles navigation highlight, triggering exclusive arm/fold functions and removes/sets up listeners for clip-related functions """
ControlSurfaceComponent.on_selected_track_changed(self)
track = self.song().view.selected_track
clip_slot = self.song().view.highlighted_clip_slot
self.remove_listeners()
if self._show_highlight:
tracks = list(self.song().visible_tracks + self.song().return_tracks)
tracks.append(self.song().master_track)
if self.song().view.selected_track in tracks:
self._parent._set_session_highlight(tracks.index(self.song().view.selected_track), list(self.song().scenes).index(self.song().view.selected_scene), 1, 1, True)
if self._exclusive_arm and track != self._last_track:
self._parent.schedule_message(1, self.do_exclusive_arm, track)
if self._exclusive_fold and track != self._last_track:
self._parent.schedule_message(1, self.do_exclusive_fold, track)
if self._clip_record:
if track.can_be_armed and not clip_slot.has_clip:
self._clip_record_slot = clip_slot
if not self._clip_record_slot.has_clip_has_listener(self.clip_record_slot_changed):
self._clip_record_slot.add_has_clip_listener(self.clip_record_slot_changed)
if self._midi_clip_length:
if track.has_midi_input and not clip_slot.has_clip and not track.is_foldable:
self._midi_clip_length_slot = clip_slot
if not self._midi_clip_length_slot.has_clip_has_listener(self.midi_clip_length_slot_changed):
self._midi_clip_length_slot.add_has_clip_listener(self.midi_clip_length_slot_changed)
self._last_track = track
示例9: __init__
def __init__(self):
ControlSurfaceComponent.__init__(self)
self._name = 'OSD'
self._update_listener = None
self._updateML_listener = None
self.mode = ' '
self.clear()
示例10: set_enabled
def set_enabled(self, enabled):
if not enabled:
self._do_implicit_arm(enabled)
ControlSurfaceComponent.set_enabled(self, enabled)
ModesComponent.set_enabled(self._modes, enabled)
if enabled:
self._do_implicit_arm(enabled)
示例11: __init__
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")
示例12: __init__
def __init__(self, control_surface = None, step_sequencer = None, matrix = None, side_buttons = None):
ControlSurfaceComponent.__init__(self)
self._control_surface = control_surface
self._step_sequencer = step_sequencer
self._clip = None
self._playhead = None
# clip
self._clip = None
self._note_cache = []
self._force_update = True
self._init_data()
self._velocity_map = [0, 30, 60, 80, 100, 115, 127]
self._length_map = [1, 2, 3, 4, 8, 16, 32]
# time
self._playhead = 0
self._page = 0
# notes
self._key_indexes = [36, 37, 38, 39, 40, 41, 42, 43]
self._key_index_is_in_scale = [True, False, True, True, False, True, False, True]
self._key_index_is_root_note = [True, False, False, False, False, False, False, False]
self._is_monophonic = False
# quantization
self._quantization = 16
# MODE
self._mode = STEPSEQ_MODE_NOTES
# buttons
self._random_button = None
self._mode_notes_lengths_button = None
self._mode_notes_octaves_button = None
self._mode_notes_velocities_button = None
self._mode_notes_pitches_button = None
self._matrix = None
self._is_notes_pitches_shifted = False
self._last_notes_pitches_button_press = time.time()
self._last_notes_velocity_button_press = time.time()
self._last_notes_pitches_button_press = time.time()
self._is_octave_shifted = False
self._last_notes_octaves_button_press = time.time()
self._is_notes_velocity_shifted = False
self._is_notes_lengths_shifted = False
self._last_notes_lengths_button_press = time.time()
if side_buttons != None:
self.set_random_button(side_buttons[3])
self.set_mode_notes_lengths_button(side_buttons[4])
self.set_mode_notes_octaves_button(buttons[5])
self.set_mode_notes_velocities_button(self._side_buttons[6])
self.set_mode_notes_pitches_button(self._side_buttons[7])
self._is_velocity_shifted = False
self._is_mute_shifted = False
示例13: __init__
def __init__(self, parent, controls, override):
ControlSurfaceComponent.__init__(self)
self._parent = parent
self._controls = controls
self._override = override
self._last_beat = -1
self.song().add_current_song_time_listener(self.on_time_changed)
self.song().add_is_playing_listener(self.on_time_changed)
示例14: __init__
def __init__(self, parent):
ControlSurfaceComponent.__init__(self)
self.parent = parent
self.last_beat = None
self.led_pad = []
self.led_metro_buttons()
self.last_time = None
self.count = -1
示例15: __init__
def __init__(self, target, led_range = [0.52, 0.90], track = "master", **kwargs):
ControlSurfaceComponent.__init__(self)
Elementary.__init__(self, **kwargs)
self.bottom = led_range[0]
self.top = led_range[1]
self.multiplier = (127 / (self.top - self.bottom))
if target:
self.setup_vu(target)