global note pass through but cc filtering unless assigned
This commit is contained in:
@@ -1442,12 +1442,20 @@ def _append_log(textedit, line):
|
||||
cursor.removeSelectedText()
|
||||
cursor.deleteChar()
|
||||
|
||||
_NOTE_NAMES = ["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]
|
||||
|
||||
def _midi_msg_str(msg):
|
||||
if len(msg) >= 3:
|
||||
status = msg[0] & 0xF0
|
||||
ch = (msg[0] & 0x0F) + 1
|
||||
if status == 0xB0:
|
||||
return f"CC{msg[1]} CH{ch} [{msg[2]}]"
|
||||
if status in (0x80, 0x90):
|
||||
note = msg[1]
|
||||
vel = msg[2]
|
||||
name = _NOTE_NAMES[note % 12] + str((note // 12) - 1)
|
||||
kind = "Note On" if status == 0x90 else "Note Off"
|
||||
return f"{kind} {name} ({note}) vel {vel} CH{ch}"
|
||||
return " ".join(f"{b:02X}" for b in msg)
|
||||
|
||||
def log_midi_incoming(msg):
|
||||
@@ -2212,10 +2220,12 @@ def route_midi_message_input(event, data=None):
|
||||
elif bound_fader:
|
||||
print(f"[hw] CC{cc_num} val={cc_val} → uid={bound_fader.uid} out_cc={bound_fader.cc_spin.value()}")
|
||||
midi_receiver.hw_cc_signal.emit(bound_fader.uid, cc_val)
|
||||
else:
|
||||
print(f"[passthrough] CC{cc_num} val={cc_val}")
|
||||
elif status in (0x80, 0x90):
|
||||
if midi_out.is_port_open():
|
||||
midi_out.send_message(message)
|
||||
midi_out.send_message(list(message))
|
||||
midi_receiver.midi_out_signal.emit(list(message))
|
||||
else:
|
||||
print(f"[unbound] CC{cc_num} val={cc_val}")
|
||||
|
||||
midi_receiver.midi_in_signal.emit(list(message))
|
||||
|
||||
|
||||
@@ -483,8 +483,8 @@
|
||||
],
|
||||
"transport_show_hide": false,
|
||||
"io_config": {
|
||||
"midi_out": "IAC Driver Bus 1",
|
||||
"midi_in": "Not Connected",
|
||||
"midi_out": "IAC Driver Bus 5",
|
||||
"midi_in": "VMPK Output",
|
||||
"transport_out": "Not Connected",
|
||||
"osc_ip": "127.0.0.1",
|
||||
"osc_listen_port": 9000,
|
||||
|
||||
Reference in New Issue
Block a user