Skip to content

feat(core): route the highway chart to the selected instrument's part (working-tuning PR 2)#659

Merged
byrongamatos merged 1 commit into
mainfrom
feat/instrument-chart-routing
Jul 1, 2026
Merged

feat(core): route the highway chart to the selected instrument's part (working-tuning PR 2)#659
byrongamatos merged 1 commit into
mainfrom
feat/instrument-chart-routing

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

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 explicit arrangement requested), now reads your selected instrument from config.json — the same file it already reads for your default-arrangement preference — and picks the matching part:

  • bass → the Bass arrangement
  • guitar — and any unknown/future instrument (drums, keys) — falls through to the existing preference/most-notes default, which already lands on a guitar part. (Drums/keys get their own match when those arrangement types + selector entries land; they route but opt out of the tune-gate, since drums have no tuning and piano is fixed.)

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 workingTuning state) is the companion; the tuner becomes the writer and the gate's both-directions fix lands next.

🤖 Generated with Claude Code

… (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
byrongamatos force-pushed the feat/instrument-chart-routing branch from a490364 to c717b37 Compare July 1, 2026 06:58
@byrongamatos
byrongamatos merged commit c4bb582 into main Jul 1, 2026
1 of 3 checks passed
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