本文整理汇总了Python中ParamMap.ParamMap.receive_midi_cc方法的典型用法代码示例。如果您正苦于以下问题:Python ParamMap.receive_midi_cc方法的具体用法?Python ParamMap.receive_midi_cc怎么用?Python ParamMap.receive_midi_cc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamMap.ParamMap
的用法示例。
在下文中一共展示了ParamMap.receive_midi_cc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ParamMap import ParamMap [as 别名]
# 或者: from ParamMap.ParamMap import receive_midi_cc [as 别名]
#.........这里部分代码省略.........
def is_live_5(self):
return hasattr(Live, 'is_live_5')
def log(self, string):
pass
def logfmt(self, fmt, *args):
pass
def disconnect(self):
for c in self.components:
c.disconnect()
def application(self):
return Live.Application.get_application()
def song(self):
return self.c_instance.song()
def suggest_input_port(self):
return str('')
def suggest_output_port(self):
return str('')
def can_lock_to_devices(self):
return True
def lock_to_device(self, device):
if self.device_controller:
self.device_controller.lock_to_device(device)
def unlock_to_device(self, device):
if self.device_controller:
self.device_controller.unlock_from_device(device)
def set_appointed_device(self, device):
if self.device_controller:
self.device_controller.set_appointed_device(device)
def toggle_lock(self):
self.c_instance.toggle_lock()
def suggest_map_mode(self, cc_no, channel):
return Live.MidiMap.MapMode.absolute
def restore_bank(self, bank):
pass
def show_message(self, message):
if hasattr(self.c_instance, 'show_message'):
self.c_instance.show_message(message)
def instance_identifier(self):
return self.c_instance.instance_identifier()
def connect_script_instances(self, instanciated_scripts):
pass
def request_rebuild_midi_map(self):
self.c_instance.request_rebuild_midi_map()
def send_midi(self, midi_event_bytes):
self.c_instance.send_midi(midi_event_bytes)
def refresh_state(self):
for c in self.components:
c.refresh_state()
def build_midi_map(self, midi_map_handle):
self.log('script build midi map')
script_handle = self.c_instance.handle()
self.param_map.remove_mappings()
for c in self.components:
self.log('build midi map on %s' % c)
c.build_midi_map(script_handle, midi_map_handle)
def update_display(self):
for c in self.components:
c.update_display()
def receive_midi(self, midi_bytes):
channel = midi_bytes[0] & CHAN_MASK
status = midi_bytes[0] & STATUS_MASK
if status == CC_STATUS:
cc_no = midi_bytes[1]
cc_value = midi_bytes[2]
for c in self.components:
c.receive_midi_cc(channel, cc_no, cc_value)
self.param_map.receive_midi_cc(channel, cc_no, cc_value)
elif status == NOTEON_STATUS or status == NOTEOFF_STATUS:
note_no = midi_bytes[1]
note_vel = midi_bytes[2]
for c in self.components:
c.receive_midi_note(channel, status, note_no, note_vel)
self.param_map.receive_midi_note(channel, status, note_no, note_vel)
else:
raise False or AssertionError, 'Unknown MIDI message %s' % str(midi_bytes)
示例2: __init__
# 需要导入模块: from ParamMap import ParamMap [as 别名]
# 或者: from ParamMap.ParamMap import receive_midi_cc [as 别名]
#.........这里部分代码省略.........
def is_live_5(self):
return hasattr(Live, "is_live_5")
def log(self, string):
pass
def logfmt(self, fmt, *args):
pass
def disconnect(self):
for c in self.components:
c.disconnect()
def application(self):
return Live.Application.get_application()
def song(self):
return self.c_instance.song()
def suggest_input_port(self):
return str("")
def suggest_output_port(self):
return str("")
def can_lock_to_devices(self):
return True
def lock_to_device(self, device):
if self.device_controller:
self.device_controller.lock_to_device(device)
def unlock_to_device(self, device):
if self.device_controller:
self.device_controller.unlock_from_device(device)
def set_appointed_device(self, device):
if self.device_controller:
self.device_controller.set_appointed_device(device)
def toggle_lock(self):
self.c_instance.toggle_lock()
def suggest_map_mode(self, cc_no, channel):
return Live.MidiMap.MapMode.absolute
def restore_bank(self, bank):
pass
def show_message(self, message):
if hasattr(self.c_instance, "show_message"):
self.c_instance.show_message(message)
def instance_identifier(self):
return self.c_instance.instance_identifier()
def connect_script_instances(self, instanciated_scripts):
pass
def request_rebuild_midi_map(self):
self.c_instance.request_rebuild_midi_map()
def send_midi(self, midi_event_bytes):
self.c_instance.send_midi(midi_event_bytes)
def refresh_state(self):
for c in self.components:
c.refresh_state()
def build_midi_map(self, midi_map_handle):
self.log("script build midi map")
script_handle = self.c_instance.handle()
self.param_map.remove_mappings()
for c in self.components:
self.log(("build midi map on %s" % c))
c.build_midi_map(script_handle, midi_map_handle)
def update_display(self):
for c in self.components:
c.update_display()
def receive_midi(self, midi_bytes):
channel = midi_bytes[0] & CHAN_MASK
status = midi_bytes[0] & STATUS_MASK
if status == CC_STATUS:
cc_no = midi_bytes[1]
cc_value = midi_bytes[2]
for c in self.components:
c.receive_midi_cc(channel, cc_no, cc_value)
self.param_map.receive_midi_cc(channel, cc_no, cc_value)
elif (status == NOTEON_STATUS) or (status == NOTEOFF_STATUS):
note_no = midi_bytes[1]
note_vel = midi_bytes[2]
for c in self.components:
c.receive_midi_note(channel, status, note_no, note_vel)
self.param_map.receive_midi_note(channel, status, note_no, note_vel)
else:
assert False, "Unknown MIDI message %s" % str(midi_bytes)