Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
67ce483
feat(M3E): real live Group native ChannelId session with verified har…
masarray Oct 31, 2026
48e3a55
fix(M3E): pin JUCE var array lifetimes and invalidate live Bus on dri…
masarray Oct 31, 2026
f45380f
feat(M3E): integrate independent live Group control/epoch/readback in…
masarray Oct 31, 2026
46739d4
feat(M3E): run independent live Group PCM as exclusive producer in ex…
masarray Oct 31, 2026
64f0940
fix(M3E): keep legacy routing/FX/Show/source ACKs fail-closed while d…
masarray Oct 31, 2026
89f39d3
feat(M3E): expose native ACKed Add Bus for Selected/Stop Group comman…
masarray Oct 31, 2026
91daab4
feat(M3E Console): native ACK-backed Ctrl/Shift multiselect + indepen…
masarray Oct 31, 2026
c6a898c
style(M3E): compact Group native routing operator with low-cost selec…
masarray Oct 31, 2026
8744685
feat(M3E): register native live Bus UI and binary resources in Window…
masarray Oct 31, 2026
21a9df1
feat(M3E): register native live Bus UI and binary resources in Window…
masarray Oct 31, 2026
7daee89
feat(M3E): register native live Bus UI and binary resources in Window…
masarray Oct 31, 2026
6d0f401
feat(M3E): native Studio Bus UI kept functional in standalone and JUC…
masarray Oct 31, 2026
ea9eb95
fix(M3E): use integer native request identity for authoritative Bus t…
masarray Oct 31, 2026
09a1302
fix(M3E): keep embedded native Bus ACK identity in sync with resource
masarray Oct 31, 2026
ec672aa
feat(M3E): realtime native Group ChannelId fader with smoothed live P…
masarray Oct 31, 2026
eb5779b
feat(M3E): native Group realtime gain ACK with epoch/revision and bou…
masarray Oct 31, 2026
089043b
feat(M3E): native Group realtime gain ACK with epoch/revision and bou…
masarray Oct 31, 2026
13822fe
feat(M3E): actual Group fader UI drives one native ChannelId gain wit…
masarray Oct 31, 2026
60fa269
feat(M3E): synchronize hardware Group fader in standalone Console
masarray Oct 31, 2026
3512656
style(M3E): compact true native Group gain slider without expensive e…
masarray Oct 31, 2026
929c1dc
style(M3E): mirror live Group fader layout into standalone
masarray Oct 31, 2026
a80b771
test(M3E): guard real JUCE Bus PCM cutover, native ACK, exclusive ren…
masarray Oct 31, 2026
a1f3b21
test(M3E): 10 physical ChannelIds + independent GROUP + one native PC…
masarray Oct 31, 2026
13f06ce
docs(M3E): real single-callback independent Bus milestone, tested 0FX…
masarray Oct 31, 2026
536e30c
fix(M3E): migrate actual 10CH live fader/pan/mute/solo and OUT NONE w…
masarray Oct 31, 2026
00888eb
test(M3E): preserve native STOP fail-silent and GUI rail baselines wi…
masarray Oct 31, 2026
5300149
test(M3E): preserve native STOP fail-silent and GUI rail baselines wi…
masarray Oct 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -5449,5 +5449,184 @@
document.documentElement.dataset.arMixerShell='rail-modes';
})();
</script>
<style id="arsonmix-studio-bus-css">/* M3E: compact native Group pilot; no blur, filter, box-shadow or heavy card. */
.arStudioBusControls{box-sizing:border-box;display:grid;gap:5px;padding:8px 8px 7px;margin:4px 3px 5px;border-top:1px solid #3a5766;border-bottom:1px solid #334a55;background:#182932;min-width:0}
.arStudioBusTitle{color:#83c2d3;font:600 10px/1.2 "ArSonMix Inter","Segoe UI",sans-serif;letter-spacing:.35px}
.arStudioBusSelection{font:10px/1.35 "ArSonMix Inter","Segoe UI",sans-serif;color:#bfd1da;overflow-wrap:anywhere}
.arStudioBusControls .arStudioBusAction{height:29px;min-height:29px;font:600 10px "ArSonMix Inter","Segoe UI",sans-serif;white-space:normal}
.arStudioBusControls .arStudioBusAction:disabled{opacity:.48;cursor:not-allowed}
.arStudioBusFeedback,.arStudioBusLive{font:9px/1.4 "ArSonMix Inter","Segoe UI",sans-serif;color:#b4cad4;overflow-wrap:anywhere}
.arStudioBusLive{color:#91dfc8}
#channelList [data-choose].arBusSelected{outline:1px solid #70b6c3;outline-offset:-1px;background:#24414c}
.strip[data-strip].arBusSelected .strip-name{outline:1px solid #78b7c5;outline-offset:-1px}
.arStudioBusFader{display:grid;gap:3px;font:9px/1.3 "ArSonMix Inter","Segoe UI",sans-serif;color:#a6cad5;min-width:0}
.arStudioBusFader[hidden]{display:none!important}
.arStudioBusFader input{width:100%;min-width:0;accent-color:#50bcc7;cursor:ew-resize}
.arStudioBusFader small{color:#b4dfd9;font:10px/1.2 "ArSonMix Inter","Segoe UI",sans-serif;text-align:right}
</style>
<script id="arsonmix-studio-bus-js">// Studio Console M3E: real native ACK-backed independent GROUP pilot.
// This control projection NEVER guesses PCM or invents a CH11 in the browser.
// One existing JUCE callback owns the accepted dynamic ChannelId engine.
(() => {
'use strict';
const rail=document.querySelector('#app .left-rail');
const anchor=document.getElementById('channelList');
if(!rail||!anchor||document.getElementById('arStudioBusControls'))return;
const native=!!window.__JUCE__?.backend?.emitEvent;
const backend=window.__JUCE__?.backend;
const selected=new Set();
let last=-1,request=0,serial=0,pending=false,status=null,lastEpoch='';
const panel=document.createElement('section');
panel.id='arStudioBusControls';
panel.className='arStudioBusControls';
panel.setAttribute('aria-label','Studio native Group Bus');
const title=document.createElement('div');
title.className='arStudioBusTitle';
title.textContent='GROUP BUS';
const picked=document.createElement('small');
picked.className='arStudioBusSelection';
const action=document.createElement('button');
action.type='button';action.className='btn-180 arStudioBusAction';
const feedback=document.createElement('div');
feedback.className='arStudioBusFeedback';
feedback.setAttribute('role','status');
const live=document.createElement('div');
live.className='arStudioBusLive';
const groupFader=document.createElement('label');
groupFader.className='arStudioBusFader';
groupFader.textContent='GROUP FADER';
const gain=document.createElement('input');
gain.type='range';gain.min='-60';gain.max='10';gain.step='0.5';
gain.value='0';gain.setAttribute('aria-label','Native Group Bus fader dB');
const gainRead=document.createElement('small');
gainRead.textContent='0.0 dB';
groupFader.append(gain,gainRead);
panel.append(title,picked,action,feedback,live,groupFader);
anchor.after(panel);
const route=()=>status?.dryRoutingLab||{};
const accepted=()=>status?.studioBus||{};
const validSelection=i=>Number.isInteger(i)&&i>=0&&i<10&&
['MONO','STEREO'].includes(
String(route().acceptedRoute?.channels?.[i]?.mode||''));
const selectedList=()=>[...selected].filter(validSelection).sort((a,b)=>a-b);
function repaintSelection(){
anchor.querySelectorAll('[data-choose]').forEach(row=>{
const i=Number(row.dataset.choose);
const on=selected.has(i);
row.classList.toggle('arBusSelected',on);
row.setAttribute('aria-checked',String(on));
});
document.querySelectorAll('.strip[data-strip]').forEach(strip=>{
strip.classList.toggle('arBusSelected',selected.has(Number(strip.dataset.strip)));
});
}
function render(){
const d=route(),b=accepted(),ids=selectedList();
const liveNow=!!b.active;
picked.textContent=liveNow?
'NATIVE BUS #'+String(b.groupChannelId||'?')+' · '+String(b.sourceCount||0)+' INPUTS':
ids.length?ids.map(i=>'CH'+String(i+1).padStart(2,'0')).join(' + '):
'Ctrl/Shift+click channel names to select';
action.textContent=pending?'APPLYING…':liveNow?'STOP GROUP':'+ BUS FOR SELECTED';
const canApply=native&&!pending&&!!d.ready&&!!d.hasAcceptedRoute&&
!d.pending&&!status?.monitor&&!status?.secondaryOutputArmed&&
(liveNow||ids.length>0);
action.disabled=!canApply;
action.title=liveNow?'MUTE output and return to legacy 10CH route':
'0FX native Group pilot · MUTE output first · Add new Bus ChannelId and route selected inputs exclusively';
live.hidden=!liveNow;
groupFader.hidden=!liveNow;
gain.disabled=!liveNow||!native;
if(liveNow){
live.textContent=String(b.name||'GROUP')+' · '+(b.sources||[]).join(', ')+
' → MAIN · NATIVE PCM';
if(document.activeElement!==gain && Number.isFinite(Number(b.gainDb)))
gain.value=String(Number(b.gainDb));
gainRead.textContent=Number(gain.value)<=-60?'−∞ dB':
Number(gain.value).toFixed(1)+' dB';
}
if(!native)feedback.textContent='Web preview only · no hardware audio';
else if(!feedback.textContent)feedback.textContent=
'0FX pilot · verify native capture, MUTE output, then create Group';
repaintSelection();
}
// Extend normal single-focus behavior without replacing app.js and without
// launching an extra routing controller. Ctrl and Shift work like a Console.
document.addEventListener('click',e=>{
if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey)return;
const el=e.target.closest?.('#channelList [data-choose],.strip [data-editstrip]');
if(!el)return;
const row=el.closest('[data-choose]');
const i=Number(row?row.dataset.choose:el.dataset.editstrip);
if(!validSelection(i))return;
if(e.shiftKey&&last>=0){
const lo=Math.min(last,i),hi=Math.max(last,i);
for(let x=lo;x<=hi;++x)if(validSelection(x))selected.add(x);
}else if(selected.has(i))selected.delete(i);
else selected.add(i);
last=i;
render();
},true);
let lastGainSent=0;
const sendGain=force=>{
const b=accepted(),now=performance.now();
if(!native||!b.active||!Number.isFinite(Number(gain.value)))return;
gainRead.textContent=Number(gain.value)<=-60?'−∞ dB':
Number(gain.value).toFixed(1)+' dB';
if(!force&&now-lastGainSent<40)return; // bound UI→native control traffic
lastGainSent=now;
backend.emitEvent('arMixAction',{
action:'studioBusGain',requestId:++serial,
epoch:Number(b.epoch)||0,revision:Number(b.revision)||0,
db:Number(gain.value)
});
};
gain.addEventListener('input',()=>sendGain(false));
gain.addEventListener('change',()=>sendGain(true));
backend?.addEventListener?.('arMixStudioBusGainAck',ack=>{
if(ack?.ok!==true)feedback.textContent=
'GROUP FADER REJECTED · '+String(ack?.error||'Stale graph');
});
action.addEventListener('click',()=>{
if(!native||pending)return;
const d=route(),b=accepted(),stop=!!b.active;
const indices=selectedList();
if(!stop&&!indices.length)return;
// A user action, never 12Hz telemetry, is allowed to submit one event.
request=++serial;
pending=true;
feedback.textContent=stop?'STOPPING · waiting for native ACK':
'CREATING · waiting for native graph ACK';
render();
backend.emitEvent('arMixAction',{
action:stop?'studioBusStop':'studioBusCreateForSelected',
requestId:request,
expectedEpoch:Number(d.epoch)||0,
expectedRevision:Number(d.revision)||0,
channels:indices
});
});
backend?.addEventListener?.('arMixStudioBusAck',ack=>{
if(!pending||ack?.requestId!==request)return;
pending=false;request=0;
feedback.textContent=ack?.ok?
(ack.session?.active?'GROUP LIVE · native prepared PCM ACK':'GROUP STOPPED · native ACK'):
'REJECTED · '+String(ack?.error||'Live graph unchanged');
if(ack?.ok && status)status.studioBus=ack.session;
render();
});
backend?.addEventListener?.('arMixStatus',s=>{
status=s;
const d=route(),key=String(d.epoch||0);
if(lastEpoch!==key){
lastEpoch=key;selected.clear();last=-1;
if(pending){pending=false;feedback.textContent='CANCELLED · device epoch changed';}
}
// Cheap state projection: do not redraw strip DOM/meter graphics at 12Hz.
render();
});
render();
})();
</script>
</body></html>
</body></html>
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ juce_add_gui_app(ARMixConsole
NEEDS_CURL FALSE)

juce_add_binary_data(ARMixAssets SOURCES
web/index.html web/styles.css web/plugin-ui.css web/app.js web/plugin-ui.js web/bridge.js web/monitor.js web/mixer-io.js web/mixer-io.css web/mixer-layout.js web/mixer-layout.css web/assets/audio-interface.svg)
web/index.html web/styles.css web/plugin-ui.css web/app.js web/plugin-ui.js web/bridge.js web/monitor.js web/mixer-io.js web/mixer-io.css web/mixer-layout.js web/mixer-layout.css web/studio-bus.js web/studio-bus.css web/assets/audio-interface.svg)

target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/AuxBusPlan.h engine/core/PreparedMixerBlock.h engine/core/MasterOutputMonoPolicy.h engine/core/LiveChannelFxGraph.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/FactoryFxRegistry.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.h src/NativeDryShowRecall.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/LiveSecondaryOutputDevice.h engine/core/LiveOutputRouteGate.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/AuxBusPlan.h engine/core/PreparedMixerBlock.h engine/core/MasterOutputMonoPolicy.h engine/core/LiveChannelFxGraph.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h src/LiveDynamicBusSession.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/FactoryFxRegistry.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.h src/NativeDryShowRecall.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/LiveSecondaryOutputDevice.h engine/core/LiveOutputRouteGate.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_compile_definitions(ARMixConsole PRIVATE
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2=1
Expand Down
28 changes: 28 additions & 0 deletions docs/M3E_LIVE_NATIVE_GROUP_CALLBACK_FAT_20261101.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# M3E — actual live independent Group in ONE JUCE hardware callback

2026-11-01 · ArSonMix Studio Console · native pilot for physical 0FX testing

## This is a real vertical slice, not another offline-only test
New `src/LiveDynamicBusSession.h` prepares **11 existing ChannelIds (CH01–10 + MAIN) plus an independent Group**. Native `DynamicChannelRoster::createBusForSelected` rewrites the selected channels' **exclusive primary OUT** to the Group, and Group OUT→MAIN. The Group is **ChannelId #12**, not a spare CH10 channel; the input-bank size stays 10. Prepared PCM is compiled and atomically published under actual device epoch, verified input pin callback ordinals, current physical MAIN output pair, and all-outputs-disarmed gate. A failure changes nothing audible/accepted.

`LiveAudioEngine::audioDeviceIOCallbackWithContext` is still the **single registered JUCE callback**. For one accepted native Group it uses the dynamic published PCM **INSTEAD of** the existing `LiveDryRoutingLab::process` (never both); MAIN renders on actually ACKed physical L/R. The same output fence, MUTE, secondary-output guard, input PCM diagnostics, loudness/meter path and callback timing remain. Stale device epochs or invalid ports fail silent. A bounded 256-sample first-unmute Group fade protects the physical output on a structural handoff. UI Stage/ACK never performs audio processing.

The native Group has a **real fader**: browser -60..+10 dB → guarded native `ChannelId` atomic parameter → 64-sample DSP ramp. The BUS source count and named fan-in come from the **same prepared PCM revision** returned by `DynamicConsoleRoutingView`; not a fake browser assignment. Ctrl/Shift-click on existing input names selects multiple physical inputs. A compact GROUP rail shows live group ID, source names, and STOP GROUP. JS/HTML are mirrored for native and offline preview (preview is never described as audio live).

## Deliberate admission limits (do NOT silently lose the user's Show)
This opt-in M3E cutover is the first audible **dry Group** pilot: one Group, no existing VST3, auxiliary sends/returns, internal channel sends, independent MONITOR patch, or borrowed legacy BUS strips. The engine rejects these cases explicitly and preserves the original native 10CH graph without changing the user's accepted route. Dynamic VST3 lease transfer from M4 #261, MASTER plugins, multi-Group editing, persistent V5 Show and full native parameter parity remain separate. While the pilot owns PCM, old 10CH routing, FX bypass/edits, source switching and Show capture cannot falsely ACK changes not audible in the new graph. STOP GROUP (after MUTE+secondary DISARM) returns to the untouched original 10CH route. Device change immediately invalidates the Group and prevents stale output.

## Physical FAT protocol — Maono PS22 / normal Windows endpoint
1. Use a Windows executable built from **this exact branch HEAD**, not an earlier main artifact; otherwise this feature is absent.
2. Configure and **APPLY** verified ASIO Maono / WASAPI device and capture pins. Native status must read back actual driver + output L/R; choose and APPLY input source CH01 and CH02, verify raw input PCM with no FX.
3. **MUTE hardware MAIN and DISARM secondary stream**. Ctrl-click CH01 and CH02 names in Mixer, choose **+ BUS FOR SELECTED**. Verify positive **native ACK**, Group ID **12**, fan-in **CH1+CH2**, and Group OUT→physical MAIN.
4. ARM MAIN with the existing verified audio-safety workflow, headphone volume low. Listen to two inputs; compare direct mix before Group with Group unity: no doubled dry. Move native Group fader to -6 dB: MAIN signal should drop about 6 dB in both channels without graph restart/crackle.
5. MUTE output and **STOP GROUP**. The exact previous 10CH accepted route must return. Switch output pins or restart device; stale Group status must disappear, not route to unexpected hardware.
6. Record whether crackles occur with **0 VST**, along with driver identity, rate/buffer, capture discontinuities, raw input PCM, callback cadence and output routing. #15 is **not** closed by a successful CTest.

## Next meaningful milestone (M4→M5)
Finish #261 unified live VST3 CH1–10 leases, then move the SAME leases into the dynamic ChannelId slot adapter so a real **new Group can own compressor/EQ** and FX Return can host reverb. Convert monitor/AUX/Show snapshot by stable ID in one accepted transaction and turn off this restricted-pilot gate only when native PCM+vendor chunk+device-epoch tests pass. Then offer true standalone Add Channel/Add Bus/Add FX with keyed strips and professional comprehensive routing. Preserve one callback and no DAW timeline, recorder, OBS-only output, duplicated graph, or extra latency claims.

## Evidence gates
- New 10 input+MAIN+Group (12 IDs) native PCM regression proves exclusive primary Group routing, unity/no double dry, actual Group live -6 dB, output-armed rollback and stale-epoch fail-silent.
- Existing full Windows MSVC native CTest + Chromium/standalone JS parity must pass on exact PR head before merge. Physical Maono FAT remains not performed in CI.
Loading
Loading