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.removeSelectedText()
cursor.deleteChar() cursor.deleteChar()
_NOTE_NAMES = ["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]
def _midi_msg_str(msg): def _midi_msg_str(msg):
if len(msg) >= 3: if len(msg) >= 3:
status = msg[0] & 0xF0 status = msg[0] & 0xF0
ch = (msg[0] & 0x0F) + 1 ch = (msg[0] & 0x0F) + 1
if status == 0xB0: if status == 0xB0:
return f"CC{msg[1]} CH{ch} [{msg[2]}]" 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) return " ".join(f"{b:02X}" for b in msg)
def log_midi_incoming(msg): def log_midi_incoming(msg):
@@ -2212,10 +2220,12 @@ def route_midi_message_input(event, data=None):
elif bound_fader: elif bound_fader:
print(f"[hw] CC{cc_num} val={cc_val} → uid={bound_fader.uid} out_cc={bound_fader.cc_spin.value()}") 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) midi_receiver.hw_cc_signal.emit(bound_fader.uid, cc_val)
else: elif status in (0x80, 0x90):
print(f"[passthrough] CC{cc_num} val={cc_val}")
if midi_out.is_port_open(): 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)) midi_receiver.midi_in_signal.emit(list(message))
+2 -2
View File
@@ -483,8 +483,8 @@
], ],
"transport_show_hide": false, "transport_show_hide": false,
"io_config": { "io_config": {
"midi_out": "IAC Driver Bus 1", "midi_out": "IAC Driver Bus 5",
"midi_in": "Not Connected", "midi_in": "VMPK Output",
"transport_out": "Not Connected", "transport_out": "Not Connected",
"osc_ip": "127.0.0.1", "osc_ip": "127.0.0.1",
"osc_listen_port": 9000, "osc_listen_port": 9000,