Add multi-track playback with mute/solo support

Replaces the single-root-pattern sequencer with a Track[] array that
allows multiple patterns to loop independently. Adds ADD_TRACK (0x0A),
REMOVE_TRACK (0x0B), PLAY_TRACKS (0x0C), and SET_TRACK_MUTE (0x0D)
protocol records. The C backend gains per-track pending_subs and a
tracks_mutex. The Node server gains track-state APIs (/api/tracks/:id/
active, mute, solo) and the frontend shows per-pattern track/mute/solo
buttons in the sidebar list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 04:16:06 +00:00
parent a452477825
commit 9b45905d80
11 changed files with 599 additions and 141 deletions

View File

@@ -119,6 +119,38 @@ records:
type: uint16
note: Note-off will be sent after this many milliseconds
ADD_TRACK:
id: 0x0A
direction: node_to_c
description: Add a pattern as an independently-looping track
fields:
- name: pattern_id
type: uint16
REMOVE_TRACK:
id: 0x0B
direction: node_to_c
description: Remove a track and stop its playback
fields:
- name: pattern_id
type: uint16
PLAY_TRACKS:
id: 0x0C
direction: node_to_c
description: Start the multi-track engine with all added tracks
fields: []
SET_TRACK_MUTE:
id: 0x0D
direction: node_to_c
description: Mute or unmute a track without resetting its position
fields:
- name: pattern_id
type: uint16
- name: muted
type: uint8
ACK:
id: 0x81
direction: c_to_node