Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7e3da98
feat(P1K): compile-only four dedicated AUX buses with bounded source …
masarray Oct 28, 2026
0fb3f77
feat(P1K): execute four independent post-strip AUX FX return lanes be…
masarray Oct 28, 2026
bd6e593
feat(P1K): 10 channel FX plus four separately owned AUX VST3 processo…
masarray Oct 28, 2026
da94d38
feat(P1K): native command validates fixed AUX return definitions and …
masarray Oct 28, 2026
5807de2
feat(P1K): publish 10 input + four dedicated AUX VST3 routes, meters …
masarray Oct 28, 2026
2b007d0
feat(P1K): carry 10 channel plus 4 AUX trusted FX selections to live DSP
masarray Oct 28, 2026
4a01984
feat(P1K): validate actual AUX FX identities from native catalog befo…
masarray Oct 28, 2026
8bcfdef
feat(P1K UI): dedicated AUX returns panel and native-accepted AUX sta…
masarray Oct 28, 2026
b561b8e
feat(P1K GUI): real control rows for four independent AUX returns
masarray Oct 28, 2026
a90a451
feat(P1K GUI): route PRE/POST sends to CH or dedicated AUX1–4 destina…
masarray Oct 28, 2026
bd25c96
feat(P1K GUI): send AUX transaction fields and show native dedicated …
masarray Oct 28, 2026
1aac308
test(P1K): real 10 physical channels plus four independent AUX render…
masarray Oct 28, 2026
9543678
build(P1K): register native dedicated AUX CTest and DSP header
masarray Oct 28, 2026
721980f
ci(P1K): validate dedicated AUX DSP in existing Windows job
masarray Oct 28, 2026
e5bf903
test(P1K): verify full GUI/native AUX routes are real, not mock channels
masarray Oct 28, 2026
e61f8ea
test(P1K): real JUCE AudioProcessor native FX in independent AUX retu…
masarray Oct 28, 2026
322e0b7
test(P1K): assert real AUX VST3 selector, not a fixed literal label
masarray Oct 28, 2026
7e00638
test(P1K): exact AUX pre-fader post-FX/post-gain meter expectation
masarray Oct 28, 2026
3073bf0
test(P1K): parse native AUX1 PRE send from GUI, reject disabled/inval…
masarray Oct 28, 2026
bec9001
safety(P1K): zero AUX DSP meters on device stop, STOP and callback fa…
masarray Oct 28, 2026
42e1bd6
docs(P1K): actual 10-input plus four AUX native routing, hardware FAT…
masarray Oct 28, 2026
25f948d
test(P1K): reconcile legacy channel-send and FX bank contracts with i…
masarray Oct 28, 2026
f9a6a3b
fix(P1K MSVC): correct native JUCE AUX/channel plugin diagnostic labe…
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 ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixShowSchemaTests 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 ARMixDedicatedAuxBusTests ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixShowSchemaTests 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: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ juce_add_gui_app(ARMixConsole
juce_add_binary_data(ARMixAssets SOURCES
web/index.html web/styles.css web/app.js web/bridge.js web/monitor.js)

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/PreparedMixerBlock.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/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.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/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/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/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.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/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 Expand Up @@ -72,6 +72,9 @@ if(BUILD_TESTING)
add_executable(ARMixTenChannelLiveControlTests tests/realtime_ten_channel_controls_test.cpp)
target_compile_features(ARMixTenChannelLiveControlTests PRIVATE cxx_std_20)
add_test(NAME P1ITenChannelLiveFaderPanMuteSoloAndStableFx COMMAND ARMixTenChannelLiveControlTests)
add_executable(ARMixDedicatedAuxBusTests tests/dedicated_aux_bus_test.cpp)
target_compile_features(ARMixDedicatedAuxBusTests PRIVATE cxx_std_20)
add_test(NAME P1KTenIndependentInputsAndFourDedicatedAuxReturns COMMAND ARMixDedicatedAuxBusTests)
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
28 changes: 28 additions & 0 deletions docs/P1K_TEN_INPUTS_FOUR_DEDICATED_AUX_20261029.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# P1K — Ten permanently available INPUT lanes + FOUR dedicated AUX/FX RETURNS
**Base** `main@faee66f475cced8e97bb4e4726b153aa49b10607`: P1J stable vendor processor ownership, P1I realtime 10CH mixer GUI, P4 native ShowV2 wire validation, latest P0 GUI, full native port/epoch fences. The separate GUI optimization PR #133 is intentionally untouched. **This extends the existing live routing DSP**, not a new audio device thread or parallel mixer.

## Meaningful behavior
The previous P1G/H routing compiled exactly 10 total strips: a reverb BUS occupied physical CH10 or another input. P1K adds **four dedicated AUX returns, indexed AUX1..AUX4, outside physical CH1..10**, each stereo with enable, gain, mute, MAIN output control, optional *independent* zero-latency stereo VST3 processor, and a realtime peak meter. All ten source strip inputs may still be assigned while all four AUX returns are active. This is an actual native callback path, not UI-preview.

The existing `PreparedRenderGraph`, `PreparedMixerBlock`, `LiveChannelFxGraph`, `RealtimeRoutePublisher`, `LiveDryRoutingLab` and `NativeDryRouteCommand` remain the **single** engine. No code duplicates or resets Orbit, CH1 production VST host, 10CH real faders, P0 hardware testing, backup or GUIs. Existing internal channel→channel (legacy BUS) sends remain compatible for saved running sessions. New destinations 10–13 identify AUX1–AUX4 distinctly. New compiler validates enabled AUX, gain 0..4, explicit PRE/POST, source CH1..10, bounded send count, no duplicate tap edge, and each bus's valid identity before ACK. AUX cannot send back to INPUT/AUX, so no self-feedback or cycles by construction.

DSP order each block: verified physical input(s) → channel-specific VST3 → PRE SEND (including dedicated AUX destinations) → realtime fader/PAN/mute/solo ramp → channel POST SEND → 4 dedicated AUX buffers → independent AUX stereo VST3 → AUX gain/mute/Master → MASTER. The P1J shared-internal ownership/graph revision remains unchanged: a selected AUX VST3 with same stable AUX slot + native catalog ID + hardware epoch/quantum is reused across route edits, not re-instantiated. Distinct AUX FX lifecycle is prepared off RT and plugin retirements occur only after reader leases. No new locks, callback allocations, or device reopen. AUX scratch is allocated only when an AUX is enabled (up to 8 * 8192 floats in addition to 10 strips), and all send coefficients / sorting / validation are compiled off RT.

In `SIGNAL FLOW → OPEN ROUTING MATRIX`, a new **DEDICATED AUX / FX RETURNS** subsection allows choosing AUX enable, output MAIN, volume, plugin from trusted catalog. Send destination dropdown distinguishes CH 1..10 from AUX 1..4. Native accepted-route SSOT now includes `auxes` and the ACK carries `auxCount`, `auxSendCount`, `auxFxNames` and `auxPeaks`. Route editor reopens from accepted configuration + current live faders, never stale WebView UI state. The premium MAIN mixer strip layout, colors, Orbit button, FX rack and LCD are not touched.

## FAT at real hardware
1. Use approved DIRECT ASIO/WASAPI, verified input mask, no independent clock. Explicitly MUTE OUTPUT and disable legacy CH1 VST chain before starting LAB. Never assume that JUCE opened ten capture ports simply because ten logical inputs exist.
2. `SIGNAL FLOW → OPEN ROUTING MATRIX`. Assign physical IN1…IN10 to CH1–CH10 *only if those ports are actually enabled in AUDIO SETUP*. Enable AUX1 for vocal reverb and AUX2 for another return. The CH1–CH10 assignments remain selectable at the same time.
3. Choose independent zero-latency stereo VST3 reverb on AUX1 and another plugin on AUX2 (or test dry first). Route CH1 PRE→AUX1, CH3 POST→AUX2. APPLY WHILE MUTED. Require native ACK `auxCount=2`, `auxSendCount=2`, `fxCount` matching selected strips/returns.
4. Unmute low-level headphones. Change fader CH1 to -inf: its PRE send remains audible but dry source silences. The POST send from CH3 must follow its fader. AUX volume/mute and MAIN toggle must affect only its independent return, not a source input.
5. MUTE, edit only a send and APPLY: native `fxReused` must include the unchanged AUX VST3. Trigger invalid destination (AUX disabled, unknown VST3, stale epoch, invalid gain or duplicate send): existing native topology remains active, no alternate input fallback.
6. Perform independent #15 zero-FX hardware crackle/clock test; no software CTest can establish zero dropouts at an actual DAC.

## Deterministic test / acceptance
- Device-independent native CTest uses all ten actual physical sample arrays and two simultaneous AUX returns; verifies analytic sample multiplication through PRE/POST, output/master sums, aux mute and return FX taps, no RT allocations, invalid destinations, duplicate send, disabled AUX, rollback, and old no-AUX compatibility.
- JUCE native CTest executes **real `AudioProcessor::processBlock`** on a physical source and on a dedicated AUX with P1J stable shared FX instance through graph replacement (no prepare/release or state loss).
- Native command test validates `juce::var` JSON decoding/physical assignment, true bus id 10, invalid disabled AUX and rollback.
- Existing Windows CMake + same CI workflow test target `ARMixDedicatedAuxBusTests` and Node native GUI contract. Never merge until the exact PR SHA has green Windows full app/CTest/ZIP and Chromium. Reconcile changes from parallel UI PR #133 before merge.

## Outstanding architecture gates — not misrepresented
This is **operator-opt-in** 10-input+4-AUX live Routing LAB, not fully integrated DAW-style production FX rack. Each strip and AUX has one stereo-compatible VST3, no multichannel plugin state snapshot restore or PDC, no AUX-to-AUX routing and **no dedicated physical AUX output** yet (all enabled AUX return to stereo MAIN). User still must MUTE while applying structural changes. Existing legacy BUS return within ten strip grid is retained for backward compatibility, but new dedicated AUX should be used instead. A full Studio One/Audition-style production console requires multi-insert rack per strip, AUX/CUE output patching, full Scene recall and hardware #15 qualification. Avoid merging outdated #115/#117 wholesale.
132 changes: 132 additions & 0 deletions engine/core/AuxBusPlan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include "ChannelSendPlan.h"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>

// P1K: additional, dedicated stereo AUX/FX returns. These are NOT strips.
// The original 10 INPUT strips and their P1G internal channel-channel sends
// remain unchanged. AUX receives only from input strips (never an AUX), then
// returns only to MASTER. This one-way topology makes feedback impossible by
// construction. Everything validates/compiles on CONTROL, zero RT allocations.
namespace armix::mixer {
inline constexpr int auxBusCount=4;
inline constexpr int maxAuxSends=32;
struct AuxBusDefinition final {
bool enabled=false, toMaster=true, mute=false;
float gain=1.f; // linear 0..4, post AUX insert
};
struct AuxSendDefinition final {
int source=-1; // INPUT 0..9, including existing internal returns
int destination=-1; // AUX index 0..3, never an INPUT index
SendTap tap=SendTap::postFader;
float gain=.25f, pan=0.f;
bool enabled=true;
};
struct AuxBusRequest final {
std::array<AuxBusDefinition,auxBusCount> buses{};
std::array<AuxSendDefinition,maxAuxSends> sends{};
int count=0;
};
enum class AuxFault : std::uint8_t {
none, invalidCount, invalidBus, invalidStrip, disabledTarget,
invalidTap, invalidGain, invalidPan, duplicateSend
};
struct AuxError final {
AuxFault fault=AuxFault::none;
int index=-1;
};
struct AuxBusPlan final {
struct Edge {
int bus=-1;
SendTap tap=SendTap::postFader;
float leftGain=0.f,rightGain=0.f;
};
std::array<AuxBusDefinition,auxBusCount> buses{};
std::array<Edge,maxAuxSends> edges{};
std::array<int,stripCount+1> offset{};
int edgeCount=0;
bool active=false;

static bool compile(const AuxBusRequest& requested,AuxBusPlan& out,AuxError& error) noexcept {
error={};
if(requested.count<0||requested.count>maxAuxSends){
error={AuxFault::invalidCount,-1};return false;
}
AuxBusPlan candidate;
candidate.buses=requested.buses;
for(int b=0;b<auxBusCount;++b) {
const auto& bus=requested.buses[b];
if(!std::isfinite(bus.gain)||bus.gain<0.f||bus.gain>4.f){
error={AuxFault::invalidGain,b};return false;
}
candidate.active|=bus.enabled;
}
std::array<int,stripCount> outgoing{};
for(int i=0;i<requested.count;++i) {
const auto& s=requested.sends[i];
if(s.source<0||s.source>=stripCount){
error={AuxFault::invalidStrip,i};return false;
}
if(s.destination<0||s.destination>=auxBusCount){
error={AuxFault::invalidBus,i};return false;
}
if(s.tap!=SendTap::preFader && s.tap!=SendTap::postFader){
error={AuxFault::invalidTap,i};return false;
}
if(!std::isfinite(s.gain)||s.gain<0.f||s.gain>1.f){
error={AuxFault::invalidGain,i};return false;
}
if(!std::isfinite(s.pan)||s.pan< -1.f||s.pan>1.f){
error={AuxFault::invalidPan,i};return false;
}
if(!s.enabled)continue;
if(!requested.buses[s.destination].enabled){
error={AuxFault::disabledTarget,i};return false;
}
for(int j=0;j<i;++j) {
const auto& prev=requested.sends[j];
if(prev.enabled && prev.source==s.source &&
prev.destination==s.destination && prev.tap==s.tap){
error={AuxFault::duplicateSend,i};return false;
}
}
++outgoing[s.source];
++candidate.edgeCount;
}
for(int s=0;s<stripCount;++s)
candidate.offset[s+1]=candidate.offset[s]+outgoing[s];
auto next=candidate.offset;
for(int i=0;i<requested.count;++i){
const auto& s=requested.sends[i];
if(!s.enabled)continue;
auto& e=candidate.edges[next[s.source]++];
e={s.destination,s.tap,s.gain*(s.pan>0.f?1.f-s.pan:1.f),
s.gain*(s.pan<0.f?1.f+s.pan:1.f)};
}
out=candidate;
return true;
}

// Unconditioned block-level send accumulation: caller owns mute/solo
// source policy and supplies channel scratch AFTER PRE gate / fader.
// Every destination is a dedicated, preallocated AUX stereo buffer.
void dispatch(int source,SendTap tap,const float* left,const float* right,
float* const* auxL,float* const* auxR,int frames) const noexcept {
if(!active||source<0||source>=stripCount||frames<=0||!left||!right||
!auxL||!auxR)return;
for(int i=offset[source];i<offset[source+1];++i){
const auto& e=edges[i];
if(e.tap!=tap)continue;
auto* dl=auxL[e.bus];auto* dr=auxR[e.bus];
if(!dl||!dr)continue;
for(int f=0;f<frames;++f){
dl[f]+=left[f]*e.leftGain;
dr[f]+=right[f]*e.rightGain;
}
}
}
};
} // namespace armix::mixer
Loading
Loading