Skip to content

Decode OSC arrays: ColorPalette arrived with no arguments - #141

Merged
Skeyelab merged 1 commit into
mainfrom
osc-array
Nov 16, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
osc-array

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Live bug: with the real Syndicate and feedback live, Diagnostics showed OSC <- /Syndicate/ColorPalette with no arguments. So deck colors never followed Syndicate (#123), and pad cue colors never took Syndicate's palette.

Part of #12. Fixes ColorPalette following for #122 and #123 on real hardware.

Cause

The guide documents ColorPalette as "[i slot, i R, i G, i B]", and on the wire that's an OSC 1.1 array: type tags ,[iiii]. Our decoder (#13) treats an unknown tag as "can't size it, stop", so [ ended the arguments before the first int.

Fix

  • OSCReader: [ and ] carry no data, so the arguments inside are read in order and flattened. Cues sent as [is] pairs flatten to the same int, string list the cue parser already reads.
  • ColorPalette with several slots in one message ([iiii][iiii]…, 32 ints flattened): both the pads' cue palette (Bridge.colorPalette) and the deck colors (the Coordinator) now read every group of four. Before, only the first group was read. This also works if Syndicate sends one message per slot.

Tests (OSC bytes seam, then the Coordinator)

  • Hand-built bytes for /Syndicate/ColorPalette ,[iiii] 1, 255, 0, 0 decode to four ints.
  • ,[is][is] 3, "Drop", 0, "" flattens in order.
  • The same wire bytes, fed to the Coordinator: deck 1's ring is 48 (red), and the status deck color is [255, 0, 0].
  • All eight slots in one message: slot 3 red moves deck 2's ring (48), and slot 7 sets deck 4. For the pads, slot 3 blue lights pad 3 (3).
  • 78 Presentation + 339 Core tests pass. The Release build succeeds.

Manual check, for the user: after a rebuild, Diagnostics › OSC Log shows ColorPalette with its numbers. The deck badges and the ring take Syndicate's deck colors, and the hot-cue pads take its cue colors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1

…codes; several palette slots in one message all apply

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
@Skeyelab Skeyelab added this to the v1.0: native Mac app milestone Nov 16, 2026
@Skeyelab
Skeyelab enabled auto-merge November 16, 2026 04:34
@Skeyelab
Skeyelab merged commit babc465 into main Nov 16, 2026
3 checks passed
@Skeyelab

Copy link
Copy Markdown
Member Author

Post-merge review (agent2): TDD checklist plus the new testing notes

Clean. No follow-ups.

  • Tests drive behavior through the public seams: the OSC codec, then Coordinator.feedback, then the LEDs and the status.
  • Mutation check: I limited both stride loops (Coordinator and Bridge+Pads) to the first group only.
    • paletteAllSlotsInOneMessage and colorPaletteAllSlotsInOneMessage both went red, so they cover the loops.
    • paletteFromWireArray is a single slot and still passed, as it should: it pins the decoder, not the loop.
  • Vacuous #expect: none of the (x?.y ?? []).contains shape (see the Kit README's testing notes, Kit README: testing notes and LED port rules #154).
  • Edge cases: a partial trailing group is ignored safely in both loops. Coordinator uses to: count-3 and Pads uses through: count-4; both are correct.

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.

1 participant