Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
184 changes: 181 additions & 3 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,58 @@
.arIOOverlay[data-active-tab="device"] .arIOWindow footer [data-io-internal],
.arIOOverlay[data-active-tab="device"] .arIOWindow footer [data-io-advanced]{display:none!important}

/* M1 CHANNEL FOCUS: one thin native-ACK signal-flow header across the workbench,
never packed into RAIL3/sidebar. No blur, animations or per-pointer redraw. */
#app .workbench .arChannelSignalFlow{
box-sizing:border-box;flex:none;display:flex;align-items:stretch;gap:4px;
width:100%;height:35px;padding:3px 5px;min-width:0;
border-bottom:1px solid #425966;background:linear-gradient(#23353e,#15242d);
color:#d3e6eb;font:500 10px/1.2 "ArSonMix Inter","Segoe UI",sans-serif;
}
#app .workbench .arChannelSignalFlow[hidden]{display:none!important}
#app .arChannelSignalFlow .arFocusIndex{
flex:0 0 51px;display:grid;place-items:center;
background:#14272f;border:1px solid #37535f;color:#b8edf0;
font:600 10px Consolas,monospace;
}
#app .arChannelSignalFlow button{
flex:1 1 0;min-width:0;max-width:none;display:flex;align-items:center;gap:6px;
background:#10232d;border:1px solid #38505d;padding:0 7px;
color:#a2c4ce;font:600 9px "ArSonMix Inter","Segoe UI",sans-serif;
cursor:pointer;white-space:nowrap;text-align:left;
}
#app .arChannelSignalFlow button span{
flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;
white-space:nowrap;color:#e1ebef;font:500 9px Consolas,monospace;
}
#app .arChannelSignalFlow[data-native-state="unverified"] button span{
color:#baa88c;
}
#app .arChannelSignalFlow button:hover{background:#203b48;border-color:#4c8894}
#app .arChannelSignalFlow button:focus-visible{
outline:2px solid #81dfe5;outline-offset:-2px;
}
/* Existing MS5 rail lives in a strict two-column grid. AUX MASTER occupies one
additional short row, preserving the existing mode buttons and RAIL3. */
#app .left-rail .arSofControls .arAuxMasterInline{
grid-column:1/-1;display:flex;align-items:center;gap:5px;min-width:0;
height:29px;padding:0 5px;background:#0e2530;border:1px solid #3d6676;
color:#a9d5de;font:550 8px "ArSonMix Inter","Segoe UI",sans-serif;
}
#app .left-rail .arAuxMasterInline input{
flex:1 1 auto;width:36px;min-width:0;accent-color:#52b5c2;
}
#app .left-rail .arAuxMasterInline input:disabled{opacity:.38}
#app .left-rail .arAuxMasterInline output{
flex:0 0 43px;text-align:right;color:#d5edf2;
font:9px Consolas,monospace;white-space:nowrap;
}
@media(max-width:1080px){
#app .arChannelSignalFlow button{padding:0 4px;gap:3px;font-size:8px}
#app .arChannelSignalFlow button span{font-size:8px}
#app .arChannelSignalFlow .arFocusIndex{flex-basis:45px}
}


