【发布时间】:2020-02-12 06:40:55
【问题描述】:
我创建了 2 个端口作为输入,用于从键盘和 midi 表面控制器(具有一堆滑块和旋钮)捕获数据。虽然我不确定如何从两者中获取数据
for msg1 in input_hw:
if not msg1.type == "clock":
print(msg1)
# Play the note if the note has been triggered
if msg1.type == 'note_on' or msg1.type == 'note_off' and msg1.velocity > 0:
out.send(msg1)
for msg in input_hw2:
#avoid to print the clock message
if not msg.type == "clock":
print(msg)
第一个 For 循环有效,我在弹奏键盘时打开和关闭了 midi 音符,它与input_hw 端口绑定,但第二个循环从未通过。
【问题讨论】: