From 950f8f659e5ec85305ce2764dac51b06f031e76e Mon Sep 17 00:00:00 2001 From: Cam Gorrie Date: Sat, 22 Aug 2026 17:29:01 -0400 Subject: [PATCH 1/2] Broadcast and clear state on MIDI unlearn The kMidiUnlearnURI branch returned straight after sending midi_unmap to mod-host: it never popped the addressing, never reset bypassCC/midiCCs, and never broadcast. Only the browser that performed the unlearn knew the mapping was gone; every other client (pi-stomp's LCD, a second browser) kept showing it, and the stale pluginData was replayed to the next client to connect. Learn already broadcasts via the midi_mapped feedback path; unlearn now matches it with a -1:-1 midi_map. Co-Authored-By: Claude Opus 5 --- mod/host.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mod/host.py b/mod/host.py index 6f92bbb5b..3a83e32de 100644 --- a/mod/host.py +++ b/mod/host.py @@ -4913,6 +4913,20 @@ def address(self, instance, portsymbol, actuator_uri, label, minimum, maximum, v # MIDI learn is not saved until a MIDI controller is moved. # So we need special casing for unlearn. if actuator_uri == kMidiUnlearnURI: + old_addressing = pluginData['addressings'].pop(portsymbol, None) + if old_addressing is not None: + self.addressings.remove(old_addressing) + self.pedalboard_modified = True + + if portsymbol == ":bypass": + pluginData['bypassCC'] = (-1, -1) + else: + pluginData['midiCCs'][portsymbol] = (-1, -1, 0.0, 1.0) + + # Clients other than the one that unlearned have no other signal that + # the mapping is gone; -1:-1 is the same form mod-host reports. + self.msg_callback("midi_map %s %s -1 -1 0.0 1.0" % (instance, portsymbol)) + self.send_modified("midi_unmap %d %s" % (instance_id, portsymbol), callback, datatype='boolean') return From c4ea0063ac0f3972e9a45c370346baf97eae8d80 Mon Sep 17 00:00:00 2001 From: Cam Gorrie Date: Sat, 22 Aug 2026 17:41:27 -0400 Subject: [PATCH 2/2] Broadcast midi_map -1:-1 when a MIDI addressing is removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting a MIDI-addressed control back to "None" reaches address() as actuator_uri="null", not kMidiUnlearnURI — the latter only fires while a learn is still pending and uncommitted. That path cleared bypassCC / midiCCs but never broadcast, so only the browser that made the change knew the mapping was gone. pi-stomp kept the binding on its LCD until the board was switched away and back. Co-Authored-By: Claude Opus 5 --- mod/host.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/host.py b/mod/host.py index 3a83e32de..b1c9d0d50 100644 --- a/mod/host.py +++ b/mod/host.py @@ -4948,6 +4948,11 @@ def address(self, instance, portsymbol, actuator_uri, label, minimum, maximum, v else: pluginData['midiCCs'][portsymbol] = (-1, -1, 0.0, 1.0) + # Clients other than the one that removed the addressing have no + # other signal that the mapping is gone; -1:-1 is the same form + # mod-host reports. + self.msg_callback("midi_map %s %s -1 -1 0.0 1.0" % (instance, portsymbol)) + else: # Changing ranges without changing MIDI CC if -1 in (channel, controller):