Repository navigation
fix(osc): accept parameters that appear after startup - #285
Merged
Merged
Conversation
The OSC server's parameter table was filled once, at startup. An app's parameters change while it runs (an FX is added, a scene loads), and the renderer refreshed EngineState's address list for them but nothing told the server, so such a parameter was listed as addressable while every message to it was dropped. A port change had the same effect, because it rebuilt the server with only the built-in parameters. update_osc now registers any current parameter the server does not know. Co-Authored-By: Claude Opus 5.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 free
to 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
The OSC server's parameter table was filled once, at startup. When an app's parameter list changes at runtime, the renderer refreshes
EngineState::param_osc_addresses, so the new parameters are listed as addressable, but nothing registers them with the server.OscState::update_parameteronly accepts registered addresses, so every message to such a parameter was dropped without a trace.In KOVVBOJ this covers every channel and FX parameter, because they are created when the stage loads, after startup. Only parameters that exist at startup (crossfader, master dim, take seconds) responded to OSC.
A port change had the same effect:
OscCommand::SetPortrebuilds the server and registers only the built-in parameters.Fix
OscState::sync_parametersregisters any current parameter the server does not know yet, andupdate_osccalls it each frame before reading values. It is one hash lookup per parameter, the same order of work as the existing per-frame read loop, and it leaves parameters that are already registered untouched.Parameters that have been removed stay registered. Nothing polls them, so they are inert.
Checked
osc::tests::parameter_added_after_startup_accepts_messages: a message to a parameter added after startup is dropped before the sync and applied after it, and a second sync does not reset a known parameter.cargo clippy -p rustjay-control -p rustjay-engine --all-targetsis clean on macOS.KOVVBOJ picks this up when its engine
revis bumped.🤖 Generated with Claude Code