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
9 changes: 7 additions & 2 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@
if(b.dataset.category){activeCategory=b.dataset.category;renderPluginBrowser();return}
if(b.dataset.group!==undefined){flash('Group selection — interface placeholder');return}
if(b.dataset.side){document.querySelectorAll('[data-side]').forEach(x=>x.classList.toggle('selected',x===b));if(b.dataset.side==='fx')setView('FX RACK');else setView('MIX');return}
switch(b.id){case'identityCancel':closeChannelIdentity();break;case'identitySave':commitChannelIdentity();break;case'masterMute':masterMute=!masterMute;b.textContent='MUTE';b.classList.toggle('active',masterMute);b.setAttribute('aria-pressed',String(masterMute));send('masterMute',masterMute,-1);break;case'masterMode':setMasterMono(!masterMono);break;case'addScene':saveMixerSnapshot();break;case'saveFxPreset':saveFxChainPreset();break;case'menuScene':exportSession();break;case'closeBrowser':closePluginBrowser();break;case'closeFxInspector':pluginEditorIndex=null;renderRackWorkspace();break;case'chooseFxFile':importSession();break;case'arSignalOpen':if(!window.__JUCE__?.backend?.emitEvent)flash('Signal Check is available in the Windows desktop app');break;default:if(b.id)flash('UI study: '+b.textContent.trim().slice(0,28));}
switch(b.id){case'identityCancel':closeChannelIdentity();break;case'identitySave':commitChannelIdentity();break;case'masterMute':masterMute=!masterMute;b.textContent='MUTE';b.classList.toggle('active',masterMute);b.setAttribute('aria-pressed',String(masterMute));send('masterMute',masterMute,-1);break;case'masterMode':setMasterMono(!masterMono);break;case'addScene':saveMixerSnapshot();break;case'saveFxPreset':saveFxChainPreset();break;case'menuScene':exportSession();break;case'closeBrowser':closePluginBrowser();break;case'closeFxInspector':pluginEditorIndex=null;renderRackWorkspace();break;case'chooseFxFile':importSession();break;case'flowRoutingButton':case'flowRoutingButtonSecondary':if(typeof window.__arMixOpenRoutingLab==="function")window.__arMixOpenRoutingLab();else flash("Routing editor is available in the native desktop app");break;case'arSignalOpen':if(!window.__JUCE__?.backend?.emitEvent)flash('Signal Check is available in the Windows desktop app');break;default:if(b.id)flash('UI study: '+b.textContent.trim().slice(0,28));}
});
// Deliberate double-click to edit a strip. Single-click only changes selection.
document.addEventListener('dblclick',e=>{const el=e.target.closest('[data-editstrip]');if(!el)return;
Expand Down Expand Up @@ -2030,7 +2030,12 @@
function focusOptions(){return channels.map((c,i)=>`<option value="${i}" ${i===currentChannel?'selected':''}>${i+1} · ${safeText(c.name)}</option>`).join('')}
function renderRackWorkspace(){let c=channels[currentChannel];let chain=normalChain(c);$('rackWorkspace').innerHTML=`<div class="feature-top"><div><span class="eyebrow">YOUR SOUND · CORE WORKFLOW</span><h2>FX Rack — ${safeText(c.name)}</h2><p>Build your signature vocal sound. Add, reorder, bypass, and store your VST chain.</p></div><div style="display:flex;gap:7px"><select id="rackChannel" class="ghost-action" aria-label="Choose channel">${focusOptions()}</select><button class="ghost-action" id="recallFxPreset">LOAD CHAIN</button><button class="action" id="saveFxFromRack">SAVE FX CHAIN</button></div></div><div class="rack-layout"><div class="chain-list"><div class="chain-end">● AUDIO INPUT · ${safeText(c.name)}</div><div class="chain-path">↓</div>${chain.map((name,i)=>`<div class="chain-node ${bypassed[currentChannel+':'+i]?'dimmed':''}"><span class="chain-index">${String(i+1).padStart(2,'0')}</span><span class="chain-name"><b>${safeText(name)}</b><small>${safeText(pluginCatalog.find(p=>p.name===name)?.hint||'VST3 plugin · mock chain state')}</small></span><button data-chainedit="${i}" title="Open plugin controls">EDIT</button><button data-chainbypass="${i}" class="${bypassed[fxKey(currentChannel,i)]?'is-bypassed':'power-on'}" aria-pressed="${!bypassed[fxKey(currentChannel,i)]}" aria-label="${bypassed[fxKey(currentChannel,i)]?'Enable':'Bypass'} ${safeText(name)}" title="${bypassed[fxKey(currentChannel,i)]?'Enable':'Bypass'} ${safeText(name)}">⏻</button><button data-chainmove="-1" data-index="${i}" title="Move up" ${i===0?'disabled':''}>↑</button><button data-chainmove="1" data-index="${i}" title="Move down" ${i===chain.length-1?'disabled':''}>↓</button><button data-chainremove="${i}" title="Remove FX">×</button></div><div class="chain-path">↓</div>`).join('')}<button class="chain-add" data-addplugin="1">+ ADD VST3 EFFECT</button><div class="chain-path">↓</div><div class="chain-end">◎ OUTPUT · MASTER / STREAM</div></div>${pluginEditorIndex!==null&&pluginEditorIndex<chain.length?pluginInspector(currentChannel,pluginEditorIndex):`<div class="guide-panel"><h3>Ready-to-use Sound</h3><p>Start with a preset, then personalize your FX chain. No complex routing required.</p><div>${['Clean Vocal','Warm Karaoke','Live Broadcast'].map(s=>`<button class="guide-chip" data-preset="${s}">${s}</button>`).join('')}</div><h3 style="margin-top:20px">Make it sound better</h3><p>Recommended signal path:</p><p>Noise Gate → EQ → Compressor → De-Esser → Reverb</p><h3 style="margin-top:20px">Demo status</h3><p>Plugin names and bypass buttons currently change visual state only. Installed VST3 scanning and DSP are scheduled for the native engine phase.</p></div>`}</div>`}
function pluginInspector(ch,slot){const name=normalChain(channels[ch])[slot],v=getFxParams(ch,slot);return `<div class="guide-panel plugin-inspector"><span class="eyebrow">FX EDITOR · DEMO PARAMETERS</span><h3>${safeText(name)}</h3><p>These generic controls demonstrate the editing and preset workflow. The real VST3 editor will replace them when connected.</p><label>Mix <output data-fxread="mix">${v.mix}%</output><input type="range" min="0" max="100" value="${v.mix}" data-fxparam="mix" data-slot="${slot}"></label><label>Amount <output data-fxread="amount">${v.amount}%</output><input type="range" min="0" max="100" value="${v.amount}" data-fxparam="amount" data-slot="${slot}"></label><label>Output <output data-fxread="output">${v.output>0?'+':''}${v.output} dB</output><input type="range" min="-24" max="12" value="${v.output}" data-fxparam="output" data-slot="${slot}"></label><button id="closeFxInspector" class="ghost-action" style="margin-top:20px;width:100%">CLOSE EDITOR</button></div>`}
function renderSignalFlow(){$('rackWorkspace').innerHTML=`<div class="feature-top"><div><span class="eyebrow">NO TECHNICAL PATCHBAY REQUIRED</span><h2>Signal Flow — See where your voice goes</h2><p>A beginner-first view of the real-time audio path. Select your audio device in Setup.</p></div><button class="action" id="openSetupFromFlow">CHOOSE AUDIO DEVICE</button></div><div class="workflow"><div class="flow-node"><span class="eyebrow">01 · INPUT</span><b>Microphone</b><small>Audio Interface<br>ASIO or WASAPI</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">02 · FX CHAIN</span><b>VST3 Plugins</b><small>EQ · Dynamics<br>Reverb · Delay</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">03 · MIXER</span><b>Mix & Monitor</b><small>Fader · Pan<br>Master · Meters</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">04 · OUTPUT</span><b>Speakers / Stream</b><small>Audio Device<br>Streaming bridge later</small></div></div><div class="flow-summary"><span>⚠ In this trial the audio flow is a visual concept; no microphone is captured and no audio is sent to a livestream.</span><button class="ghost-action" id="flowFxButton">OPEN FX RACK</button></div>`}
function renderSignalFlow(){
if(window.__JUCE__?.backend?.emitEvent){
$('rackWorkspace').innerHTML=`<div class="feature-top"><div><span class="eyebrow">ARSONMIX · NATIVE ROUTING</span><h2>Signal Flow — 10 Native Channels</h2><p>Physical inputs → native VST3 → PRE/POST sends → BUS returns → MASTER. All routing changes use the same live engine and hardware epoch.</p></div><button class="action" id="flowRoutingButton">OPEN ROUTING MATRIX</button></div><div class="workflow"><div class="flow-node"><span class="eyebrow">01 · DEVICE</span><b>Verified ASIO/WASAPI</b><small>Actual enabled port mask</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">02 · CHANNELS</span><b>10 Native Strips</b><small>Independent VST3 + live controls</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">03 · BUS</span><b>PRE/POST Sends</b><small>Cycle-validated internal returns</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">04 · MASTER</span><b>Hardware L / R</b><small>Direct authorized endpoint</small></div></div><div class="flow-summary"><span>Routing edits still require OUTPUT MUTE. Unchanged VST3 instances now retain state and tails when a route is re-applied. CUE/AUX hardware output patching and plugin latency compensation remain future gates.</span><button class="ghost-action" id="flowRoutingButtonSecondary">EDIT INPUTS & SENDS</button></div>`;
return;
}
$('rackWorkspace').innerHTML=`<div class="feature-top"><div><span class="eyebrow">NO TECHNICAL PATCHBAY REQUIRED</span><h2>Signal Flow — See where your voice goes</h2><p>A beginner-first view of the real-time audio path. Select your audio device in Setup.</p></div><button class="action" id="openSetupFromFlow">CHOOSE AUDIO DEVICE</button></div><div class="workflow"><div class="flow-node"><span class="eyebrow">01 · INPUT</span><b>Microphone</b><small>Audio Interface<br>ASIO or WASAPI</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">02 · FX CHAIN</span><b>VST3 Plugins</b><small>EQ · Dynamics<br>Reverb · Delay</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">03 · MIXER</span><b>Mix & Monitor</b><small>Fader · Pan<br>Master · Meters</small></div><span class="flow-arrow">➜</span><div class="flow-node"><span class="eyebrow">04 · OUTPUT</span><b>Speakers / Stream</b><small>Audio Device<br>Streaming bridge later</small></div></div><div class="flow-summary"><span>⚠ In this trial the audio flow is a visual concept; no microphone is captured and no audio is sent to a livestream.</span><button class="ghost-action" id="flowFxButton">OPEN FX RACK</button></div>`}
function openPluginBrowser(idx,isMaster=false){if(!isMaster){currentChannel=idx;pendingMasterSlot=null}activeCategory='All';$('pluginModal').classList.remove('hidden');$('pluginTarget').textContent=isMaster?'Adding to MASTER bus · demo FX catalog':'Adding to '+channels[idx].name+' · virtual effects catalog';$('pluginSearch').value='';renderPluginBrowser();$('pluginSearch').focus()}
function closePluginBrowser(){$('pluginModal').classList.add('hidden')}
function renderPluginBrowser(){document.querySelectorAll('[data-category]').forEach(b=>b.classList.toggle('active',b.dataset.category===activeCategory));const q=$('pluginSearch').value.trim().toLowerCase();let pool=pluginCatalog.filter(p=>(activeCategory==='All'||p.type===activeCategory)&&`${p.name} ${p.type} ${p.hint}`.toLowerCase().includes(q));$('pluginResults').innerHTML=pool.map(p=>`<button class="plugin-card" data-pluginname="${safeText(p.name)}"><span class="plugin-glyph">${safeText(p.badge)}</span><span><b>${safeText(p.name)}</b><small>${safeText(p.type)} · ${safeText(p.hint)}</small></span></button>`).join('')||'<p>No matching demo effects.</p>'}
Expand Down
26 changes: 26 additions & 0 deletions docs/P1J_STABLE_FX_ROUTING_SESSION_20261029.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# P1J — Stable VST3 lifecycle, acknowledged routing session, real Signal Flow entry
Baseline: reconciled `main@abcdf2b9e8ee9d58a4da116c84c5bec382346dd2` (P1G, P1H, P1I 10-channel live fader/pan/mute/solo, latest merged GUI/Audio Setup/Snapshots). The standalone CH1 production path, Orbit, FX move/bypass, portable CH1 preset, 10-channel physical port attestation and hardware safety fence are unchanged.

## Problem verified from code and field screenshot
1. 10-channel native routing is opt-in; screenshot displaying `NATIVE CH1` and `CH1 NATIVE + UI PREVIEW` represents the ordinary CH1 mode, not activated 10-channel DSP. P1I wires live strip faders only when the native routing session is ACTIVE. Signal Flow previously displayed a concept even in the Windows host.
2. `LiveDryRoutingLab::apply` rebuilt a graph and unconditionally created another VST3 instance per selected strip, even for a send change. Vendor plugin settings and reverb tails were lost; duplicate scans/preparations loaded the message thread.
3. WebView route editor kept an independent draft not rehydrated from accepted engine configuration on reopen. Native CH1 faders and LAB faders can diverge unless native channelControls merge is respected.

## Implemented
- `LiveChannelFxGraph`: each immutable graph holds preprepared, shared **FxInstance** objects. Shared ownership copies **only on control thread**; audio callback dereferences a stable raw pointer, with zero heap/refcount/locks, and calls the actual JUCE AudioProcessor. Each instance owns its private MIDI scratch and vendor plugin, whose releaseResources runs on the control thread only after all old/new graph snapshots are safely retired. An atomic nonblocking try-enter guards vendor processing against unexpectedly overlapping callbacks: on contention, that strip is silenced instead of concurrently invoking the same VST3. C++ exceptions are caught inside the real callback and silently fail that strip (SEH/OS crashes remain outside this guarantee).
- `RealtimeRoutePublisher::controlPrepared` permits the single control thread to inspect the current graph only if the device epoch + expected revision match. Never call this from RT.
- On LAB APPLY, a matching **same-channel + identical catalog ID + same epoch + same device quantum** keeps the exact prior instance and vendor state. Changed/removed FX still instantiate/retire safely; old graph remains until all RT readers release. `fxReused` telemetry confirms the number carried forward and `fxCount` actual inserts. Rejected changes never replace previously published FX or routing.
- Native `acceptedRoute` is updated only after successful publication, included in status/ACK on the message thread. On Routing editor open, WebView hydrates physical ports/FX IDs/sends from this authoritative ACK, then overlays the current live fader/pan/mute/solo values from `channelControls`. Never replace the in-progress editor draft on periodic meter telemetry.
- `SIGNAL FLOW` tab in the Windows host now truthfully depicts the 10-channel native routing architecture and exposes two entry buttons to the same real Routing LAB. It does not bypass the explicit OUTPUT MUTE / DIRECT/epoch fence. Standalone demo keeps its separate honest preview.
- C++ test extends existing native processor test with same-pointer identity, no duplicate prepare, parameter-processing continuity after publish, protection against stale IDs/revisions, old reader lease and deferred release, and no allocations during RT; Node UI contract verifies SSOT and stable FX design.

## Real Windows hardware FAT acceptance
- Start output muted. Verify DIRECT single-device ASIO/WASAPI with actual active input ports (minimum 1; CH2..10 can be assigned only from actual active masks). CH1 original FX rack must be empty before enabling LAB.
- From top `SIGNAL FLOW` click `OPEN ROUTING MATRIX`, select physical input to CH1/CH2, choose native VST3 A / B, add internal sends, APPLY. Confirm `fxCount=2, fxReused=0`. Unmute at low volume, capture a stable reference.
- Mute output, reopen via Signal Flow. Native state (physical pins, FX choices, sends, fader adjustments) must restore exactly. Change a SEND level/destination while keeping FX identities; APPLY. Confirm `fxReused=2`, unchanged FX parameters and reverb tail history, no duplicate scanning or reprepare. Unmute. Changes through the main console 10-channel faders must remain native.
- Change just CH2 FX: expect `fxReused=1`; previous CH2 effect released safely after callback lease retires. Test failed plugin/module, stale revision/device swap, and STOP; no sound through unverified hardware output. For actual crackle, run #15 output-only/capture-only/direct isolation separately.

## Release gates (NOT solved by synthetic CI)
No full native mixer snapshot persistence across app restart yet; acceptedRoute is runtime message-thread session only. No 10 independent physical inputs unless device enabled, still uses 10 physical/BUS slots, one stereo-compatible VST3 per strip, one MAIN stereo output, no PDC, vendor GUIs/mono-only/sidechain/multi-FX or AUX/CUE outputs. Structural APPLY still requires OUTPUT MUTE, so this is not a fully uninterrupted DAW editing workflow. Out-of-process plugin crash isolation and #15 zero-FX hardware crackle remain unqualified. Windows MSVC/CTest + Chromium success cannot substitute for real hardware FAT.

Next milestones: stable per-channel multi-insert rack with state serialization, 10 fixed INPUT strips + separate AUX/BUS graph and full output patches, live structural graph edits/crossfades, PDC.
Loading
Loading