Skip to content

Make the local device-tree ports configurable at launch#2116

Open
bltzr wants to merge 1 commit into
ossia:masterfrom
bltzr:feature/local-tree-port-options
Open

Make the local device-tree ports configurable at launch#2116
bltzr wants to merge 1 commit into
ossia:masterfrom
bltzr:feature/local-tree-port-options

Conversation

@bltzr

@bltzr bltzr commented Jul 13, 2026

Copy link
Copy Markdown
Member

What

score's LocalTree control device is exposed on hardcoded OSC port 6666 and WebSocket port 9999 (LocalTreeDocumentPlugin::defaultSettings and LocalProtocolFactory::static_defaultSettings). A second score instance therefore can't expose its tree — the bind throws, is caught, and logs could not expose score on port 6666 — and there is no way to relocate it.

Change

Two load-time options, stored in ApplicationSettings:

  • --local-osc-port <port> (also $SCORE_LOCAL_OSC_PORT)
  • --local-ws-port <port> (also $SCORE_LOCAL_WS_PORT)

Precedence: CLI flag → environment variable → default. Both the per-document local device and the Local protocol factory default read the setting. Defaults stay 6666 / 9999, so behaviour is unchanged unless a port is given.

Usage

score --local-osc-port 6667 --local-ws-port 10000 my.score
# or
SCORE_LOCAL_OSC_PORT=6667 score my.score

Lets multiple instances run side by side (e.g. for testing).

🤖 Generated with Claude Code

score's LocalTree control device is exposed on hardcoded OSC port 6666 and
WebSocket port 9999, so a second score instance cannot expose its tree (the
bind throws, is caught and logged) and there is no way to relocate it.

Add --local-osc-port / --local-ws-port command-line options (also honoring the
SCORE_LOCAL_OSC_PORT / SCORE_LOCAL_WS_PORT environment variables), stored in
ApplicationSettings and read by both the per-document local device and the
Local protocol factory default. Defaults remain 6666 / 9999, so behaviour is
unchanged unless a port is specified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AvD2PFHZtW6pfsh3gGhayg
@jcelerier

Copy link
Copy Markdown
Member

I think the best way for this would instead to have it be configurable in the Local:: device settings ?

@bltzr

bltzr commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Runtime-verified on macOS (arm64). Launched two instances side by side with distinct ports:

score --no-restore --local-osc-port 6667 --local-ws-port 10001
score --no-restore --local-osc-port 6668 --local-ws-port 10002

lsof confirmed each process bound exactly the ports passed — instance A on UDP 6667 / TCP 10001, instance B on UDP 6668 / TCP 10002 — and both exposed their local trees with no could not expose score on port … warning (the conflict that previously made the second instance on the shared 6666 fail). With no flag or env var, defaults stay 6666 / 9999.

"file", "");
parser.addOption(uiOptDebug);

QCommandLineOption localOscPortOpt(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of being added here this should use the infrastructure to add CLI options in the relevant plug-in, c.f. score-plugin-js or score-plugin-jit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants