Skip to content

Commit 4fa4e27

Browse files
committed
feat(m2): unified CH1–10 FX console and native Studio-style BUS/FX BUS staging (reconciled on latest main)
1 parent c4bd931 commit 4fa4e27

9 files changed

Lines changed: 222 additions & 180 deletions

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
> **M2 UNIFIED FX CONSOLE / BUS WORKFLOW 2026-10-31 (BRANCH IN VALIDATION):** Read docs/M2_UNIFIED_CONSOLE_BUS_WORKFLOW_20261031.md before editing FX Rack/bus routing. Current branch unifies CH1–10 FX Rack UI using one presenter and offers real +BUS/+FX BUS using an otherwise unused native 10CH lane and existing muted native ACK. It intentionally does NOT remove CH1's legacy vendor VST3 lease, create dynamic CH11, implement native MASTER FX/PDC, or certify physical #15 FAT. Protect device + SOURCE PR #228/#231/#232/#233, Show/Orbit, one JUCE callback, epoch revision ACK, and AGENTS product truth. The next major engine milestone is real per-ChannelId FxRack/Show migration, not another cosmetic branch.
2+
13
> **LATEST CROSS-THREAD STATUS (2026-10-31, main after #234):** Read [M1/M2 & release reconciliation](docs/RECONCILED_PROGRESS_M1_M2_20261031.md) FIRST. DEVICE2+SOURCE2 are merged together in #234 (`7db4ab70`); #232 closed superseded, never merge its old head. #235 M2 FX/BUS is OPEN with Chromium regressions and not production; #229/#225 FactoryFX overlap and need selective reconcile. The native Windows FAT ZIP from `main@a7fb6151` predates #234; use a newer successful main artifact when published. No MAONO/WASAPI hardware FAT or #15 zero-VST crackle clearance, and FactoryFX approved lock still empty. Older AGENTS milestones below are historical if they conflict. Preserve one JUCE device owner, one native graph/route authority, stable L2/RAIL3, and explicit native ACK / output safety.
24
35
> **DEVICE1 CUSTOM DEVICE SETUP MERGED #228 (2026-10-31) — CI PASS, PHYSICAL FAT PENDING:** Read [PRD](docs/PRD_CUSTOM_AUDIO_DEVICE_SETUP_20261031.md), [ARD](docs/ARD_CUSTOM_AUDIO_DEVICE_SETUP_20261031.md) and [per-file handoff](docs/HANDOFF_CUSTOM_AUDIO_DEVICE_SETUP_20261031.md) before touching AUDIO DEVICE / DEVICE-DRIVER / ASIO / WASAPI. Existing WebView2 Audio I/O Matrix must become the SINGLE real device setup UI: backend, actual capture/playback endpoints, sample rate, buffer, enabled pins, APPLY with verified JUCE readback, fail-closed muted rollback. Keep ONE existing AudioDeviceManager, native routing epoch/ACK, MAIN/MONITOR/OUTPUT1/FX and #15 gate. Now DEVICE/DRIVER in the existing WebView2 matrix selects actual JUCE-reported ASIO/WASAPI/DirectSound backend, input/output endpoints, rate, buffer and verified pin masks; its native APPLY, muted rollback, readback and requestId ACK were merged in #228 at e0eaeafe88b9fdc997f3f6e7856331679db1ba7b. The old AudioDeviceSelectorComponent remains only a C++ engineering fallback and is NOT the normal UI. Physical MAONO/WASAPI FAT, vendor driver hangs and #15 0FX crackle remain UNQUALIFIED. Driver scans/opens may block vendor code: don't claim async bridge eliminates freeze; audit pinned JUCE thread affinity and instrument physical hangs. No second hardware setup UI, manager, audio graph or naive per-dropdown device restart.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# M2 — Studio-style console FX parity and native BUS staging
2+
2026-10-31 | user-visible implementation on existing native 10-input/4-AUX graph.
3+
Owner: #192 dynamic channels, #95 VST3/FX/PDC. No certified physical results claimed.
4+
5+
## Reference behavior
6+
Official Fender Studio Pro / Studio One console manual:
7+
https://fenderstudiopromanual.fender.com/en/Content/Mixing_Topics/Effects_Signal_Routing.htm
8+
https://fenderstudiopromanual.fender.com/en/Content/Mixing_Topics/The_Console.htm
9+
Audio, Bus and FX strips use inserts/sends, subgroup output sums into bus, FX send can preserve dry direct-to-MAIN, nested buses require feedback prevention. Match the operation semantics and accessible actions rather than copying branding/code/assets.
10+
11+
## What this branch actually implements
12+
- One presentation pipeline in web/bridge.js: fxLaneSnapshot, fxSlotMarkup and renderRack generate exactly the same 8-row FX workspace and 6 compact strip slots for existing CH1–10. No second visual CH1 renderer. All displayed loaded/bypass states come from real JUCE CH1 chain or native routed VST3 ACK. Unpatched lanes are disabled and clearly marked, not fake active FX.
13+
- CH1 existing VST3 lease, plugin state/Orbit, existing native bypass/move and Show remain unchanged. Other CHs keep their real routed VST3 controller. This only unifies the UI adapter and preserves audio identity until native instance-owner migration is safe.
14+
- + BUS from selected connected CH stages an otherwise unused native CH as BUS receiver, source direct MAIN off, unity POST send to the BUS, BUS MAIN on. Avoid doubled dry signal. Operator must MUTE outputs, APPLY and wait for positive native routing ACK before it sounds.
15+
- + FX BUS stages a separate BUS receiver with 0.25 linear POST send while source still feeds MAIN; the FX BUS inserts can then host real native VST3. No fake reverb added automatically.
16+
- Real native channel-send DAG validation guards self-feedback, cycles, duplicates and resource limits. The wizard also rejects pending drafts, dirty graph, stale device epoch, output armed, no source and no spare native strip; rollback restores previous source main and exact spare channel state.
17+
- No new callbacks, WebAudio DSP, allocations in processBlock, serial device changes or plugin lifecycle added. Existing 10-input/4-AUX DSP and ROUTING/MUTE/APPLY/ACK remain sole authority.
18+
19+
## Status boundaries
20+
- This is a meaningful console workflow and native routing feature, NOT yet full Studio One parity.
21+
- LIVE channel add/remove and arbitrary named buses remain unimplemented. Current +BUS reuses one of the TEN available native strips and explicitly fails when full. User may use that strip for a Vocal/Drum/FX Bus but cannot create CH11 yet.
22+
- CH1 native vendor FX and routed FX still have distinct lifecycle paths despite identical UI. MASTER insert FX, PDC and end-to-end zero latency are not implemented. ChannelId dynamic/Show migration remains the next big milestone: replace LegacyChannelOneLease and fixed 10CH path with one prepared graph + one FxRack keyed by ChannelId, preserving Orbit/vendor state and native ACK.
23+
- No claim of complete Studio One visual copy, zero device roundtrip delay, hardware approval or solved #15 crackle.
24+
25+
## Validation and physical FAT
26+
1. Exact-head native Windows compile, CTest, packaging and Chromium smoke; targeted JS contracts enforce single view model and route wizard fail-closed behavior.
27+
2. Under DIRECT ASIO/WASAPI with outputs MUTED: physical Mic CH1 -> BUS on unused CH10 -> MAIN. With output armed after accepted ACK, exactly one path should be audible. Independently physical Mic CH3 -> FX BUS on CH9, CH3 direct MAIN remains while CH9 processes real reverb VST3.
28+
3. Channel 1, 3, 9 and 10 six FX rows identical in geometry and operator workflow. No ghost live inserts, source/output stays correct, no dropped plugin editor lease/Show state. Bus routing status must only become live after positive ACK.
29+
4. Reject: output armed, source NONE, prior dirty draft, full 10 native channels, obsolete epoch, feedback cycles, VST add failure; preserve previous audible graph.
30+
5. Hardware #15: 0FX baseline and real wired ASIO/WASAPI low buffer (32/64/128), 44.1/48/96k, 30-minute soak, silence/dropout/crackle and low-spec GUI. Only mark product FAT passed after measured evidence.
31+
32+
## Follow-up architecture gate, no parallel DSP
33+
Only one live native ChannelId-based graph, same native instance lease for CH1..N, FX bus, group and main, topology precompile control-thread, stable ID, full VST3 state, safe de-click handoff and PDC. Do not merge any old 10CH prototype branch into main to simulate dynamic add. Check current main and #232 device-owner PR before changes to JUCE audio graph.

‎tests/fx_drag_reorder_contract_test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test('DAW reorder preserves real chain identity, metadata, and bypass',()=>{
4242
});
4343
test('native has six consistent empty inserts and one DSP reorder per drop',()=>{
4444
assert.match(bridge,/Array.from\(\{length:6\}/);
45-
assert.match(bridge,/Math.max\(0,6-Math.min\(state.chain.length,6\)\)/);
45+
assert.match(bridge,/Array\.from\(\{length:6\},\(_,slot\)=>fxSlotMarkup\(lane,slot,true\)\)/);
4646
assert.match(bridge,/fx-drag-ghost/);
4747
assert.match(bridge,/send\("fxMove",\{slot:from,value:to-from\}\)/);
4848
assert.doesNotMatch(bridge,/FX FULL/);

‎tests/live_routing_ui_contract_test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test("GUI exposes only truthful dry device routes and acknowledged commit",()=>{
4141
assert.match(main,/arMixRoutingLabAck/);
4242
// Default 10 fake preview strips are intentionally not made into VST3
4343
// controls by the dry hardware test.
44-
assert.match(bridge,/if\(i!==0\)/);
44+
assert.match(bridge,/const lane=fxLaneSnapshot\(i\)/);
4545
assert.match(bridge,/track\.dataset\.preview="1"/);
4646
});
4747

‎tests/mixer_shell_contract_test.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ test('L2 route and VST inserts use one consistent six-row native rack with locke
134134
assert.match(src,/master-locked-six/);
135135
assert.match(src,/class="master-insert insert empty" disabled aria-disabled="true"/);
136136
assert.match(src,/slot===0\?"FX UNAVAILABLE":"ADD FX"/);
137-
assert.match(src,/class="fx-power \$\{actual\.bypassed\?"is-bypassed":""\}"/);
138-
assert.match(src,/loaded\?"":'<span class="insert-add-glyph"/);
137+
assert.match(src,/class="fx-power /);
138+
assert.match(src,/function fxSlotMarkup\(lane,slot,compact=false\)/);
139139
assert.match(css,/@media\(max-height:690px\)\{[\s\S]*?--ar-upper-height:165px/);
140140
});
141141

‎tests/native_ui_contract_test.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ test('native meter reads DSP and hides only the nine unrouted input channels',()
2929
assert.ok(bridge.includes("meter-fill{opacity:0!important}"));
3030
});
3131
test('quick FX bypass is wired to native slot instead of demo mock',()=>{
32-
assert.match(bridge,/data-native-fx="bypass" data-slot="\$\{i\}"/);
33-
assert.match(bridge,/aria-pressed="\$\{!p\.bypass\}"/);
32+
assert.match(bridge,/data-native-fx="bypass" data-slot=/);
33+
assert.match(bridge,/aria-pressed/);
3434
assert.match(bridge,/send\("fxBypass",\{slot,value:!state\.chain\[slot\]\?\.bypass\}\)/);
3535
assert.match(engine,/graphOwned_->bypassFlags\[physical\]\.store/);
3636
assert.match(engine,/bypassEnvelope\[physical\]/);

‎tests/plugin_ui_contract_test.mjs‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ test('favorites sort to top, remain searchable and serialize in the portable cat
136136
test('real routed FX rack remains separate from Routing and respects native apply/ACK',()=>{
137137
const monitor=read('web/monitor.js');
138138
const engine=read('src/LiveDryRoutingLab.h');
139-
assert.match(bridge,/CH1 without a routed VST3 continues into its existing 8-slot rack/);
139+
assert.match(bridge,/M2 single console presenter/);
140140
assert.match(bridge,/native-rack-/);
141141
assert.match(bridge,/data-routed-fx=/);
142142
assert.match(bridge,/data-routed-apply="1"/);
@@ -185,8 +185,8 @@ test('P2 user field regressions: fixed catalog header, uniform material and orig
185185
assert.match(generatedCss,/font-size:11px!important;min-width:0/);
186186
assert.ok(standalone.includes('<style>'+generatedCss+'</style>'),
187187
'canonical standalone CSS must track the shared BTN-180 text size');
188-
assert.match(bridge,/if\(lab\?\.active && \(i!==0 \|\| \(!!lab\.channelFxNames\?\.\[0\] && state\.chain\.length===0\)\)\)/);
189-
assert.match(bridge,/if\(isMaster\|\|selected!==0\|\|\(fx&&state\.chain\.length===0\)\)/);
188+
assert.match(bridge,/function fxLaneSnapshot\(channel,master=false\)/);
189+
assert.match(bridge,/function fxSlotMarkup\(lane,slot,compact=false\)/);
190190
assert.match(bridge,/send\("addCatalog",\{id,requestId\}\)/);
191191
assert.match(bridge,/Audio device is unavailable\. Open SETUP/);
192192
assert.match(monitor,/document\.fonts\.ready\.then\(guiPaintReady,guiPaintReady\)/);
@@ -208,9 +208,9 @@ test('G5 UI safety: compact Studio One-like browser and native insert truth',()=
208208
assert.match(bridge,/MASTER FX · UNAVAILABLE/);
209209
assert.doesNotMatch(bridge,/data-native-unrouted="-1"/);
210210
assert.match(bridge,/Array\.from\(\{length:8\}/);
211-
assert.match(bridge,/data-routed-lane/);
212-
assert.match(bridge,/ar-routed-loaded/);
213-
assert.match(bridge,/state\.chain\.slice\(0,6\)/);
211+
assert.match(bridge,/data-fx-lane/);
212+
assert.match(bridge,/fxSlotMarkup\(lane,slot,true\)/);
213+
assert.match(bridge,/Array\.from\(\{length:6\},\(_,slot\)=>fxSlotMarkup\(lane,slot,true\)\)/);
214214
assert.match(bridge,/data-routed-fx/);
215215
assert.match(bridge,/data-native-fx="editor"/);
216216
});
@@ -268,3 +268,10 @@ test('FXF1 manifest parser is fail-closed and factory entries do not persist in
268268
assert.match(native,/catalog_\.scanFactoryIfPresent\(\)/);
269269
assert.match(cmake,/FactoryFxVerifiedManifestAndNegativePathGate/);
270270
});
271+
272+
test('M2 one FX presenter and native BUS staging have shared safety gates',()=>{
273+
const monitor=read('web/monitor.js');
274+
for(const term of ['function fxLaneSnapshot','function fxSlotMarkup','data-bus-create','__arMixStageBusFromSelected'])assert.ok(bridge.includes(term));
275+
for(const term of ['row.mode="BUS"','kind==="group"','draftSends.push({from:source,to:target,tap:"POST"','const issue=patchPreflight()','Object.assign(row,previousRow)','openRoutingLab()','No unused native strip for BUS'])assert.ok(monitor.includes(term));
276+
assert.doesNotMatch(bridge,/if\(lab\?\.active && \(i!==0/);
277+
});

0 commit comments

Comments
 (0)