Uh oh!
There was an error while loading. Please reload this page.
Broadcast MIDI unlearn to all clients - #9
Open
sastraxi wants to merge 2 commits into
Open
Conversation
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MOD-UI does not tell the clients when a user removes a MIDI addressing. Only the browser that made the change shows the correct state. pi-Stomp keeps the binding on its LCD until the user selects a different pedalboard and comes back.
MOD-UI sends a message when a user adds a MIDI addressing. When mod-host reports
midi_mapped,Hostcallsmsg_callback("midi_map ...").Cause
Host.address()removes an addressing in two places. Neither place sent a message to the clients.actuator_uri == "null". The user removed a complete addressing with the dialog. The code setsbypassCCandmidiCCsto the empty values, but sends no message. Users get this path.actuator_uri == kMidiUnlearnURI. The learn is not complete, because the user did not move a control.html/js/hardware.jssends this URI only whencurrentAddressing.uri == kMidiLearnURI. The code sendsmidi_unmapto mod-host and returns. It keeps the addressing and the old CC values. MOD-UI then sends these incorrect values to the next client that connects.Change
Send
midi_map {instance} {symbol} -1 -1 0.0 1.0from the two places. In the second place, also remove the addressing and setbypassCCandmidiCCsto the empty values.mod-host uses
-1 -1for a control with no MIDI mapping. The clients need no new message type.Test
On pi-Stomp hardware:
:bypassport of a plugin.