Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ff4136f
feat(P1I): native ten-lane realtime fader/PAN/MUTE/SOLO control plane…
masarray Oct 28, 2026
f6c044b
fix(P1I): initialize native atomic FX controls from compiled DSP coef…
masarray Oct 28, 2026
8f54e4b
fix(P1I): initialize native atomic FX controls from compiled DSP coef…
masarray Oct 28, 2026
5b14d13
feat(P1I): publish channel state and VST identities from one native r…
masarray Oct 28, 2026
1631cd5
feat(P1I): expose native 10-channel parameter bridge without device r…
masarray Oct 28, 2026
8fd7e95
feat(P1I): revision-fenced premium GUI to native 10-channel fader/PAN…
masarray Oct 28, 2026
27818f8
feat(P1I): revision-fenced premium GUI to native 10-channel fader/PAN…
masarray Oct 28, 2026
24db2e6
feat(P1I): replace 10 preview strips with truthful native meters/FX a…
masarray Oct 28, 2026
e73a515
test(P1I): sample-accurate ten-channel native fader/PAN, pre-send MUT…
masarray Oct 28, 2026
b5da276
build(P1I): add synthetic native 10CH live controls CTest
masarray Oct 28, 2026
dfe66a5
ci(P1I): include no-rebuild control CTest in existing lean Windows wo…
masarray Oct 28, 2026
c3e532f
test(P1I): assert live GUI faders, FX identity, meters and epoch ACK
masarray Oct 28, 2026
5064a4e
build(P1I): include native test tuple and pair contracts explicitly
masarray Oct 28, 2026
c79bf1f
fix(P1I): repaint FX rack only on 10CH native LAB mode transitions
masarray Oct 28, 2026
b12b405
docs(P1I): complete native 10CH control milestone and hardware accept…
masarray Oct 28, 2026
cc7a045
build(gui): maintain exact premium standalone/WebView app.js parity f…
masarray Oct 28, 2026
0b2e1f0
fix(P1I): accept full native +10 dB fader gain in structural routing …
masarray Oct 28, 2026
ea1a35c
fix(P1I): reapply native fader/PAN/MUTE/SOLO into route draft and pre…
masarray Oct 28, 2026
ddb18fa
fix(P1I): remove duplicated native channelControls status block found…
masarray Oct 28, 2026
f9e23a9
test(P1I): correct expected stereo balance gain (L=0.4 R=0.5 at PAN +…
masarray Oct 28, 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
2 changes: 1 addition & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
-DBUILD_TESTING=ON
-DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps"
- name: Build executable and native RT tests
run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixLiveChannelFxTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixLiveChannelFxTests ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
- name: Test realtime control primitives
run: ctest --test-dir build -C Release --output-on-failure
- name: Package verified JUCE GUI for hardware FAT
Expand Down
5 changes: 5 additions & 0 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,11 @@
function flushUiParams(){uiFlushScheduled=false;const bridge=window.__JUCE__?.backend;if(bridge?.emitEvent)for(const event of pendingUiParams.values())bridge.emitEvent('arMixParameter',event);pendingUiParams.clear()}
function send(param,value,ch=currentChannel){
const event={channel:ch+1,parameter:param,value};
// P1I: native routing token rejects UI gestures from stale device graphs.
const liveToken=window.__armixRouteToken;
if(ch>=0&&ch<10&&liveToken?.epoch>0&&liveToken?.revision>0){
event.routeEpoch=liveToken.epoch;event.routeRevision=liveToken.revision;
}
if(['faderDb','pan','trimDb','phonesDb','masterGain'].includes(param)){
pendingUiParams.set(`${ch}:${param}`,event);
if(!uiFlushScheduled){uiFlushScheduled=true;requestAnimationFrame(flushUiParams)}
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ if(BUILD_TESTING)
target_link_libraries(ARMixNativeMixerSessionTests PRIVATE juce::juce_audio_devices juce::juce_recommended_config_flags)
target_compile_features(ARMixNativeMixerSessionTests PRIVATE cxx_std_20)
add_test(NAME P1FPhysicalPortToNativeMasterAndEpochGuard COMMAND ARMixNativeMixerSessionTests)
add_executable(ARMixTenChannelLiveControlTests tests/realtime_ten_channel_controls_test.cpp)
target_compile_features(ARMixTenChannelLiveControlTests PRIVATE cxx_std_20)
add_test(NAME P1ITenChannelLiveFaderPanMuteSoloAndStableFx COMMAND ARMixTenChannelLiveControlTests)
juce_add_console_app(ARMixLiveChannelFxTests PRODUCT_NAME "ArSonMix P1H Independent Channel FX Tests")
target_sources(ARMixLiveChannelFxTests PRIVATE tests/live_channel_fx_graph_test.cpp engine/core/LiveChannelFxGraph.h)
target_link_libraries(ARMixLiveChannelFxTests PRIVATE juce::juce_audio_processors juce::juce_recommended_config_flags)
Expand Down
24 changes: 24 additions & 0 deletions docs/P1I_UNIFIED_10CH_REALTIME_CONSOLE_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# P1I — Premium 10-Channel Console → REAL Native Realtime DSP

Baseline: `main@758ec23e959305115d7fc4e23f7c9f73ddad43c8` (P1H, merged native multichannel VST3, GUI v0.8). This extends the existing `PreparedMixerBlock + LiveChannelFxGraph + RealtimeRoutePublisher` without a new audio callback, second engine, or redundant GUI layout. This is a major UI-to-engine correction, **not** full Studio One feature parity.

## Delivered

1. **10 real channel faders/PAN/MUTE/SOLO on the existing premium console** while the native Routing LAB is active and its real device graph has been approved. `web/app.js` passes the native route epoch+revision in control events; `Main.cpp` dispatches all channel IDs 1–10, rejecting old-token updates; `LiveDryRoutingLab` updates atomic per-strip controls of the *same* published graph. Legacy CH1 controls remain unchanged when LAB is stopped. Physical source selection, BUS layout and one stereo-compatible VST3 insert per channel still require the LAB structural APPLY.
2. **No VST3 re-instantiation or device restart for parameter-only edits.** Fader/PAN coefficient calculation occurs in control thread. Audio callback loads atomics once per block; per-channel 64-sample gain ramp suppresses zipper clicks. Independent PRE-send mute/solo gate also ramps, so MUTE suppresses sends without abruptly dropping all buses. Routing DAG, activated hardware port masks, published revision and actual vendor instances stay unchanged. SOLO uses precompiled DAG reachability to keep soloed lane's upstream/downstream path; unrelated channels become silent. No callback heap, JSON, locks, driver I/O or plugin lifecycle operation added.
3. **Truthful premium GUI telemetry.** When the 10CH graph is active, all ten strips display actual native post-fader peak data. CH2–10 no longer pretend to be disconnected, while any empty VST slot is labelled DRY/ROUTE instead of a fake running plugin. FX Rack displays the actual selected per-channel native FX name and opens the same Routing LAB for structural changes. Master FX remain explicitly unavailable; no invented bus or fake editor.
4. **Output safety preserved:** stale epoch/revision event rejected; device topology fault latches silence until explicit remap; structural edits still require OUTPUT MUTE, avoid other thread's independent clock driver, build new graph off RT and preserve CH1 original VST3 + Orbit + preset + GUI. Only param edits bypass structural compile.
5. **Native synthetic acceptance:** `tests/realtime_ten_channel_controls_test.cpp` checks sample-level PRE-fader send at fader=0, SOLO DAG closure, mute-on-PRE, stereo PAN, bus fader, no callback allocation and stale epoch/revision control rejection. Existing JUCE vendor-instance test continues to execute and requires same VST3 identity/lifecycle semantics. One existing Windows workflow reused; no extra CI matrix.

## How to use on real device

- Select and validate a DIRECT ASIO or WASAPI audio device with correct enabled physical input/output masks; configure Routing LAB while **MUTE OUTPUT** is ON and CH1 production FX temporarily removed. For multichannel, enable required inputs in native AUDIO SETUP; JUCE initial 1IN/2OUT requested minimum does not enable every physical input automatically.
- Inside Routing LAB, set CH1–10 physical Mono/Stereo inputs, optional BUS destination, PRE/POST sends, and independent stereo-compatible VST3 effect IDs. Click APPLY while muted. Check native ACK with exact device epoch/revision; unmute carefully at low headphone volume.
- Close LAB panel; use the **normal MIX console** faders, PAN, MUTE, SOLO for all ten strips. Observe actual DSP levels in the strip meters and FX Rack. These parameter movements do not need APPLY and do not recreate VST3. Structural edits remain through Routing LAB and require muting; STOP LAB safely restores previous CH1 host with output held muted.
- Deliberately change hardware device/mask; verify stale UI gestures are rejected, previous channel cannot accidentally route into a newly selected device. Control status re-syncs from native every 12 Hz; preview sessions in browser storage do not supersede native state.

## Limitations / next architecture gates

Still **opt-in LAB**, not full production DAW. BUS uses the same fixed 10 strip slots, not separate AUX pool; only one stereo-compatible VST3/strip in LAB; no full multichannel plug-in editor, portable route state, PDC, hardware CUE/output patchbay or MONO bus layout negotiation. Structural routing APPLY still recreates even unchanged VST3 instances and interrupts tails; that is the NEXT architecture debt. Native strip MUTE/SOLO and PAN have 64-sample interpolation; vendor processors may still allocate/block internally and hardware timing is not validated. The serious #15 0-FX hardware crackle remains open; MSVC+CTest PASS is not hardware proof.

**Next major milestone:** separate 10 physical input strips from aux/subgroup/FX buses and implement stable FX instance ownership through graph changes, one native MixSession/patchbay SSOT. No bulk-merging overlapping stale #115/#117; preserve current approved GUI lightweight/onboard GPU performance. Gate every new iteration with exact-head Windows native + Chromium + physically recorded dry-through FAT.
13 changes: 11 additions & 2 deletions engine/core/LiveChannelFxGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class LiveChannelFxGraph final {

explicit LiveChannelFxGraph(const PreparedRenderGraph& plan,int frames,int pluginQuantum=512)
: block_(std::make_unique<PreparedMixerBlock>(plan,frames)),
pluginQuantum_(std::clamp(pluginQuantum,32,PreparedMixerBlock::hardFrameLimit)) {}
pluginQuantum_(std::clamp(pluginQuantum,32,PreparedMixerBlock::hardFrameLimit)) {
// P1H callers without live edits retain original compiled faders.
for(int i=0;i<channels;++i)
controls_.setPreparedCoefficients(i,plan.leftGain[i],plan.rightGain[i]);
}

LiveChannelFxGraph(const LiveChannelFxGraph&)=delete;
LiveChannelFxGraph& operator=(const LiveChannelFxGraph&)=delete;
Expand All @@ -35,6 +39,10 @@ class LiveChannelFxGraph final {
int capacity() const noexcept{return block_?block_->capacity():0;}
int maxFramesPerPlugin() const noexcept {return pluginQuantum_;}
int activeInserts() const noexcept{return activeInserts_;}
bool setStripControl(int channel,float gain,float pan,
bool mono,bool mute,bool solo) noexcept {
return controls_.set(channel,gain,pan,mono,mute,solo);
}
const juce::String& insertName(int strip) const noexcept {
static const juce::String empty;
return strip>=0&&strip<channels?names_[strip]:empty;
Expand Down Expand Up @@ -67,11 +75,12 @@ class LiveChannelFxGraph final {
midi.clear();
processors_[strip]->processBlock(buffer,midi);
};
return block_->process(physical,inputs,left,right,frames,channelFx,levels);
return block_->process(physical,inputs,left,right,frames,channelFx,levels,&controls_);
}

private:
std::unique_ptr<PreparedMixerBlock> block_;
RealtimeStripControls controls_ {};
FxBank processors_ {};
std::array<juce::MidiBuffer,channels> midi_ {};
std::array<juce::String,channels> names_ {};
Expand Down
4 changes: 2 additions & 2 deletions engine/core/NativeDryRouteCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ struct NativeDryRouteCommand final {
}
const float level=static_cast<float>(static_cast<double>(gain));
const float balance=static_cast<float>(static_cast<double>(pan));
if(!std::isfinite(level)||level<0.f||level>1.f||
if(!std::isfinite(level)||level<0.f||level>4.f||
!std::isfinite(balance)||balance< -1.f||balance>1.f) {
problem="Channel level must be 0..1 and pan -1..1";return false;
problem="Channel linear gain must be 0..4 and pan -1..1";return false;
}
auto& c=candidate.channels.stripsAndMaster.strips[i];
c.faderLinear=level;c.pan=balance;
Expand Down
104 changes: 100 additions & 4 deletions engine/core/PreparedMixerBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#pragma once
#include "ChannelSendPlan.h"
#include <algorithm>
#include <atomic>
#include <array>
#include <cmath>
#include <cstddef>
Expand Down Expand Up @@ -107,6 +108,40 @@ struct PreparedRenderGraph final {
}
};

// P1I: A single native parameter plane, updated only by the control thread.
// All coefficients are calculated on control thread. Callback reads atomics
// once per block and interpolates into fixed strip scratch buffers. The
// immutable topology (DAG/physical ports/FX ownership) is never rebuilt for
// ordinary fader, pan, MUTE, or SOLO changes.
class RealtimeStripControls final {
public:
struct Target {
std::atomic<float> left{1.f},right{1.f};
std::atomic<bool> mute{false},solo{false};
};
bool set(int strip,float gain,float pan,bool mono,bool mute,bool solo) noexcept {
if(strip<0||strip>=stripCount||!std::isfinite(gain)||gain<0.f||gain>4.f||
!std::isfinite(pan)||pan< -1.f||pan>1.f)return false;
const float left=mono?gain*std::sqrt(0.5f*(1.f-pan)):
gain*(pan>0.f?1.f-pan:1.f);
const float right=mono?gain*std::sqrt(0.5f*(1.f+pan)):
gain*(pan<0.f?1.f+pan:1.f);
auto& c=targets_[strip];
c.left.store(left,std::memory_order_relaxed);
c.right.store(right,std::memory_order_relaxed);
c.mute.store(mute,std::memory_order_relaxed);
c.solo.store(solo,std::memory_order_relaxed);
return true;
}
void setPreparedCoefficients(int strip,float left,float right) noexcept {
targets_[strip].left.store(left,std::memory_order_relaxed);
targets_[strip].right.store(right,std::memory_order_relaxed);
}
const Target& at(int strip) const noexcept{return targets_[strip];}
private:
std::array<Target,stripCount> targets_{};
};

struct RenderLevels final {
std::array<float,stripCount> channelPeak {};
float masterPeakL = 0.f, masterPeakR = 0.f;
Expand Down Expand Up @@ -150,7 +185,8 @@ class PreparedMixerBlock final {
template<class Fx>
bool process(const float* const* physical, int callbackInputCount,
float* outputL, float* outputR, int frames, Fx&& processFx,
RenderLevels* observed=nullptr) noexcept {
RenderLevels* observed=nullptr,
const RealtimeStripControls* live=nullptr) noexcept {
static_assert(std::is_nothrow_invocable_v<Fx&,int,float*,float*,int>,
"DSP hook must be noexcept and realtime bounded");
if (observed) *observed={};
Expand All @@ -167,6 +203,10 @@ class PreparedMixerBlock final {
std::fill_n(masterL_,frames,0.f);
std::fill_n(masterR_,frames,0.f);

bool anySolo=false;
if(live)for(int strip=0;strip<stripCount;++strip)
anySolo |= live->at(strip).solo.load(std::memory_order_relaxed) &&
!live->at(strip).mute.load(std::memory_order_relaxed);
for(int k=0;k<stripCount;++k) {
const int strip=graph.sends.topologicalOrder[k];
if(!graph.scheduled[strip]) continue;
Expand Down Expand Up @@ -197,12 +237,66 @@ class PreparedMixerBlock final {
}
}
processFx(strip,l,r,frames); // genuine pre-fader channel-FX seam
// Solo closure includes a soloed strip and its source/return
// ancestors/descendants, matching the compiler's original policy.
bool routeAudible=true;
float gl=graph.leftGain[strip],gr=graph.rightGain[strip];
if(live) {
const auto& target=live->at(strip);
routeAudible=!target.mute.load(std::memory_order_relaxed);
if(routeAudible&&anySolo) {
routeAudible=false;
for(int j=0;j<stripCount;++j) {
const auto& s=live->at(j);
if(s.solo.load(std::memory_order_relaxed) &&
!s.mute.load(std::memory_order_relaxed) &&
(j==strip||graph.sends.upstreamOf(strip,j)||
graph.sends.upstreamOf(j,strip))) {
routeAudible=true;break;
}
}
}
gl=target.left.load(std::memory_order_relaxed);
gr=target.right.load(std::memory_order_relaxed);
// A MUTE or SOLO transition must also silence PRE sends.
// Smooth the pre-send source gate over <=64 samples; it does
// not create/restart FX, drivers, nodes or send topology.
const float targetGate=routeAudible?1.f:0.f;
if(!rampPrimed_[strip]) {
preGate_[strip]=targetGate;
lastGainL_[strip]=gl;
lastGainR_[strip]=gr;
rampPrimed_[strip]=true;
}
const int ramp=std::min(frames,64);
const float dGate=(targetGate-preGate_[strip])/ramp;
float gate=preGate_[strip];
for(int f=0;f<frames;++f) {
if(f<ramp)gate+=dGate;
l[f]*=gate;r[f]*=gate;
}
preGate_[strip]=targetGate;
}
graph.sends.dispatch(strip,SendTap::preFader,l,r,
left_.data(),right_.data(),frames);
const float gl=graph.leftGain[strip];
const float gr=graph.rightGain[strip];
float peak=0.f;
for(int f=0;f<frames;++f) {
if(live) {
// A block-linear fader/PAN ramp avoids zipper clicks at the
// native callback rate. UI sends at most one target per rAF.
const int ramp=std::min(frames,64);
const float dL=(gl-lastGainL_[strip])/ramp;
const float dR=(gr-lastGainR_[strip])/ramp;
float lv=lastGainL_[strip],rv=lastGainR_[strip];
for(int f=0;f<frames;++f) {
if(f<ramp){lv+=dL;rv+=dR;}
l[f]*=lv;r[f]*=rv;
peak=std::max(peak,std::max(std::abs(l[f]),std::abs(r[f])));
if(graph.sends.toMaster[strip]) {
masterL_[f]+=l[f];masterR_[f]+=r[f];
}
}
lastGainL_[strip]=gl;lastGainR_[strip]=gr;
}else for(int f=0;f<frames;++f) {
l[f]*=gl;
r[f]*=gr;
peak=std::max(peak,std::max(std::abs(l[f]),std::abs(r[f])));
Expand Down Expand Up @@ -234,6 +328,8 @@ class PreparedMixerBlock final {
std::vector<float> backing_; // ALLOCATED BEFORE callback, never resized
std::array<float*,stripCount> left_{};
std::array<float*,stripCount> right_{};
std::array<float,stripCount> preGate_{},lastGainL_{},lastGainR_{};
std::array<bool,stripCount> rampPrimed_{};
float* masterL_=nullptr;
float* masterR_=nullptr;
};
Expand Down
11 changes: 11 additions & 0 deletions engine/core/RealtimeRoutePublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ class RealtimeRoutePublisher final {
retiredCount_=0;
return true;
}
// Only the single control-thread writer calls this. The editor MUST
// mutate atomic runtime parameters, never processor lifetime or topology.
// The owned snapshot is stable on the writer thread; RT reads atomics.
template<class Update>
bool updateActiveControl(std::uint64_t epoch,std::uint64_t expectedRevision,
Update&& update) noexcept {
if(!owned_||!owned_->prepared||owned_->deviceEpoch!=epoch||
owned_->graphRevision!=expectedRevision||revision_!=expectedRevision)
return false;
return update(*owned_->prepared);
}
[[nodiscard]] ReadLease acquire() noexcept {return ReadLease(*this);}
std::uint64_t lastRevision() const noexcept {return revision_;} // CONTROL
std::size_t pendingRetirements() const noexcept {return retiredCount_;} // CONTROL
Expand Down
Loading
Loading