Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c05c33b
feat(core): persist independent per-EdgeId SEND enabled state and rej…
masarray Nov 13, 2026
5583caa
feat(pcm): compile disabled parallel SEND to zero contribution withou…
masarray Nov 13, 2026
be15783
fix(pcm): prevent live send gain edits from re-enabling an OFF edge
masarray Nov 13, 2026
e0344a9
feat(session): round-trip SEND enabled in .smix with legacy default ON
masarray Nov 13, 2026
17ed387
feat(logical): add validated SET_SEND_ENABLED and truthful edge snaps…
masarray Nov 13, 2026
b70209d
test(core): verify SEND OFF/ON preserves EdgeId and rejects stale/pri…
masarray Nov 13, 2026
f0f2458
test(pcm): verify per-EdgeId SEND OFF silences audio and ON restores …
masarray Nov 13, 2026
95ed9df
feat(core): add independent digital pre-insert ChannelId gain state a…
masarray Nov 13, 2026
518c2c2
feat(pcm): process digital input gain before FX with callback-safe 64…
masarray Nov 13, 2026
95a6581
feat(native): accept epoch-fenced input gain into prepared PCM target
masarray Nov 13, 2026
b17ee04
feat(native): remember epoch-ACKed input gain across graph recompilation
masarray Nov 13, 2026
6a5cf68
feat(session): persist digital input trim with legacy unity migration
masarray Nov 13, 2026
67ebb84
feat(logical): SET_INPUT_GAIN −24..24 dB and truthful digital gain sn…
masarray Nov 13, 2026
1bd4cf8
test(pcm): prove native digital gain precedes nonlinear FX and smooth…
masarray Nov 13, 2026
5cf45bb
test(logical): preserve stable ChannelId digital gain through offline…
masarray Nov 13, 2026
31690ec
feat(core): exact EdgeId PRE_FADER/POST_FADER retap with primary rout…
masarray Nov 13, 2026
f6f23f7
feat(logical): validated per-EdgeId SET_SEND_TAP with explicit PRE_FA…
masarray Nov 13, 2026
6e606d4
test(pcm): true PRE_FADER wet survives source fader zero while POST g…
masarray Nov 13, 2026
eddcb14
ci(fast): compile deterministic PCM gain, PRE/POST and SEND tests on …
masarray Nov 13, 2026
a1c2fbb
feat(native): remember live SEND ON state without structural graph re…
masarray Nov 13, 2026
63d2377
feat(snapshot): carry accepted input gain and enabled state in native…
masarray Nov 13, 2026
6c25d03
feat(pcm): realtime SEND ON/OFF with existing 64-sample gain ramp by …
masarray Nov 13, 2026
903c419
feat(native): atomic installed SEND ON/OFF target with correlated rou…
masarray Nov 13, 2026
d6fb132
feat(native): epoch-gated live SEND ON/OFF preserving accepted EdgeId…
masarray Nov 13, 2026
38cce36
test(pcm): live SEND ON/OFF ramps 64 samples without graph rebuild
masarray Nov 13, 2026
90f64ba
test(pcm): verify intermediate SEND ramp at 4 samples and final 60-sa…
masarray Nov 13, 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
10 changes: 10 additions & 0 deletions .github/workflows/logical-mixer-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
paths:
- 'engine/core/DeviceIndependentMixerSession.h'
- 'engine/core/DynamicChannelRoster.h'
- 'engine/core/DynamicPreparedMixerBlock.h'
- 'engine/core/DynamicAcceptedSession.h'
- 'engine/core/DynamicNativeSessionPublisher.h'
- 'tests/dynamic_accepted_session_test.cpp'
- 'tests/device_independent_mixer_session_test.cpp'
- '.github/workflows/logical-mixer-fast.yml'
workflow_dispatch:
Expand All @@ -19,3 +23,9 @@ jobs:
tests/device_independent_mixer_session_test.cpp \
-o /tmp/arsonmix-logical-test
/tmp/arsonmix-logical-test
- name: Compile and run native PCM gain, PRE/POST and SEND regressions (no JUCE)
run: |
c++ -std=c++20 -O1 -Wall -Wextra -Werror -I. \
tests/dynamic_accepted_session_test.cpp \
-o /tmp/arsonmix-dynamic-pcm-test
/tmp/arsonmix-dynamic-pcm-test
23 changes: 23 additions & 0 deletions engine/core/DynamicAcceptedSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,15 @@ class DynamicAcceptedSession final {
return false;
return accepted_.rememberLiveMix(id,linear,pan);
}
// A real accepted post-source, pre-FX digital gain update. Remembers the
// final value without changing graph topology or touching the audio thread.
bool setLiveInputGain(std::uint64_t epoch,std::uint64_t graphRevision,
ChannelId id,float linear) noexcept {
const auto* row=accepted_.find(id);
if(!row || row->role!=ChannelRole::input ||
!publisher_.setInputGain(epoch,graphRevision,id,linear))return false;
return accepted_.rememberLiveInputGain(id,linear);
}
// The accepted physical patch is canonical too: subsequent Group/FX
// graph recompiles must preserve the most recently ACKed live SOURCE.
bool setLivePhysicalSource(std::uint64_t epoch,std::uint64_t graphRevision,
Expand Down Expand Up @@ -350,6 +359,20 @@ class DynamicAcceptedSession final {
source,destination,preFader,linear);
}

