本文整理汇总了Python中ConfigurableButtonElement.ConfigurableButtonElement.name方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigurableButtonElement.name方法的具体用法?Python ConfigurableButtonElement.name怎么用?Python ConfigurableButtonElement.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurableButtonElement.ConfigurableButtonElement
的用法示例。
在下文中一共展示了ConfigurableButtonElement.name方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
with self.component_guard():
self._suppress_send_midi = True
self._suppress_session_highlight = True
is_momentary = True
self._suggested_input_port = 'Launchpad'
self._suggested_output_port = 'Launchpad'
self._control_is_with_automap = False
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
self._user_byte_write_button.name = 'User_Byte_Button'
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
self._wrote_user_byte = False
self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143
matrix = ButtonMatrixElement()
matrix.name = 'Button_Matrix'
for row in range(8):
button_row = []
for column in range(8):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, row * 16 + column)
button.name = str(column) + '_Clip_' + str(row) + '_Button'
button_row.append(button)
matrix.add_row(tuple(button_row))
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0, optimized_send_midi=False)
self._config_button.add_value_listener(self._config_value)
top_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_CC_TYPE, 0, 104 + index) for index in range(8) ]
side_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, SIDE_NOTES[index]) for index in range(8) ]
top_buttons[0].name = 'Bank_Select_Up_Button'
top_buttons[1].name = 'Bank_Select_Down_Button'
top_buttons[2].name = 'Bank_Select_Left_Button'
top_buttons[3].name = 'Bank_Select_Right_Button'
top_buttons[4].name = 'Session_Button'
top_buttons[5].name = 'User1_Button'
top_buttons[6].name = 'User2_Button'
top_buttons[7].name = 'Mixer_Button'
side_buttons[0].name = 'Vol_Button'
side_buttons[1].name = 'Pan_Button'
side_buttons[2].name = 'SndA_Button'
side_buttons[3].name = 'SndB_Button'
side_buttons[4].name = 'Stop_Button'
side_buttons[5].name = 'Trk_On_Button'
side_buttons[6].name = 'Solo_Button'
side_buttons[7].name = 'Arm_Button'
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, self)
self._selector.name = 'Main_Modes'
self._do_combine()
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self.set_highlighting_session_component(self._selector.session_component())
self._suppress_session_highlight = False
#self.set_suppress_rebuild_requests(False)
self.log_message("LaunchPad95 Loaded !")
示例2: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
self.set_suppress_rebuild_requests(True)
self._suppress_send_midi = True
self._suppress_session_highlight = True
is_momentary = True
self._suggested_input_port = "Launchpad"
self._suggested_output_port = "Launchpad"
self._control_is_with_automap = False
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
self._user_byte_write_button.name = "User_Byte_Button"
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
self._wrote_user_byte = False
self._challenge = (Live.Application.get_random_int(0, 400000000) & 2139062143)
matrix = ButtonMatrixElement()
matrix.name = "Button_Matrix"
for row in range(8):
button_row = []
for column in range(8):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, ((row * 16) + column))
button.name = (((str(column) + "_Clip_") + str(row)) + "_Button")
button_row.append(button)
matrix.add_row(tuple(button_row))
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0)
self._config_button.add_value_listener(self._config_value)
top_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_CC_TYPE, 0, (104 + index)) for index in range(8) ]
side_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, SIDE_NOTES[index]) for index in range(8) ]
top_buttons[0].name = "Bank_Select_Up_Button"
top_buttons[1].name = "Bank_Select_Down_Button"
top_buttons[2].name = "Bank_Select_Left_Button"
top_buttons[3].name = "Bank_Select_Right_Button"
top_buttons[4].name = "Session_Button"
top_buttons[5].name = "User1_Button"
top_buttons[6].name = "User2_Button"
top_buttons[7].name = "Mixer_Button"
side_buttons[0].name = "Vol_Button"
side_buttons[1].name = "Pan_Button"
side_buttons[2].name = "SndA_Button"
side_buttons[3].name = "SndB_Button"
side_buttons[4].name = "Stop_Button"
side_buttons[5].name = "Trk_On_Button"
side_buttons[6].name = "Solo_Button"
side_buttons[7].name = "Arm_Button"
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, self)
self._selector.name = "Main_Modes"
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self._suppress_session_highlight = False
self.set_suppress_rebuild_requests(False)
self.log_message("LaunchPad85 Loaded !")
示例3: create_configurable_button
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def create_configurable_button(identifier, name, send_channel_offset=0, identifier_send_offset=0, send_msg_type=None):
button = ConfigurableButtonElement(
IS_MOMENTARY,
MIDI_CC_TYPE,
GLOBAL_CHANNEL,
identifier,
GLOBAL_SEND_CHANNEL + send_channel_offset,
identifier_send_offset,
send_msg_type,
)
button.name = name
return button
示例4: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
with self.component_guard():
#self.set_suppress_rebuild_requests(True)
self._suppress_send_midi = True
self._suppress_session_highlight = True
is_momentary = True
self._suggested_input_port = "Launchpad"
self._suggested_output_port = "Launchpad"
self._control_is_with_automap = False
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
self._user_byte_write_button.name = "User_Byte_Button"
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
self._wrote_user_byte = False
self._challenge = (Live.Application.get_random_int(0, 400000000) & 2139062143)
matrix = ButtonMatrixElement()
matrix.name = "Button_Matrix"
""" TRACKFINDER TEST
track_index = 0
for track in self.song().tracks:
if track_index < 8:
button_row = []
if track.is_foldable:
for column in range(8):
log("right one: " + str(track_index))
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, ((track_index * 16) + column)) #@UndefinedVariable
button.name = (((str(column) + "_Clip_") + str(track_index)) + "_Button")
button_row.append(button)
track_index = track_index + 1
else:
for column in range(8):
log("wrong one: " + str(track_index))
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 99, True) #@UndefinedVariable
button.name = (str(column) + "_Clip_Button-DUMMY")
button_row.append(button)
matrix.add_row(tuple(button_row))
log("done")"""
""" ORIGINAL CODE """
for row in range(8):
button_row = []
for column in range(8):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, ((row * 16) + column))
button.name = (((str(column) + "_Clip_") + str(row)) + "_Button")
button_row.append(button)
matrix.add_row(tuple(button_row))
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0, optimized_send_midi=False)
self._config_button.add_value_listener(self._config_value)
top_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_CC_TYPE, 0, (104 + index)) for index in range(8) ]
side_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, SIDE_NOTES[index]) for index in range(8) ]
top_buttons[0].name = "Bank_Select_Up_Button"
top_buttons[1].name = "Bank_Select_Down_Button"
top_buttons[2].name = "Bank_Select_Left_Button"
top_buttons[3].name = "Bank_Select_Right_Button"
top_buttons[4].name = "Session_Button"
top_buttons[5].name = "User1_Button"
top_buttons[6].name = "User2_Button"
top_buttons[7].name = "Mixer_Button"
side_buttons[0].name = "Vol_Button"
side_buttons[1].name = "Pan_Button"
side_buttons[2].name = "SndA_Button"
side_buttons[3].name = "SndB_Button"
side_buttons[4].name = "Stop_Button"
side_buttons[5].name = "Trk_On_Button"
side_buttons[6].name = "Solo_Button"
side_buttons[7].name = "Arm_Button"
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button)
self._selector.name = "Main_Modes"
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self.set_highlighting_session_component(self._selector.session_component())
self._suppress_session_highlight = False
示例5: init
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def init(self):
#skip init if already done.
if self._init_done:
return
self._init_done = True
# second part of the __init__ after model has been identified using its challenge response
if self._mk2_rgb:
from SkinMK2 import make_skin
self._skin = make_skin()
self._side_notes = (89, 79, 69, 59, 49, 39, 29, 19)
#self._drum_notes = (20, 30, 31, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)
self._drum_notes = (20, 30, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)
else:
from SkinMK1 import make_skin
self._skin = make_skin()
self._side_notes = (8, 24, 40, 56, 72, 88, 104, 120)
self._drum_notes = (41, 42, 43, 44, 45, 46, 47, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 89, 90, 91, 92, 93, 94, 95, 105, 106, 107)
with self.component_guard():
is_momentary = True
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0, optimized_send_midi=False)
self._config_button.add_value_listener(self._config_value)
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
self._user_byte_write_button.name = 'User_Byte_Button'
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
matrix = ButtonMatrixElement()
matrix.name = 'Button_Matrix'
for row in range(8):
button_row = []
for column in range(8):
if self._mk2_rgb:
# for mk2 buttons are assigned "top to bottom"
midi_note = (81 - (10 * row)) + column
else:
midi_note = row * 16 + column
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, midi_note, skin = self._skin, control_surface = self)
button.name = str(column) + '_Clip_' + str(row) + '_Button'
button_row.append(button)
matrix.add_row(tuple(button_row))
top_buttons = [ConfigurableButtonElement(is_momentary, MIDI_CC_TYPE, 0, 104 + index, skin = self._skin) for index in range(8)]
side_buttons = [ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, self._side_notes[index], skin = self._skin) for index in range(8)]
top_buttons[0].name = 'Bank_Select_Up_Button'
top_buttons[1].name = 'Bank_Select_Down_Button'
top_buttons[2].name = 'Bank_Select_Left_Button'
top_buttons[3].name = 'Bank_Select_Right_Button'
top_buttons[4].name = 'Session_Button'
top_buttons[5].name = 'User1_Button'
top_buttons[6].name = 'User2_Button'
top_buttons[7].name = 'Mixer_Button'
side_buttons[0].name = 'Vol_Button'
side_buttons[1].name = 'Pan_Button'
side_buttons[2].name = 'SndA_Button'
side_buttons[3].name = 'SndB_Button'
side_buttons[4].name = 'Stop_Button'
side_buttons[5].name = 'Trk_On_Button'
side_buttons[6].name = 'Solo_Button'
side_buttons[7].name = 'Arm_Button'
self._osd = M4LInterface()
self._osd.name = "OSD"
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, self._osd, self)
self._selector.name = 'Main_Modes'
self._do_combine()
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self.set_highlighting_session_component(self._selector.session_component())
self._suppress_session_highlight = False
# due to our 2 stage init, we need to rebuild midi map
self.request_rebuild_midi_map()
# and request update
self._selector.update()
if self._mk2_rgb:
self.log_message("LaunchPad95 (mk2) Loaded !")
else:
self.log_message("LaunchPad95 Loaded !")
示例6: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
with self.component_guard(): # this line allows you to instanciate framework classes
is_momentary = True # all our controlls will be momentary
self._suggested_input_port = 'px700'
self._suggested_output_port = 'px700'
"definition of buttons represented by the keyboard notes"
launch_buttons = [] # row of buttons launching the clips of a track
for index in range(16):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, index)
button.name = '_Clip_' + str(index) + '_Button'
launch_buttons.append(button)
"buttons A, B, C, D are the buttons choosing he mode"
mode_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 16+index) for index in range(4) ]
mode_buttons[0].name = 'A_mode'
mode_buttons[1].name = 'B_mode'
mode_buttons[2].name = 'C_mode'
mode_buttons[3].name = 'D_mode'
"pad controls definition"
select_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 20)
select_button.name = '_Select_Button'
translate_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 21)
translate_button.name = '_Translate_Button'
mute_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 22)
mute_button.name = '_Mute_Button'
solo_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 23)
solo_button.name = '_Solo_Button'
copy_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 28)
copy_button.name = '_Copy_Button'
erase_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 29)
erase_button.name = '_Erase_Button'
rewind_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 36)
rewind_button.name = '_Rewind_Button'
forward_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 37)
forward_button.name = '_Forward_Button'
"pads definition"
pads = []
for index in range(8):
pad = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 60+index)
pad.name = '_Clip_' + str(index) + '_Button'
pads.append(pad)
"transport buttons"
transport_buttons = []
for index in range(4):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 24+index)
button.name = '_Transport_Button_'+str(index)
transport_buttons.append(button)
"knobs definition"
tempo_control = EncoderElement(MIDI_CC_TYPE, 0, 48, Live.MidiMap.MapMode.relative_binary_offset)
tempo_control.name = "_Tempo_controller_"
volume_control = EncoderElement(MIDI_CC_TYPE, 0, 47, Live.MidiMap.MapMode.relative_binary_offset)
tempo_control.name = "_Volume_controller_"
param_controls = []
for index in range(3):
control = EncoderElement(MIDI_CC_TYPE, 0, 49+index, Live.MidiMap.MapMode.relative_binary_offset)
control.name = "_Param_"+str(index)+"_control"
param_controls.append(control)
"browser knob definition"
browser_control = EncoderElement(MIDI_CC_TYPE, 0, 54, Live.MidiMap.MapMode.relative_binary_offset)
browser_control.name = "_Browser_controller_"
"browser button definition"
browser_button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 56)
browser_button.name = "_Browser_button_"
"pattern leds definition"
pattern_leds = []
for index in range(4):
led = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 41+index)
led.name = str(index) + 'Pattern_Led'
pattern_leds.append(led)
"divide knob definition"
divide_control = EncoderElement(MIDI_CC_TYPE, 0, 52, Live.MidiMap.MapMode.relative_binary_offset)
divide_control.name = "_divide_controller_"
"move knob definition"
move_control = EncoderElement(MIDI_CC_TYPE, 0, 53, Live.MidiMap.MapMode.relative_binary_offset)
move_control.name = "_move_controller_"
"track leds definition"
track_leds = []
for index in range(8):
led = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 68+index)
led.name = str(index) + 'Track_Led'
track_leds.append(led)
self._selector = MainSelectorComponent(tuple(launch_buttons), tuple(mode_buttons), tuple(pads), tuple(transport_buttons), select_button, translate_button, mute_button, solo_button, tempo_control, volume_control, tuple(param_controls), copy_button, erase_button, rewind_button, forward_button, browser_control, browser_button, tuple(pattern_leds), tuple(track_leds), divide_control, move_control, self)
self._selector.name = 'Main_Modes'
self.set_highlighting_session_component(self._selector._session)
self.log_message("SparkLE Loaded !")
示例7: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
live = Live.Application.get_application()
self._live_major_version = live.get_major_version()
self._live_minor_version = live.get_minor_version()
self._live_bugfix_version = live.get_bugfix_version()
self._mk2 = Settings.DEVICE == 'Launchpad mk2'
if self._mk2:
self._skin = Skin('Launchpad mk2')
self._side_notes = (89, 79, 69, 59, 49, 39, 29, 19)
self._drum_notes = (20, 30, 31, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)
else:
self._skin = Skin('Launchpad')
self._side_notes = (8, 24, 40, 56, 72, 88, 104, 120)
self._drum_notes = (41, 42, 43, 44, 45, 46, 47, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 89, 90, 91, 92, 93, 94, 95, 105, 106, 107)
ControlSurface.__init__(self, c_instance)
with self.component_guard():
self._suppress_send_midi = True
self._suppress_session_highlight = True
is_momentary = True
if self._mk2:
self._suggested_input_port = 'Launchpad'
self._suggested_output_port = 'Launchpad'
else:
self._suggested_input_port = 'Launchpad MK2'
self._suggested_output_port = 'Launchpad MK2'
self._control_is_with_automap = False
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16)
self._user_byte_write_button.name = 'User_Byte_Button'
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
self._wrote_user_byte = False
self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143
matrix = ButtonMatrixElement()
matrix.name = 'Button_Matrix'
for row in range(8):
button_row = []
for column in range(8):
if self._mk2:
# for mk2 buttons are assigned "top to bottom"
midi_note = (81 - (10 * row)) + column
else:
midi_note = row * 16 + column
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, midi_note, self._skin.off)
button.name = str(column) + '_Clip_' + str(row) + '_Button'
button_row.append(button)
matrix.add_row(tuple(button_row))
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0, optimized_send_midi=False)
self._config_button.add_value_listener(self._config_value)
top_buttons = [ConfigurableButtonElement(is_momentary, MIDI_CC_TYPE, 0, 104 + index, self._skin.off) for index in range(8)]
side_buttons = [ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, self._side_notes[index], self._skin.off) for index in range(8)]
top_buttons[0].name = 'Bank_Select_Up_Button'
top_buttons[1].name = 'Bank_Select_Down_Button'
top_buttons[2].name = 'Bank_Select_Left_Button'
top_buttons[3].name = 'Bank_Select_Right_Button'
top_buttons[4].name = 'Session_Button'
top_buttons[5].name = 'User1_Button'
top_buttons[6].name = 'User2_Button'
top_buttons[7].name = 'Mixer_Button'
side_buttons[0].name = 'Vol_Button'
side_buttons[1].name = 'Pan_Button'
side_buttons[2].name = 'SndA_Button'
side_buttons[3].name = 'SndB_Button'
side_buttons[4].name = 'Stop_Button'
side_buttons[5].name = 'Trk_On_Button'
side_buttons[6].name = 'Solo_Button'
side_buttons[7].name = 'Arm_Button'
self._osd = M4LInterface()
self._osd.name = "OSD"
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, self._osd, self, self._skin)
self._selector.name = 'Main_Modes'
self._do_combine()
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self.set_highlighting_session_component(self._selector.session_component())
self._suppress_session_highlight = False
self.log_message("LaunchPad95 Loaded !")
示例8: make_launch_control_button
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def make_launch_control_button(identifier, name, channel = 0, is_pad = False):
button = ConfigurableButtonElement(True, MIDI_NOTE_TYPE if is_pad else MIDI_CC_TYPE, channel, identifier)
button.name = name
button.set_on_off_values(Colors.LED_ON, Colors.LED_OFF)
return button
示例9: _setup_session_control
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def _setup_session_control(self):
is_momentary = True
self._shift_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 98)
right_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 96)
left_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 97)
up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 94)
down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 95)
right_button.name = 'Bank_Select_Right_Button'
left_button.name = 'Bank_Select_Left_Button'
up_button.name = 'Bank_Select_Up_Button'
down_button.name = 'Bank_Select_Down_Button'
self._session = PedaledSessionComponent(8, 5)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(right_button, left_button)
self._session.set_scene_bank_buttons(down_button, up_button)
self._matrix = ButtonMatrixElement() #was: matrix = ButtonMatrixElement()
self._matrix.name = 'Button_Matrix' #was: matrix.name = 'Button_Matrix'
scene_launch_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, (index + 82)) for index in range(5) ]
#self._track_stop_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, index, 52) for index in range(8) ]
self._track_stop_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, index, 52) for index in range(8) ]
for index in range(len(scene_launch_buttons)):
scene_launch_buttons[index].name = 'Scene_'+ str(index) + '_Launch_Button'
for index in range(len(self._track_stop_buttons)):
self._track_stop_buttons[index].name = 'Track_' + str(index) + '_Stop_Button'
stop_all_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 81)
stop_all_button.name = 'Stop_All_Clips_Button'
self._session.set_stop_all_clips_button(stop_all_button)
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.set_stop_track_clip_value(2)
for scene_index in range(5):
scene = self._session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(scene_launch_buttons[scene_index])
scene.set_triggered_value(2)
for track_index in range(8):
#button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, track_index, (scene_index + 53))
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, track_index, (scene_index + 53)) #use Launchpad configurable button instead
button.name = str(track_index) + '_Clip_' + str(scene_index) + '_Button'
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_triggered_to_play_value(2)
clip_slot.set_triggered_to_record_value(4)
clip_slot.set_stopped_value(3)
clip_slot.set_started_value(1)
clip_slot.set_recording_value(5)
clip_slot.set_launch_button(button)
self._matrix.add_row(tuple(button_row)) #matrix.add_row(tuple(button_row))
# Removing the launch selected clip footpedal option
#self._session.set_slot_launch_button(ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 67))
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 64))
self._session_zoom = SessionZoomingComponent(self._session) #use APC20 Zooming instead
self._session_zoom.name = 'Session_Overview'
self._session_zoom.set_button_matrix(self._matrix) #was: self._session_zoom.set_button_matrix(matrix)
self._session_zoom.set_zoom_button(self._shift_button) #set in MatrixModesComponent instead
self._session_zoom.set_nav_buttons(up_button, down_button, left_button, right_button)
self._session_zoom.set_scene_bank_buttons(tuple(scene_launch_buttons))
self._session_zoom.set_stopped_value(3)
self._session_zoom.set_selected_value(5)
return None
示例10: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
ControlSurface.__init__(self, c_instance)
with self.component_guard(): # this line allows you to instanciate framework classes
is_momentary = True # all our controlls will be momentary
self._suggested_input_port = "px700"
self._suggested_output_port = "px700"
"definition of buttons represented by the keyboard notes"
select_buttons = [] # row of buttons launching the clips of a track
for index in range(10):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 20 + index)
button.name = "_Clip_" + str(index) + "_Button"
select_buttons.append(button)
"buttons sound and multi are the buttons choosing he mode"
mode_buttons = [
ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 118 + index) for index in range(2)
]
mode_buttons[0].name = "Sound_Mode"
mode_buttons[1].name = "Multi_Mode"
"knobs definition"
bank1_controls = []
for index in range(10):
control = EncoderElement(MIDI_CC_TYPE, 0, 74 + index, Live.MidiMap.MapMode.relative_binary_offset)
control.name = "_Param_" + str(index) + "_control"
bank1_controls.append(control)
bank2_controls = []
for index in range(10):
control = EncoderElement(MIDI_CC_TYPE, 0, 74 + index, Live.MidiMap.MapMode.relative_binary_offset)
control.name = "_Param_" + str(index) + "_control"
bank2_controls.append(control)
bank1_faders = []
for index in range(4):
control = EncoderElement(MIDI_CC_TYPE, 0, 73 + index, Live.MidiMap.MapMode.absolute)
control.name = "_Param_" + str(index) + "_control"
bank1_faders.append(control)
for index in range(5):
control = EncoderElement(MIDI_CC_TYPE, 0, 80 + index, Live.MidiMap.MapMode.absolute)
control.name = "_Param_" + str(index) + "_control"
bank1_faders.append(control)
bank2_faders = []
for index in range(4):
control = EncoderElement(MIDI_CC_TYPE, 0, 67 + index, Live.MidiMap.MapMode.absolute)
control.name = "_Param_" + str(index) + "_control"
bank2_faders.append(control)
for index in range(5):
control = EncoderElement(MIDI_CC_TYPE, 0, 87 + index, Live.MidiMap.MapMode.absolute)
control.name = "_Param_" + str(index) + "_control"
bank2_faders.append(control)
self._selector = MainSelectorComponent(
tuple(select_buttons),
tuple(mode_buttons),
tuple(bank1_controls),
tuple(bank2_controls),
tuple(bank1_faders),
tuple(bank2_faders),
self,
)
self._selector.name = "Main_Modes"
# self.set_highlighting_session_component(self._selector._session)
self.log_message("SparkLE Loaded !")
示例11: __init__
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def __init__(self, c_instance):
live = Live.Application.get_application()
self._live_major_version = live.get_major_version()
self._live_minor_version = live.get_minor_version()
self._live_bugfix_version = live.get_bugfix_version()
ControlSurface.__init__(self, c_instance)
#self._device_selection_follows_track_selection = True
with self.component_guard():
self._suppress_send_midi = True
self._suppress_session_highlight = True
is_momentary = True
self._suggested_input_port = 'Launchpad'
self._suggested_output_port = 'Launchpad'
self._control_is_with_automap = False
self._user_byte_write_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 16) # Apparently this CC is used to enable feedback, ie lighting up buttons that you pressed
self._user_byte_write_button.name = 'User_Byte_Button'
self._user_byte_write_button.send_value(1)
self._user_byte_write_button.add_value_listener(self._user_byte_value)
self._wrote_user_byte = False
self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143
matrix = ButtonMatrixElement()
matrix.name = 'Button_Matrix'
for row in range(8):
button_row = []
for column in range(8):
button = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, (7-row) * 8 + column) # APCmini rows are in reverse order from Launchpad
button.name = str(column) + '_Clip_' + str(row) + '_Button'
button_row.append(button)
matrix.add_row(tuple(button_row))
self._config_button = ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 0, optimized_send_midi=False) # Control goes through here on LP, no real equivalent in APCmini (I don't think)
self._config_button.add_value_listener(self._config_value)
top_buttons = [ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 64 + index) for index in range(8)]
side_buttons = [ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, SIDE_NOTES[index]) for index in range(8)]
top_buttons[0].name = 'Bank_Select_Up_Button'
top_buttons[1].name = 'Bank_Select_Down_Button'
top_buttons[2].name = 'Bank_Select_Left_Button'
top_buttons[3].name = 'Bank_Select_Right_Button'
top_buttons[4].name = 'Session_Button'
top_buttons[5].name = 'User1_Button'
top_buttons[6].name = 'User2_Button'
top_buttons[7].name = 'Mixer_Button'
side_buttons[0].name = 'Vol_Button'
side_buttons[1].name = 'Pan_Button'
side_buttons[2].name = 'SndA_Button'
side_buttons[3].name = 'SndB_Button'
side_buttons[4].name = 'Stop_Button'
side_buttons[5].name = 'Trk_On_Button'
side_buttons[6].name = 'Solo_Button'
side_buttons[7].name = 'Arm_Button'
self._osd = M4LInterface()
self._osd.name = "OSD"
self._selector = MainSelectorComponent(matrix, tuple(top_buttons), tuple(side_buttons), self._config_button, self._osd, self)
self._selector.name = 'Main_Modes'
self._do_combine()
for control in self.controls:
if isinstance(control, ConfigurableButtonElement):
control.add_value_listener(self._button_value)
self.set_highlighting_session_component(self._selector.session_component())
self._suppress_session_highlight = False
self.log_message("LaunchPad95 Loaded !")
示例12: _setup_session_control
# 需要导入模块: from ConfigurableButtonElement import ConfigurableButtonElement [as 别名]
# 或者: from ConfigurableButtonElement.ConfigurableButtonElement import name [as 别名]
def _setup_session_control(self):
is_momentary = True
self._shift_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 98)
self._right_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 96)
self._left_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 97)
self._up_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 94)
self._down_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 95)
self._right_button.name = 'Bank_Select_Right_button'
self._left_button.name = 'Bank_Select_Left_button'
self._up_button.name = 'Bank_Select_Up_button'
self._down_button.name = 'Bank_Select_Down_button'
self._session = PedaledSessionComponent(8, 5)
self._session.name = 'Session_Control'
self._session.set_track_bank_buttons(self._right_button, self._left_button)
self._session.set_scene_bank_buttons(self._down_button, self._up_button)
self._matrix = ButtonMatrixElement()
self._matrix.name = 'Button_Matrix'
self._scene_launch_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, index + 82) for index in range(5) ]
self._track_stop_buttons = [ ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, index, 52) for index in range(8) ]
for index in range(len(self._scene_launch_buttons)):
self._scene_launch_buttons[index].name = 'Scene_' + str(index) + '_Launch_Button'
for index in range(len(self._track_stop_buttons)):
self._track_stop_buttons[index].name = 'Track_' + str(index) + '_Stop_Button'
self._stop_all_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 81)
self._stop_all_button.name = 'Stop_All_Clips_Button'
self._session.set_stop_all_clips_button(self._stop_all_button)
self._session.set_stop_track_clip_buttons(tuple(self._track_stop_buttons))
self._session.set_stop_clip_value(0)
self._session.set_stop_clip_triggered_value(2)
self._button_rows = []
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 = ConfigurableButtonElement(is_momentary, MIDI_NOTE_TYPE, track_index, (scene_index + 53))
button.name = str(track_index) + '_Clip_' + str(scene_index) + '_Button'
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_triggered_to_play_value(2)
clip_slot.set_triggered_to_record_value(4)
clip_slot.set_stopped_value(5)
clip_slot.set_started_value(1)
clip_slot.set_recording_value(3)
clip_slot.set_launch_button(button)
self._matrix.add_row(tuple(button_row))
self._button_rows.append(button_row)
self._session.set_slot_launch_button(ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 67))
self._session.selected_scene().name = 'Selected_Scene'
self._session.selected_scene().set_launch_button(ButtonElement(is_momentary, MIDI_CC_TYPE, 0, 64))
self._session_zoom = ShiftableZoomingComponent(self._session, tuple(self._track_stop_buttons))
self._session_zoom.name = 'Session_Overview'
self._session_zoom.set_button_matrix(self._matrix)
self._session_zoom.set_zoom_button(self._shift_button)
self._session_zoom.set_nav_buttons(self._up_button, self._down_button, self._left_button, self._right_button)
self._session_zoom.set_scene_bank_buttons(tuple(self._scene_launch_buttons))
self._session_zoom.set_stopped_value(3)
self._session_zoom.set_selected_value(5)