global note pass through but cc filtering unless assigned

This commit is contained in:
Paul Lipscomb
2026-06-29 05:40:02 -04:00
parent 3861a8f508
commit 23bfc88f13
2 changed files with 15 additions and 5 deletions
+13 -3
View File
@@ -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))