// Real-time per-EdgeId SEND ON/OFF uses the same prepared PCM graph,
// retains remembered gain, and never tears down/recreates its WIRE.
bool setLiveSendEnabled(std::uint64_t epoch,std::uint64_t graphRevision,
ChannelId source,std::uint64_t edgeId,bool enabled) noexcept {
const auto* row=accepted_.find(source);
if(!row || !edgeId)return false;
for(const auto& edge:row->sends)
if(edge.edgeId==edgeId && !edge.primaryOutput){
if(!publisher_.setSendEnabled(epoch,graphRevision,
source,edgeId,enabled,edge.gain))return false;
return accepted_.rememberLiveSendEnabled(source,edgeId,enabled);
}
return false;
}
bool setLiveWireGain(std::uint64_t epoch,std::uint64_t revision,
ChannelId source,std::uint64_t edgeId,float gain) noexcept {
const auto* row=accepted_.find(source);
Expand Down
49 changes: 47 additions & 2 deletions engine/core/DynamicChannelRoster.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ struct ChannelSendRef final {
float pan=0.f; // send-only balance: PRE mono uses equal-power coefficients
bool primaryOutput=false; // OUT selector edge, not a parallel SEND
std::uint64_t edgeId=0; // stable native identity; CONTROL-only assignment
bool enabled=true; // independent SEND ON; retain EdgeId/gain/tap when OFF
};
struct ChannelStripDefinition final {
ChannelId id{};
ChannelRole role=ChannelRole::input;
ProcessingFormat format=ProcessingFormat::mono;
std::string name;
float faderLinear=1.f, pan=0.f;
float inputGainLinear=1.f; // digital pre-insert gain, not hardware preamp
bool mute=false, solo=false;
// Catalog identifiers ONLY. No vendor processor object is copied or built.
// The existing audio control thread owns independent VST instance creation.
Expand All @@ -59,7 +61,7 @@ struct ChannelEdit final {
enum class Kind : std::uint8_t {
add, duplicate, remove, move, rename, setFormat, setFader, setPan,
setMute, setSolo, addInsertReference, addSendReference, setPrimaryOutput,
removeInsertReference, moveInsertReference,
removeInsertReference, moveInsertReference, setSendEnabled, setSendTap, setInputGain,
// Control-document metadata (rack/slot bypass) changes revision
// without changing a fader, audio descriptor or live PCM topology.
touchDocumentRevision
Expand All @@ -76,6 +78,7 @@ struct ChannelEdit final {
bool primaryOutput=false; // exclusive OUT edge, independent of parallel SEND
bool connectMainOnCreate=false; // WIRE-first native creation; legacy imports unchanged
float sendPan=0.f; // independent send PAN, never channel fader PAN
std::uint64_t sendEdgeId=0; // exact parallel send identity for SEND ON/OFF
std::string text;
};
struct ChannelEditResult final {
Expand Down Expand Up @@ -119,6 +122,23 @@ class DynamicChannelRoster final {
row.faderLinear=gain;row.pan=pan;
return true;
}
bool rememberLiveInputGain(ChannelId id,float gain) noexcept {
if(!id.value || !std::isfinite(gain) || gain<0.f || gain>16.f)return false;
const auto it=index_.find(id.value);
if(it==index_.end() || channels_[it->second].role!=ChannelRole::input)return false;
channels_[it->second].inputGainLinear=gain;
return true;
}
bool rememberLiveSendEnabled(ChannelId source,std::uint64_t edgeId,bool enabled) noexcept {
if(!source.value || !edgeId)return false;
const auto it=index_.find(source.value);
if(it==index_.end())return false;
for(auto& send:channels_[it->second].sends)
if(send.edgeId==edgeId && !send.primaryOutput){
send.enabled=enabled;return true;
}
return false;
}
bool rememberLiveMuteSolo(ChannelId id,bool mute,bool solo) noexcept {
const auto it=index_.find(id.value);
if(!id.value||it==index_.end())return false;
Expand Down Expand Up @@ -230,6 +250,12 @@ class DynamicChannelRoster final {
result.fault=ChannelEditFault::invalidValue;
else it->faderLinear=op.value;
break;
case ChannelEdit::Kind::setInputGain:
if(it->role!=ChannelRole::input || !std::isfinite(op.value)||
op.value<0.f||op.value>16.f)
result.fault=ChannelEditFault::invalidValue;
else it->inputGainLinear=op.value;
break;
case ChannelEdit::Kind::setPan:
if(!std::isfinite(op.value)||op.value< -1.f||op.value>1.f)
result.fault=ChannelEditFault::invalidValue;
Expand All @@ -241,6 +267,19 @@ class DynamicChannelRoster final {
case ChannelEdit::Kind::setSolo:
it->solo=op.enabled;
break;
case ChannelEdit::Kind::setSendEnabled:
case ChannelEdit::Kind::setSendTap: {
const auto edge=std::find_if(it->sends.begin(),it->sends.end(),
[&](const auto& send){return send.edgeId==op.sendEdgeId;});
if(!op.sendEdgeId || edge==it->sends.end())
result.fault=ChannelEditFault::missingEdge;
else if(edge->primaryOutput)
result.fault=ChannelEditFault::invalidAction;
else if(op.kind==ChannelEdit::Kind::setSendEnabled)
edge->enabled=op.enabled;
else edge->preFader=op.preFader; // post-insert PRE, not PRE_FX
break;
}
case ChannelEdit::Kind::touchDocumentRevision:
// Exact stable ChannelId is validated above. Bump the
// document revision without fabricating a DSP parameter
Expand Down Expand Up @@ -306,6 +345,7 @@ class DynamicChannelRoster final {
primary->gain=1.f;
primary->preFader=false;
primary->pan=0.f;
primary->enabled=true;
} else {
if(edges.size()>=budget_.maximumSendsPerChannel) {
result.fault=ChannelEditFault::budgetExceeded;break;
Expand Down Expand Up @@ -439,6 +479,7 @@ class DynamicChannelRoster final {
// of doubling a parallel SEND in the accepted PCM.
target->primaryOutput=true;
target->gain=1.f;target->preFader=false;target->pan=0.f;
target->enabled=true;
continue;
}
}
Expand Down Expand Up @@ -750,6 +791,9 @@ class DynamicChannelRoster final {
if(!ch.id.value || ch.id.value==std::numeric_limits<std::uint64_t>::max() ||
!ids.insert(ch.id.value).second ||
!std::isfinite(ch.faderLinear) || ch.faderLinear<0.f ||
!std::isfinite(ch.inputGainLinear) || ch.inputGainLinear<0.f ||
ch.inputGainLinear>16.f ||
(ch.role!=ChannelRole::input && ch.inputGainLinear!=1.f) ||
ch.faderLinear>4.f || !std::isfinite(ch.pan) ||
ch.pan< -1.f || ch.pan>1.f)return false;
maxId=std::max(maxId,ch.id.value);
Expand All @@ -762,7 +806,8 @@ class DynamicChannelRoster final {
!send.destination.value || send.destination==ch.id ||
!edges.insert(send.edgeId).second ||
!std::isfinite(send.gain)||send.gain<0.f||send.gain>4.f ||
!std::isfinite(send.pan)||send.pan< -1.f||send.pan>1.f)
!std::isfinite(send.pan)||send.pan< -1.f||send.pan>1.f ||
(send.primaryOutput && (!send.enabled || send.preFader)))
return false;
primary+=send.primaryOutput;
maxEdge=std::max(maxEdge,send.edgeId);
Expand Down
9 changes: 6 additions & 3 deletions engine/core/DynamicConsoleRoutingView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@ struct ConsoleSendView final {
float gain=1.f,pan=0.f;
bool preFader=false;
std::uint64_t edgeId=0;
bool enabled=true;
};
struct ConsoleEdgeView final {
std::uint64_t edgeId=0;
ChannelId from{},to{};
float gainLinear=1.f;
bool preFader=false,primaryOutput=false;
bool enabled=true;
};
struct ConsoleChannelView final {
ChannelId id{};
ChannelRole role=ChannelRole::input;
ProcessingFormat format=ProcessingFormat::mono;
std::string name;
ChannelId primaryOutput{}; // zero is genuine OUT NONE, NOT muted parallel sends
float inputGainLinear=1.f; // accepted digital pre-insert stage
std::vector<ConsoleSendView> parallelSends;
std::vector<ChannelId> primarySources;
std::vector<ChannelId> parallelSendSources;
Expand Down Expand Up @@ -70,7 +73,7 @@ class DynamicConsoleRoutingView final {
return false;
ConsoleChannelView item;
item.id=row.id;item.role=row.role;item.format=row.format;
item.name=row.name;
item.name=row.name;item.inputGainLinear=row.inputGainLinear;
if(row.role==ChannelRole::main) {
if(next.main.value)return false;
next.main=row.id;
Expand All @@ -90,7 +93,7 @@ class DynamicConsoleRoutingView final {
if(it==index.end() || !link.edgeId ||
!acceptedEdgeIds.insert(link.edgeId).second)return false;
next.edges.push_back({link.edgeId,sender.id,link.destination,
link.gain,link.preFader,link.primaryOutput});
link.gain,link.preFader,link.primaryOutput,link.enabled});
auto& destination=next.channels[it->second];
if(link.primaryOutput) {
if(sender.primaryOutput.value || link.preFader ||
Expand All @@ -100,7 +103,7 @@ class DynamicConsoleRoutingView final {
destination.primarySources.push_back(sender.id);
} else {
sender.parallelSends.push_back(
{link.destination,link.gain,link.pan,link.preFader,link.edgeId});
{link.destination,link.gain,link.pan,link.preFader,link.edgeId,link.enabled});
// One source shown once in the Bus fan-in even if it has
// multiple legal taps to that destination.
if(std::find(destination.parallelSendSources.begin(),
Expand Down
30 changes: 30 additions & 0 deletions engine/core/DynamicNativeSessionPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ class DynamicNativeSessionPublisher final {
return active.graph.setChannelMix(id,gain,pan);
});
}
bool setInputGain(std::uint64_t epoch,std::uint64_t revision,
ChannelId id,float linear) noexcept {
return publisher_.updateActiveControl(epoch,revision,
[&](Prepared& active) noexcept {
return active.graph.setInputGain(id,linear);
});
}
bool setChannelMuteSolo(std::uint64_t epoch,std::uint64_t revision,
ChannelId id,bool mute,bool solo) noexcept {
return publisher_.updateActiveControl(epoch,revision,
Expand Down Expand Up @@ -353,6 +360,29 @@ class DynamicNativeSessionPublisher final {
return true;
});
}
bool setSendEnabled(std::uint64_t epoch,std::uint64_t revision,
ChannelId source,std::uint64_t edgeId,bool enabled,
float rememberedGain) noexcept {
if(!source.value || !edgeId || !std::isfinite(rememberedGain) ||
rememberedGain<0.f || rememberedGain>4.f)return false;
return publisher_.updateActiveControl(epoch,revision,
[&](Prepared& active) noexcept {
const auto it=std::find_if(active.routing.edges.begin(),
active.routing.edges.end(),[&](const auto& edge){
return edge.from==source && edge.edgeId==edgeId &&
!edge.primaryOutput;
});
if(it==active.routing.edges.end())return false;
if(active.graph.channelScheduled(source) &&
!active.graph.setSendEnabled(source,edgeId,enabled,rememberedGain))
return false;
it->enabled=enabled;
for(auto& row:active.routing.channels)if(row.id==source)
for(auto& send:row.parallelSends)
if(send.edgeId==edgeId)send.enabled=enabled;
return true;
});
}
bool setWireGain(std::uint64_t epoch,std::uint64_t revision,
ChannelId source,std::uint64_t edgeId,float gain) noexcept {
const auto* routing=acceptedRouting(epoch,revision);
Expand Down
Loading
Loading