Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
27ed203
fix(workflow): bind approved strip identity to native channels and dr…
masarray Nov 5, 2026
5ae93ed
fix(workflow): remove competing CH1 Patch/Arm wizard, reuse unified A…
masarray Nov 5, 2026
0372c1b
revert(nonruntime): avoid modifying legacy mixer-io not bundled in ap…
masarray Nov 5, 2026
312039b
feat(native): publish ten verified M4 physical input assignments for …
masarray Nov 5, 2026
2d92cc4
feat(workflow): direct ten-channel hardware IN selection, single nati…
masarray Nov 5, 2026
81a61b4
fix(setup): preserve live verified pin masks and defer unknown-device…
masarray Nov 5, 2026
0e6c0be
test(workflow): require actual bundled ten-channel IN routing, native…
masarray Nov 5, 2026
fd24cfc
fix(workflow): require post-ACK native snapshot before presenting acc…
masarray Nov 5, 2026
f440d67
test(runtime): exercise real bundled ten-channel IN controls, sparse …
masarray Nov 5, 2026
49b3b66
feat(readback): expose per-channel native MAIN routing rather than ap…
masarray Nov 5, 2026
3d8d236
feat(workflow): expose real MAIN output device, suppress demo OUT con…
masarray Nov 5, 2026
1df5047
test(runtime): mock real DOM selector semantics for native IN versus …
masarray Nov 5, 2026
b885bb7
test(runtime): correct test-only DOM query regex for actual approved …
masarray Nov 5, 2026
964c822
feat(native): expose verified ten-channel M4 fader/pan/mute/solo read…
masarray Nov 5, 2026
16400dc
feat(audio): ACK existing atomic M4 per-channel fader, pan, mute and …
masarray Nov 5, 2026
077dbd9
feat(workflow): connect G0 ten-channel fader, pan, mute, solo and mea…
masarray Nov 5, 2026
6fc5309
test(runtime): use monotonically increasing native epoch after simula…
masarray Nov 5, 2026
7ad86de
test(native): verify ten physical source/mix readback and real callba…
masarray Nov 5, 2026
59c9b43
test(native): use DynamicObject one-argument getProperty overload
masarray Nov 5, 2026
1bec845
test(runtime): verify direct CH8 M4 fader and mute ACK then current-e…
masarray Nov 5, 2026
4ba0ba5
perf(gui): prevent 12Hz static status DOM churn and preserve native c…
masarray Nov 5, 2026
04606f0
feat(native): expose actual MAIN gain and mute in verified M4 readback
masarray Nov 5, 2026
c07743d
feat(audio): ack native MAIN fader and mute with device/route safety …
masarray Nov 5, 2026
63416fc
feat(gui): connect MAIN fader/mute to native M4 ACK and verified read…
masarray Nov 5, 2026
192ef62
test(runtime): verify MAIN gain and mute require exact native ACK plu…
masarray Nov 5, 2026
0dae6f0
perf(gui): stop redundant 12Hz root authority attribute writes
masarray Nov 5, 2026
c1d7d00
fix(meter): report measured MAIN stereo PCM peaks only when armed and…
masarray Nov 5, 2026
f91ac75
fix(gui): paint genuine MAIN L/R callback peaks and silence unavailab…
masarray Nov 5, 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
109 changes: 109 additions & 0 deletions integration/ApprovedNativeRuntimeSnapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,115 @@ inline bool publishVerifiedFirstSoundState(juce::var& snapshot,
boolIs(route,"hasAcceptedRoute",true));
firstSound->setProperty("routingRevision",physicalReady
?juce::String(static_cast<juce::int64>(revision)):juce::String("0"));
// Direct physical-source readback for EVERY existing 10-channel M4 strip.
// Never infer source routes from demo UI, or mark stale controls accepted.
juce::Array<juce::var> sources;
if(physicalReady) {
const bool patched=boolIs(route,"hasAcceptedRoute",true);
const auto accepted=route.getProperty(
patched?"acceptedRoute":"preparedM4Route",{});
const auto rows=accepted.getProperty("channels",{});
const auto* list=rows.getArray();
if(list && list->size()==10) {
for(const auto& row:*list) {
const auto mode=row.getProperty("mode",{}).toString();
const auto left=row.getProperty("left",{});
const auto right=row.getProperty("right",{});
const bool mono=mode=="MONO", stereo=mode=="STEREO";
const bool valid=mode=="NONE" ||
((mono||stereo) && (left.isInt()||left.isInt64()) &&
(right.isInt()||right.isInt64()) &&
inputs.getArray()->contains(left) &&
(!stereo || (inputs.getArray()->contains(right) && left!=right)));
if(!valid) {sources.clear();break;}
auto src=std::make_unique<juce::DynamicObject>();
src->setProperty("mode",mode);
src->setProperty("left",mono||stereo?left:juce::var(-1));
src->setProperty("right",stereo?right:juce::var(-1));
const auto main=row.getProperty("main",{});
src->setProperty("main",main.isBool()&&static_cast<bool>(main));
sources.add(juce::var(src.release()));
}
}
}
firstSound->setProperty("channelSources",juce::var(sources));
// Native ten-strip faders/pan/mute/solo already drive the SINGLE M4
// callback through LiveDryRoutingLab::setChannelParameter(). Expose the
// actual acknowledged CONTROL-thread state, never public Pages defaults.
juce::var verifiedControls(juce::Array<juce::var>{});
if(physicalReady) {
const auto controls=route.getProperty("channelControls",{});
const auto* list=controls.getArray();
if(list && list->size()==10) {
bool valid=true;
for(const auto& entry:*list) {
double db=0.,pan=0.;
if(!entry.isObject() ||
!nativeV8Number(entry.getProperty("db",{}),db) ||
!nativeV8Number(entry.getProperty("pan",{}),pan) ||
!std::isfinite(db) || db< -60.01 || db>10.01 ||
!std::isfinite(pan) || pan< -100.01 || pan>100.01 ||
!entry.getProperty("mute",{}).isBool() ||
!entry.getProperty("solo",{}).isBool()) {
valid=false;break;
}
}
if(valid)verifiedControls=controls;
}
}
firstSound->setProperty("channelControls",verifiedControls);
// MAIN gain and panic MUTE are JUCE atomics on the SAME callback.
juce::var master;
if(physicalReady) {
double db=0.;
const auto muted=live.getProperty("masterMute",{});
if(nativeV8Number(live.getProperty("masterDb",{}),db) &&
std::isfinite(db)&&db>=-60.01&&db<=10.01&&muted.isBool()) {
auto verified=std::make_unique<juce::DynamicObject>();
verified->setProperty("db",db);
verified->setProperty("mute",muted);
master=juce::var(verified.release());
}
}
firstSound->setProperty("masterControls",master);
// These peaks are REAL atomics from the installed M4 render callback,
// not UI-generated meters. Zero is silence, not proof of loudspeakers.
juce::Array<juce::var> peakL,peakR;
const auto telemetry=snapshot.getProperty("telemetry",{});
if(physicalReady && boolIs(route,"hasAcceptedRoute",true) &&
boolIs(telemetry,"captureObserved",true)) {
const auto left=route.getProperty("channelPeaksL",{}),
right=route.getProperty("channelPeaksR",{});
const auto* l=left.getArray();const auto* r=right.getArray();
if(l&&r&&l->size()==10&&r->size()==10) {
bool valid=true;
for(int i=0;i<10;++i) {
double p=0.,q=0.;
if(!nativeV8Number(l->getReference(i),p) ||
!nativeV8Number(r->getReference(i),q) ||
!std::isfinite(p)||!std::isfinite(q)||
p<0.||q<0.||p>16.||q>16.) {valid=false;break;}
}
if(valid) {peakL=*l;peakR=*r;}
}
}
firstSound->setProperty("channelPeaksL",juce::var(peakL));
firstSound->setProperty("channelPeaksR",juce::var(peakR));
// MAIN L/R callback peaks must remain dark until the monitor/output gate
// reports measured native PCM. Never paint the Pages demo oscillator.
juce::var mainL,mainR;
if(physicalReady && boolIs(route,"hasAcceptedRoute",true) &&
boolIs(telemetry,"mainPcmObserved",true)) {
double l=0.,r=0.;
if(nativeV8Number(route.getProperty("peakL",{}),l) &&
nativeV8Number(route.getProperty("peakR",{}),r) &&
std::isfinite(l)&&std::isfinite(r)&&l>=0.&&r>=0.&&
l<=16.&&r<=16.) {
mainL=l;mainR=r;
}
}
firstSound->setProperty("mainPeakL",mainL);
firstSound->setProperty("mainPeakR",mainR);
// Do not write the route to the graph or change native capability flags.
snapshot.getDynamicObject()->setProperty("legacyM4",juce::var(firstSound.release()));
return physicalReady;
Expand Down
86 changes: 86 additions & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,92 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
// M1 RT source switch on an existing physical channel. Unlike
// structural routingDryApply, it does not unpatch outputs, rebuild
// VST3s, or restart the device; input PCM fades inside one graph.
// DAW-like strip fader/pan/mute/solo: existing atomic M4 PCM owner.
// This is an explicit message-thread control ACK, not an alternative
// VST/audio callback, G0 ChannelId admission, or optimistic JS state.
// Master fader / MUTE are existing no-heap atomic controls on the
// SAME 10-channel callback, with verified device epoch and route.
if(action=="routingM4MasterControl"){
const int requestId=static_cast<int>(args.getProperty("requestId",0));
const auto name=args.getProperty("parameter",{}).toString();
const auto ep=args.getProperty("deviceEpoch",{});
const auto rv=args.getProperty("revision",{});
const auto value=args.getProperty("value",{});
const auto live=engine_.status();
const auto routing=live.getProperty("dryRoutingLab",{});
const auto routeEpoch=routing.getProperty("epoch",{});
const auto routeRevision=routing.getProperty("revision",{});
const bool tokenValid=(ep.isInt()||ep.isInt64()||ep.isDouble())&&
(rv.isInt()||rv.isInt64()||rv.isDouble())&&
(routeEpoch.isInt()||routeEpoch.isInt64())&&
(routeRevision.isInt()||routeRevision.isInt64())&&
static_cast<juce::int64>(ep)==static_cast<juce::int64>(routeEpoch)&&
static_cast<juce::int64>(rv)==static_cast<juce::int64>(routeRevision);
const bool validated=requestId>0&&tokenValid&&
static_cast<bool>(routing.getProperty("ready",false))&&
static_cast<bool>(routing.getProperty("hasAcceptedRoute",false))&&
engine_.directRouteAuthorized()&&!engine_.independentClockActive()&&
(name=="mute"?value.isBool():
name=="faderDb"&&(value.isDouble()||value.isInt()||value.isInt64())&&
std::isfinite(static_cast<double>(value))&&
static_cast<double>(value)>=-60.&&
static_cast<double>(value)<=10.);
if(validated) {
if(name=="mute")engine_.setMasterMuted(static_cast<bool>(value));
else engine_.setMasterGainDb(static_cast<float>(static_cast<double>(value)));
}
const auto now=engine_.status();
auto ack=std::make_unique<juce::DynamicObject>();
ack->setProperty("requestId",requestId);
ack->setProperty("parameter",name);
ack->setProperty("ok",validated);
ack->setProperty("error",validated?juce::String():
juce::String("STALE_OR_UNVERIFIED_MASTER_CONTROL"));
ack->setProperty("deviceEpoch",routeEpoch);
ack->setProperty("revision",routeRevision);
ack->setProperty("value",name=="mute"?
now.getProperty("masterMute",{}):now.getProperty("masterDb",{}));
if(browser_.loaded)browser_.emitEventIfBrowserIsVisible(
"arMixM4MasterAck",juce::var(ack.release()));
return;
}
if(action=="routingM4ChannelControl"){
const int requestId=static_cast<int>(args.getProperty("requestId",0));
const int channel=static_cast<int>(args.getProperty("channel",-1));
const auto name=args.getProperty("parameter",{}).toString();
const auto ep=args.getProperty("deviceEpoch",{});
const auto rv=args.getProperty("revision",{});
const auto value=args.getProperty("value",{});
const bool flag=name=="mute"||name=="solo";
const bool numeric=name=="faderDb"||name=="pan";
const bool kind=flag||numeric;
const double amount=static_cast<double>(value);
const bool valid=requestId>0&&channel>=0&&channel<LiveDryRoutingLab::count&&
kind&&(ep.isInt()||ep.isInt64()||ep.isDouble())&&
(rv.isInt()||rv.isInt64()||rv.isDouble())&&
(flag?value.isBool():(value.isDouble()||value.isInt()||value.isInt64()))&&
std::isfinite(amount)&&(!numeric||
(name=="faderDb"?(amount>=-60.&&amount<=10.):
(amount>=-100.&&amount<=100.)));
const auto epoch=valid?static_cast<std::uint64_t>(
static_cast<juce::int64>(ep)):0;
const auto revision=valid?static_cast<std::uint64_t>(
static_cast<juce::int64>(rv)):0;
const bool accepted=valid&&engine_.setDryRoutingLabParameter(
channel,epoch,revision,name,
flag?(static_cast<bool>(value)?1.f:0.f):static_cast<float>(amount));
auto ack=std::make_unique<juce::DynamicObject>();
ack->setProperty("requestId",requestId);
ack->setProperty("channel",channel);
ack->setProperty("parameter",name);
ack->setProperty("ok",accepted);
ack->setProperty("error",accepted?juce::String():
juce::String("STALE_ROUTE_OR_INVALID_CONTROL"));
ack->setProperty("state",engine_.status().getProperty("dryRoutingLab",{}));
if(browser_.loaded)browser_.emitEventIfBrowserIsVisible(
"arMixM4ControlAck",juce::var(ack.release()));
return;
}
if(action=="routingSourceSwitch"){
const int requestId=static_cast<int>(args.getProperty("requestId",0));
const int channel=static_cast<int>(args.getProperty("channel",-1));
Expand Down
Loading
Loading