feat(core): route the highway chart to the selected instrument's part (working-tuning PR 2)#659
Merged
Merged
Conversation
… (working-tuning PR 2) When a song loads without an explicit arrangement, highway_ws now reads the player's selected `instrument` from config.json (the same file it already reads for the default-arrangement preference) and picks the arrangement that matches: bass -> the Bass part. Guitar — and any unknown/future instrument (drums, keys) — falls through to the existing preference/most-notes default, which already lands on a guitar part. Previously the instrument selector only fed the tuner, so a bass player was handed the default Lead/guitar chart, and the working-tuning coverage check then compared a 4-string bass against a 6-string part (always "can't cover"). This is the instrument->chart routing the working-tuning series leans on. Server-only (every launch path flows through the WS, so no client change). An explicit arrangement request always wins, so only the default part chosen on load changes. Tests: tests/test_highway_ws_instrument_routing.py (bass->Bass, guitar->default, explicit-wins) — 3 new, existing highway WS tests still green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QbexxfTt8q2tAn436MqGWF
byrongamatos
force-pushed
the
feat/instrument-chart-routing
branch
from
July 1, 2026 06:58
a490364 to
c717b37
Compare
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.
What & why
PR 2 of the working-tuning series. Today the selected instrument and the loaded chart are decoupled: opening a song loads its default part — "Lead" (guitar) — regardless of whether you've got guitar or bass selected. The instrument selector only feeds the tuner. So a bass player is handed a guitar chart (and the working-tuning coverage check then compares a 4-string bass against a 6-string part — always "can't cover").
This routes the chart to match your selected instrument.
How
highway_ws(server.py), in the branch where it resolves the default arrangement (no explicitarrangementrequested), now reads your selectedinstrumentfromconfig.json— the same file it already reads for your default-arrangement preference — and picks the matching part:Server-only — every way a song gets launched already flows through this WebSocket, so there's no client change. An explicit arrangement request always wins (a manual arrangement switch is untouched), so only the default part chosen on load changes.
Tests
tests/test_highway_ws_instrument_routing.py— bass→Bass, guitar→default, explicit-arrangement-wins. 12 passed (3 new + the existing highway-WS suite, no regression).Series
Foundation #658 (host
workingTuningstate) is the companion; the tuner becomes the writer and the gate's both-directions fix lands next.🤖 Generated with Claude Code