/* DEVICE1 — compact, hardware-truthful, one native device manager.
No blur, animated glow or per-pointer layout work. */
Expand Down Expand Up @@ -3225,10 +3277,68 @@
const toolbar=node('div','arMixerBankBar');
toolbar.innerHTML='<div class="arMixerBankModes" role="group" aria-label="Mixer channel bank"><button type="button" class="btn-180 active" data-mix-mode="FX" aria-pressed="true">FX</button><button type="button" class="btn-180" data-mix-mode="ROUTE" aria-pressed="false">ROUTE</button><button type="button" class="btn-180" data-mix-mode="SENDS" aria-pressed="false">SENDS</button></div><div class="arMixerBankInfo" id="arMixerBankInfo" role="status">NO HARDWARE · PREVIEW</div><button type="button" class="btn-180 arMixApply" data-mix-apply title="MUTE OUTPUT first; native ACK required">APPLY</button><button type="button" class="btn-180 arMixIoOpen" data-io-open>AUDIO I/O</button>';
host.insertBefore(toolbar,mixer);
// One genuinely selected-channel journey, NOT another DSP or source registry.
// Four compact steps show ACKNOWLEDGED state, never stage a hidden graph.
const focusFlow=node('div','arChannelSignalFlow');
focusFlow.setAttribute('aria-label','Selected live mixer channel signal flow');
focusFlow.innerHTML='<span class="arFocusIndex" data-focus-channel>CH 01</span>'+
'<button type="button" data-focus-step="source" title="Select verified physical input">SOURCE <span data-focus-source>UNPATCHED</span></button>'+
'<button type="button" data-focus-step="fx" title="Open existing native insert rack">FX <span data-focus-fx>0 INSERTS</span></button>'+
'<button type="button" data-focus-step="sends" title="Open channel AUX sends">SEND <span data-focus-sends>NO AUX</span></button>'+
'<button type="button" data-focus-step="output" title="Open verified output routing">OUT <span data-focus-out>NO OUTPUT</span></button>';
// mixer-layout.js moves the whole toolbar into the LEFT RAIL.
// The selected channel overview is therefore a separate compact WORKBENCH
// row; placing it in toolbar would jam 4 steps into 168px of sidebar.
host.insertBefore(focusFlow,mixer);
let focusIndex=0,focusSignature='';
const focusSet=(q,value)=>{
const target=focusFlow.querySelector(q);
if(target&&target.textContent!==value)target.textContent=value;
};
const selectedInputChannel=()=>{
const chosen=mixer.querySelector('.strip[data-strip].selected');
const i=chosen?Number(chosen.dataset.strip):focusIndex;
return Number.isInteger(i)&&i>=0&&i<10?i:0;
};
function refreshFocus(s){
const i=selectedInputChannel(),r=s.acceptedRoute?.channels?.[i];
const ack=!!s.ready&&!!s.active&&!!r&&Number(s.acceptedRoute.deviceEpoch)===Number(s.epoch);
const driverPins=portList(s);
const names=id=>driverPins.find(p=>p.port===id)?.label;
let source='UNPATCHED';
if(ack&&r.mode==='MONO')
source=names(r.left)||'PIN '+(Number(r.left)+1)+' · VERIFY';
if(ack&&r.mode==='STEREO')
source=(names(r.left)||'L'+(Number(r.left)+1))+' / '+
(names(r.right)||'R'+(Number(r.right)+1));
if(ack&&r.mode==='BUS')source='INTERNAL BUS';
if(!ack)source='NO NATIVE ACK';
const routed=ack?lastStatus.dryRoutingLab?.fxInstances?.[i]:null;
const inserts=Array.isArray(routed)?routed.length:0;
const legacy=i===0?Math.max(0,Number(lastStatus.chainCount)||0):0;
const fx=(inserts+legacy)+' VST3'+(legacy&&inserts?' · SPLIT OWNERS':'');
const sends=ack&&Array.isArray(s.acceptedRoute.sends)?
s.acceptedRoute.sends.filter(x=>x.from===i&&x.to>=10&&x.to<14):[];
const sendsText=sends.length?sends.map(x=>'AUX'+(x.to-9)+' '+x.tap).join(' / '):'NO AUX';
const outputs=s.mainOutputs?.length===2?s.mainOutputs:[];
const dest=ack&&r.main&&outputs.length===2?
'MAIN HW '+(outputs[0]+1)+'/'+(outputs[1]+1):
ack&&r.main?'MAIN · NO PIN':ack?'SEND ONLY':'NO OUTPUT';
const sig=JSON.stringify([i,source,fx,sendsText,dest,ack,s.pending]);
if(sig!==focusSignature){
focusIndex=i;focusSignature=sig;
focusSet('[data-focus-channel]','CH '+String(i+1).padStart(2,'0'));
focusSet('[data-focus-source]',source);
focusSet('[data-focus-fx]',fx);
focusSet('[data-focus-sends]',sendsText);
focusSet('[data-focus-out]',dest);
focusFlow.dataset.nativeState=ack&&!s.pending?'accepted':'unverified';
}
}
// MS5: explicit Sends-on-Faders control, scoped to a single real AUX return.
// MAIN fader DOM and all audio controls remain resident and unmodified.
const sofControls=node('div','arSofControls');
sofControls.innerHTML='<select data-sof-bus aria-label="Sends on Faders AUX destination"><option value="0">AUX 1</option><option value="1">AUX 2</option><option value="2">AUX 3</option><option value="3">AUX 4</option></select><button type="button" class="btn-180" data-sof-toggle aria-pressed="false">SEND FADERS</button>';
sofControls.innerHTML='<select data-sof-bus aria-label="Sends on Faders AUX destination"><option value="0">AUX 1</option><option value="1">AUX 2</option><option value="2">AUX 3</option><option value="3">AUX 4</option></select><button type="button" class="btn-180" data-sof-toggle aria-pressed="false">SEND FADERS</button><label class="arAuxMasterInline" title="Native AUX return gain — live, after AUX inserts">AUX MASTER <input type="range" data-aux-master min="-60" max="6" step=".5" value="0" aria-label="Selected AUX master return level"><output data-aux-master-read>0.0 dB</output></label>';
sofControls.hidden=true;toolbar.appendChild(sofControls);
const overlay=node('div','arIOOverlay');
overlay.id='arIOOverlay';overlay.hidden=true;
Expand Down Expand Up @@ -3346,6 +3456,18 @@
sofControls.hidden=mode!=='SENDS';
const selector=sofControls.querySelector('[data-sof-bus]');
const toggle=sofControls.querySelector('[data-sof-toggle]');
const auxLevel=sofControls.querySelector('[data-aux-master]');
const auxRead=sofControls.querySelector('[data-aux-master-read]');
const busSelected=Number(selector.value);
const acceptedBus=s.acceptedRoute?.auxes?.[busSelected];
const enabled=!!acceptedBus?.enabled&&!s.pending&&s.ready&&isNative();
const currentGain=Number(acceptedBus?.gain);
const db=Number.isFinite(currentGain)&&currentGain>0
?Math.max(-60,Math.min(6,20*Math.log10(currentGain))):-60;
auxLevel.disabled=!enabled;
if(document.activeElement!==auxLevel)auxLevel.value=String(db);
const readText=enabled?(db<=-60?'OFF':db.toFixed(1)+' dB'):'AUX OFF';
if(auxRead.textContent!==readText)auxRead.textContent=readText;
if(sofBus>=0&&(!isNative()||!s.ready||!s.active||s.epoch!==sofEpoch)){
leaveSof();sofStatus('SEND FADERS EXITED · DEVICE CHANGED');
}
Expand Down Expand Up @@ -3557,6 +3679,7 @@
if(!overlay.hidden)refreshIO();
if(!sendEditor.hidden)drawSendEditor();
sofRefresh(s);
refreshFocus(s);
}

// IO-MATRIX: reusable presentation of the existing native 10-channel graph.
Expand Down Expand Up @@ -4161,6 +4284,50 @@
lastSignature='';refresh();
}
},true);
// AUX return fader updates only after release/keyboard change; native
// DSP ramps it inside one callback. Never touch the MAIN fader or rack.
sofControls.addEventListener('change',event=>{
if(event.target.matches('[data-sof-bus]')){sofMessage='';refresh();return;}
if(!event.target.matches('[data-aux-master]'))return;
const bus=Number(sofControls.querySelector('[data-sof-bus]').value);
const db=Number(event.target.value);
const gain=db<=-60?0:Math.pow(10,db/20);
const answer=window.__arMixSetLiveAuxMasterGain?.(bus,+gain.toFixed(7));
sofMessage=answer?.ok?'AUX MASTER · WAIT NATIVE ACK':
answer?.error||'AUX master unavailable';
refresh();
});
// Channel focus is intentionally lightweight: point into existing MIX
// modes and native controller, never create a parallel mixer/FX model.
focusFlow.addEventListener('click',event=>{
const button=event.target.closest('[data-focus-step]');
if(!button)return;
event.preventDefault();
const index=selectedInputChannel();
const strip=mixer.querySelector('[data-strip="'+index+'"]');
const step=button.dataset.focusStep;
if(step==='source'){
if(!route().ready)openIO('device');
else {
setMode('ROUTE');
strip?.querySelector('.arBankSource')?.focus();
}
} else if(step==='fx'){
setMode('FX');
if(typeof chooseChannel==='function')chooseChannel(index);
strip?.querySelector('.rack')?.scrollIntoView?.({block:'nearest',inline:'nearest'});
} else if(step==='sends'){
setMode('SENDS');
const sends=route().acceptedRoute?.sends||[];
const found=sends.find(x=>x.from===index&&x.to>=10&&x.to<14);
editSend(index,found?found.to-10:0,button);
} else if(step==='output')openIO('outputs',index);
});
document.addEventListener('click',event=>{
if(event.target.closest?.('#arChannelFocus,[data-focus-step]'))return;
const strip=event.target.closest?.('.strip[data-strip],[data-choose],[data-chanselect]');
if(strip)refreshFocus(route());
});
// The legacy native VST3 bridge registers document capture before this module.
// Window capture intercepts only AUDIO SETUP, without changing FX/Orbit ownership.
window.addEventListener('click',e=>{
Expand Down Expand Up @@ -4301,8 +4468,13 @@
if(!sendEditor.hidden){closeSendEditor();e.stopImmediatePropagation();}
else if(!overlay.hidden){closeIO();e.stopImmediatePropagation();}
},true);
const observer=new MutationObserver(records=>{if(records.some(r=>r.type==='childList'))refresh();});
observer.observe(mixer,{childList:true});
const observer=new MutationObserver(records=>{
if(records.some(r=>r.type==='childList'))refresh();
if(records.some(r=>r.attributeName==='class'))
focusFlow.hidden=mixer.classList.contains('hidden');
});
observer.observe(mixer,{childList:true,attributes:true,attributeFilter:['class']});
focusFlow.hidden=mixer.classList.contains('hidden');
backend?.addEventListener?.('arMixStatus',d=>{
lastStatus=d;
// 12Hz native telemetry: update only when topology, epoch or safety changes.
Expand Down Expand Up @@ -4342,6 +4514,12 @@
refresh();
});
window.addEventListener('arMixRoutingDraftChanged',()=>{lastSignature='';refresh();});
window.addEventListener('arMixAuxMasterGainResult',event=>{
const ack=event.detail||{};
sofMessage=ack.ok?'AUX '+(ack.bus+1)+' MASTER · LIVE NATIVE ACK':
'AUX MASTER REJECTED · '+(ack.error||'Stale device');
refresh();
});
window.addEventListener('arMixAuxSendGainResult',event=>{
const a=event.detail||{};
if(sofBus>=0&&a.bus===sofBus){
Expand Down
19 changes: 19 additions & 0 deletions docs/M1B_SELECTED_CHANNEL_AND_AUX_MASTER_20261031.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# M1B — Selected CHANNEL signal-flow + real native AUX MASTER
31 October 2026 | base main after #224 | independent follow-on to #223 (POST send gain) and #224 (real audio-device/source patch).

## Operator acceptance (single source, not another routing controller)
In MIX, select CH03 or CH06: one **35 px** compact CHANNEL FOCUS ribbon across the workspace shows CH number and native accepted SOURCE, current native routed VST3 count (plus CH1 legacy owner where present), acknowledged CH→AUX sends and real physical MAIN output pair. Buttons SOURCE, FX, SEND, OUT enter existing MIX ROUTE, native insert rack, source-specific AUX send inspector and Audio I/O OUTPUT. Each new view refers to `window.__arMixRouteView()` and the JUCE `arMixStatus` snapshot, not browser-only telemetry, fake plugin controls, or invented device pins. A pending/stale graph cannot show LIVE. The left RAIL3 mode selector and floating FX editor remain untouched; there are no animations, heavy blur layers, per-frame graph rebuilds, or duplicate audio models.

## AUX return master fader — after FX, affects MAIN and MONITOR
In SENDS mode, select AUX1-4. The AUX MASTER slider on the existing slim rail section displays -60..+6 dB, with 0 dB at native gain 1.0. Release/keyboard changes dispatch `routingAuxBusGain` with exact native device epoch/revision and requestId. Only an **existing enabled** AUX bus allows 0..4 finite gain (UI deliberately caps at +6 dB); invalid/disabled bus, stale revision, unexpected device, active Show/backup, pending structural DRAFT and duplicate requests reject without a UI optimistic LIVE state.

The native single writer uses `RealtimeRoutePublisher::updateActiveControl` on the existing immutable FX graph; `LiveChannelFxGraph::setAuxBusGain` accesses one of four atomic targets stored in its pre-allocated `PreparedMixerBlock`. The single JUCE callback uses <=64-sample interpolation **after AUX FX**, before summing to MAIN and physical MONITOR. No second callback, FX recreation, heap allocation, lock, device reopen, plugin state capture, graph recompilation or manual global mute. The accepted route gain updates only on success and is retained by the next STRUCTURAL APPLY. AUX enable, mute, FX changes, PRE/PAN sends, SOURCE hot-switch, physical output setup and Show structural recall remain separate guarded transactions.

## Test and merge gates
- Native `ARMixMixerRoutingTests`: real mono mic -> POST send -> enabled AUX return -> MAIN+MONITOR; test 1.0→2.0→0.0 gain, callback-boundary ramp, steady state, rejection of missing AUX2/bad/NaN gain, immutable plan and legacy graph behavior when live control is absent.
- Chromium `mixer_io_smoke.py`: show Channel Focus readback BEFORE and AFTER positive SOURCE ACK; use FX/SOURCE navigation without remounting racks; send AUX MASTER while OUTPUT may remain ARMED; accepted route remains unchanged before native ACK, then reads updated value, then restores unity; no new `routingDryApply`; preserve G1/G3/MS5 and 11-fader layout. `mixer_io_operator_contract_test.mjs` asserts wiring/one prepared owner and no blur.
- One exact-head Windows MSVC/CTest/package and Chromium smoke run per branch; release/merge requires both SUCCESS. Standalone HTML CSS+JS embedded scripts must match modular files byte-for-byte.
- FAT on a REAL ASIO/WASAPI audio interface: baseline 0FX dry path first; then CH→AUX FX return and independent 4-output MAIN/MONITOR where available; move AUX MASTER while audio runs; listen for clicks, verify MAIN, MONITOR and accepted gain after ACK. Save native report if crackle occurs. **CI PASS is not hardware certification.** No new user hardware test request until integrated M1 operator slice and engineering gates meet release criteria.

## Truthful remaining full-product gaps
PATCH2 seamless source change with output armed still NOT implemented (#224 deliberately fails closed), actual flexible GROUP/DCA/MATRIX and arbitrary live dynamic channels not done, genuine MASTER FX/PDC unfinished, factory VST3 distribution lock may remain empty. The user requested a finished realtime mixer, so call this an integrated operator milestone, not a full Studio One/eMotion LV1 release.
3 changes: 3 additions & 0 deletions engine/core/LiveChannelFxGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ class LiveChannelFxGraph final {
const std::array<float,fxSlots>& monitorGains() const noexcept{return monitorGains_;}
// M1: native realtime send fader on an EXISTING validated AUX POST edge.
// Same prepared graph, no VST instance change or global mute.
bool setAuxBusGain(int bus,float gain) noexcept {
return block_&&block_->setAuxBusGain(bus,gain);
}
bool setAuxSendGain(int source,int bus,float gain) noexcept {
return block_ && block_->setAuxSendGain(
source,bus,SendTap::postFader,gain);
Expand Down
Loading
Loading