From 3a06a0e3a8735f2b8e72327140de2b20fb2f93c2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:05:18 +0700 Subject: [PATCH 01/32] feat(vocal-throw-m3): callback-scoped authoritative native sample-frame context --- engine/core/NativeBeatFrameContext.h | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 engine/core/NativeBeatFrameContext.h diff --git a/engine/core/NativeBeatFrameContext.h b/engine/core/NativeBeatFrameContext.h new file mode 100644 index 000000000..c77f79b08 --- /dev/null +++ b/engine/core/NativeBeatFrameContext.h @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include + +// A tiny callback-local sample-clock context, NOT a transport or second +// callback. The native ChannelId publisher owns the authoritative frame +// counter. JUCE's built-in VocalThrow reads the same context only while +// it is rendering as an insert on that callback thread. No heap or locks. +namespace armix::mixer { +struct NativeBeatFrameContext final { + std::uint64_t epoch=0,revision=0,startFrame=0; + bool valid=false; +}; +inline thread_local NativeBeatFrameContext currentNativeBeatFrame{}; + +class NativeBeatFrameScope final { +public: + explicit NativeBeatFrameScope(std::uint64_t epoch,std::uint64_t revision, + std::uint64_t startFrame) noexcept + : previous_(currentNativeBeatFrame) { + currentNativeBeatFrame={epoch,revision,startFrame,epoch!=0&&revision!=0}; + } + ~NativeBeatFrameScope() noexcept {currentNativeBeatFrame=previous_;} + NativeBeatFrameScope(const NativeBeatFrameScope&)=delete; + NativeBeatFrameScope& operator=(const NativeBeatFrameScope&)=delete; + static NativeBeatFrameContext current() noexcept { + return currentNativeBeatFrame; + } +private: + NativeBeatFrameContext previous_{}; +}; +} // namespace armix::mixer From 194357de5a6bef0dac2c659ccf98bb133cba11f5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:05:54 +0700 Subject: [PATCH 02/32] feat(m3): timestamp music onsets in authoritative native callback sample frames --- engine/core/NativeMusicTempoMonitor.h | 44 ++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h index 81560fa3d..a86c7c049 100644 --- a/engine/core/NativeMusicTempoMonitor.h +++ b/engine/core/NativeMusicTempoMonitor.h @@ -19,6 +19,10 @@ class MusicTempoEstimator final { struct Result final { float bpm=0.f,confidence=0.f; std::uint64_t beatAnchorTick=0,observationTick=0; + // Both are authoritative native callback sample-frame positions. + // Onset is quantized by the 10ms summary window; not sample-perfect + // transient detection or DAW-wide delay compensation. + std::uint64_t beatAnchorFrame=0,observationFrame=0; bool locked=false; }; void reset() noexcept { @@ -26,7 +30,8 @@ class MusicTempoEstimator final { lastHit_=lastScan_=lastTick_=0; stableCount_=0;candidateBpm_=0;result_={}; } - void ingest(float energy,std::uint64_t tick) noexcept { + void ingest(float energy,std::uint64_t tick, + std::uint64_t endingFrame=0) noexcept { if(!std::isfinite(energy)||energy<0.f)energy=0.f; if(lastTick_ && (tick<=lastTick_ || tick-lastTick_>4))reset(); lastTick_=tick; @@ -36,12 +41,13 @@ class MusicTempoEstimator final { // every 10ms. 80ms refractory rejects the same drum's ringing. if(tick>=lastHit_+8 && energy>.003f && rise>std::max(.005f,floor_*.45f)) { - hits_[write_]={tick,std::min(1.f,rise)}; + hits_[write_]={tick,std::min(1.f,rise),endingFrame}; write_=(write_+1)%hits_.size(); count_=std::min(count_+1,hits_.size()); lastHit_=tick; } previous_=energy; + if(endingFrame)result_.observationFrame=endingFrame; if(result_.locked && tick>lastHit_+320) { result_.locked=false;result_.confidence=0.f; candidateBpm_=stableCount_=0; @@ -53,7 +59,11 @@ class MusicTempoEstimator final { } Result result() const noexcept {return result_;} private: - struct Hit {std::uint64_t tick=0;float strength=0.f;}; + struct Hit { + std::uint64_t tick=0; + float strength=0.f; + std::uint64_t frame=0; + }; std::array hits_{}; std::size_t count_=0,write_=0; std::uint64_t lastHit_=0,lastScan_=0,lastTick_=0; @@ -107,14 +117,17 @@ class MusicTempoEstimator final { // The strongest recent transient is a practical pulse anchor; // explicit "beat-phase certified" remains a separate field FAT. float strength=0.f; - std::uint64_t anchor=0; + std::uint64_t anchor=0,anchorFrame=0; const auto period=6000.f/result_.bpm; for(std::size_t i=0;iperiod*1.8f)continue; - if(h.strength>=strength) {strength=h.strength;anchor=h.tick;} + if(h.strength>=strength) { + strength=h.strength;anchor=h.tick;anchorFrame=h.frame; + } } result_.beatAnchorTick=anchor; + result_.beatAnchorFrame=anchorFrame; result_.observationTick=lastTick_; result_.locked=true; } @@ -161,6 +174,19 @@ class NativeMusicTempoMonitor final { revision_.store(revision,std::memory_order_relaxed); config_.fetch_add(1,std::memory_order_release); } + // AUDIO ONLY: the accepted publisher calls this ONCE per successfully + // admitted render block before traversing its ChannelId lanes. Revisions + // do not reset this clock; a physical epoch change always does. + std::uint64_t beginAudioBlock(std::uint64_t epoch,int frames) noexcept { + if(audioEpoch_!=epoch) { + audioEpoch_=epoch; + audioFrameClock_=0; + } + const auto start=audioFrameClock_; + if(frames>0)audioFrameClock_+=static_cast(frames); + blockStartFrame_=start; + return start; + } // AUDIO: invoked once for every scheduled source channel by the existing // renderer's pre-FX dispatch. Only the selected ID costs per-sample work. void capture(ChannelId id,const float* left,const float* right,int frames, @@ -181,7 +207,8 @@ class NativeMusicTempoMonitor final { const float r=std::isfinite(right[i])?std::abs(right[i]):0.f; energySum_+=.5f*(l+r); if(++bucketSamples_==window) { - const Frame f{generation,++audioTick_,energySum_/window}; + const Frame f{generation,++audioTick_,energySum_/window, + blockStartFrame_+static_cast(i)+1}; if(!frames_.push(f)) dropped_.fetch_add(1,std::memory_order_relaxed); bucketSamples_=0;energySum_=0.f; @@ -196,7 +223,8 @@ class NativeMusicTempoMonitor final { } Frame f{}; for(int i=0;i<512 && frames_.pop(f);++i) - if(f.generation==generation)estimator_.ingest(f.energy,f.tick); + if(f.generation==generation) + estimator_.ingest(f.energy,f.tick,f.frameEnd); State out{}; out.source.value=source_.load(std::memory_order_relaxed); out.epoch=epoch_.load(std::memory_order_relaxed); @@ -212,6 +240,7 @@ class NativeMusicTempoMonitor final { std::uint32_t generation=0; std::uint64_t tick=0; float energy=0.f; + std::uint64_t frameEnd=0; }; armix::builtin_fx::FxSpsc frames_{}; MusicTempoEstimator estimator_{}; // CONTROL owner only @@ -221,6 +250,7 @@ class NativeMusicTempoMonitor final { std::uint32_t audioGeneration_=0,bucketSamples_=0; float energySum_=0.f; std::uint64_t audioTick_=0; + std::uint64_t audioEpoch_=0,audioFrameClock_=0,blockStartFrame_=0; std::uint32_t controlGeneration_=0; // CONTROL only }; } // namespace armix::mixer From 6ccb6789e16b52fe72ec8da617e67d1e8f41a37b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:06:09 +0700 Subject: [PATCH 03/32] feat(m3): share per-render sample origin with vocal FX inside one native graph --- engine/core/DynamicNativeSessionPublisher.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index a2246c308..b713400ae 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -3,6 +3,7 @@ #include "DynamicPreparedMixerBlock.h" #include "DynamicConsoleRoutingView.h" #include "NativeMusicTempoMonitor.h" +#include "NativeBeatFrameContext.h" #include "RealtimeRoutePublisher.h" #include "RealtimeRenderPermit.h" #include @@ -202,6 +203,11 @@ class DynamicNativeSessionPublisher final { if(!exclusive) { clearOutputs();return false; } + // One sample domain for all ChannelIds and their FX racks. This + // fixed-time callback-local scope also fences bypassed/stale inserts; + // no second transport thread, allocation or callback is introduced. + const auto startFrame=musicTempo_.beginAudioBlock(deviceEpoch,frames); + NativeBeatFrameScope frameScope{deviceEpoch,snap->graphRevision,startFrame}; // Prepared FX takes precedence over the legacy external callback. // NEVER invoke both: that would double-compress or double-reverb. // Snapshot ownership pins the M4 instance throughout this callback; From 4f84261f683b89c3a3b24608d144520685ce1af5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:07:06 +0700 Subject: [PATCH 04/32] feat(m3): quantize only new echo starts to frozen native music sample grid --- engine/builtin_fx/VocalThrow.h | 49 +++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index 0b0aaaee8..d49993394 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -100,6 +100,22 @@ class VocalThrow final { // frozen tail keeps its interval when a backing track changes tempo. void setMusicIntervalSamples(std::uint32_t samples) noexcept { musicIntervalSamples_=samples; + gridValid_=false; // BPM-only mode never claims a measured beat grid. + } + // AUDIO: the JUCE insert reads the one accepted ChannelId block clock + // and control-prepared music onset anchor. Onsets are observed in 10ms + // windows, so beat-phase is approximate (not sample-perfect detection). + // The local->graph sample mapping is taken before every FX processing + // block; it works even when the insert was added after playback began. + void setMusicBeatGrid(std::uint32_t intervalSamples, + std::uint64_t anchorFrame, + std::uint64_t blockStartFrame, + bool locked) noexcept { + musicIntervalSamples_=locked?intervalSamples:0; + gridValid_=locked&&intervalSamples>0; + gridAnchorFrame_=anchorFrame; + gridBlockStartFrame_=blockStartFrame; + gridLocalStartFrame_=clock_; } // AUDIO: triggers the most recent word/phrase, preferring the latest // vocal end if the singer stopped within the last 700 ms. @@ -217,6 +233,8 @@ class VocalThrow final { std::uint64_t copyEnd=0,freezeCount=0; std::size_t copyIndex=0,sourceIndex=0; std::uint32_t edgeSamples=0; + std::uint64_t gridAnchorFrame=0,gridCueFrame=0,gridCueLocal=0; + bool gridValid=false; bool copying=false,playing=false; }; bool freezeAt(std::uint64_t end) noexcept { @@ -239,6 +257,14 @@ class VocalThrow final { slot->active=settings_; if(musicIntervalSamples_) slot->active.intervalSamples=musicIntervalSamples_; + // Freeze the same accepted beat grid as the captured phrase. + // Later tempo changes, stale epochs or an unplugged MUSIC WIRE do + // not re-time an already accepted echo tail. + slot->gridValid=gridValid_; + slot->gridAnchorFrame=gridAnchorFrame_; + slot->gridCueFrame=gridBlockStartFrame_+ + (gridValid_?clock_-gridLocalStartFrame_:0); + slot->gridCueLocal=clock_; slot->copying=true; ++throwCount_; return true; @@ -258,7 +284,24 @@ class VocalThrow final { if(voice.sourceIndex==historyL_.size())voice.sourceIndex=0; if(voice.copyIndex!=voice.freezeCount)return; voice.copying=false; - const auto first=std::max(clock_,voice.copyEnd+voice.active.intervalSamples); + std::uint64_t first=std::max( + clock_,voice.copyEnd+voice.active.intervalSamples); + if(voice.gridValid && voice.active.intervalSamples && + first>=voice.gridCueLocal) { + const auto interval=voice.active.intervalSamples; + const auto globalFirst=voice.gridCueFrame+ + (first-voice.gridCueLocal); + // Quantize only the echo onset, never the singer's dry PCM. + // Use unsigned arithmetic and bound grid correction to one + // subdivision, protecting against a stale/future anchor. + if(globalFirst>=voice.gridAnchorFrame) { + const auto remainder= + (globalFirst-voice.gridAnchorFrame)%interval; + if(remainder)first+=interval-remainder; + } else if(voice.gridAnchorFrame-globalFirst<=interval) { + first+=voice.gridAnchorFrame-globalFirst; + } + } float amplitude=1.f; for(int tap=0;tap(tap); @@ -286,6 +329,8 @@ class VocalThrow final { voice.copyIndex=voice.sourceIndex=0; voice.edgeSamples=0; voice.copying=voice.playing=false; + voice.gridValid=false; + voice.gridAnchorFrame=voice.gridCueFrame=voice.gridCueLocal=0; voice.repeatStarts.fill(0);voice.repeatGains.fill(0.f); } std::fill(historyL_.begin(),historyL_.end(),0.f); @@ -301,6 +346,8 @@ class VocalThrow final { float duck_=1.f,wetSmoothed_=.42f; double rate_=0.; std::uint32_t musicIntervalSamples_=0; + std::uint64_t gridAnchorFrame_=0,gridBlockStartFrame_=0,gridLocalStartFrame_=0; + bool gridValid_=false; unsigned throwCount_=0; bool armed_=false,manualInCurrentPhrase_=false,ready_=false; }; From 7c94ae711bf307ec4c54c7ea0a5025a1474ea412 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:07:49 +0700 Subject: [PATCH 05/32] feat(m3): epoch-fenced atomic phase transport to JUCE vocal echo processor --- engine/builtin_fx/VocalThrowProcessor.h | 41 ++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index a7573b0a1..c8d264410 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -3,6 +3,7 @@ #include "VocalThrow.h" #include "FxSpsc.h" #include "../core/RealtimeNativeFxControl.h" +#include "../core/NativeBeatFrameContext.h" #include #include #include @@ -69,10 +70,25 @@ class VocalThrowProcessor final : public juce::AudioProcessor, void processBlock(juce::AudioBuffer&,juce::MidiBuffer&) override{} void consumeRealtimeEdits() noexcept override { if(!ready_)return; - // One atomic acquire per callback, before queueing the newest throw. - // A source change and button click cannot freeze the previous BPM. - core_.setMusicIntervalSamples( - musicInterval_.load(std::memory_order_acquire)); + // One bounded attempt, never spin in ASIO. The native PCM callback + // is the ONLY owner of a valid block sample clock. A stale epoch, + // graph revision, or torn control publication falls back to TAP. + const auto block=armix::mixer::NativeBeatFrameScope::current(); + const auto v0=gridVersion_.load(std::memory_order_acquire); + bool valid=block.valid && (v0&1U)==0U; + std::uint64_t anchor=0; + std::uint32_t interval=0; + if(valid) { + const auto epoch=gridEpoch_.load(std::memory_order_relaxed); + const auto revision=gridRevision_.load(std::memory_order_relaxed); + anchor=gridAnchor_.load(std::memory_order_relaxed); + interval=musicInterval_.load(std::memory_order_relaxed); + const auto v1=gridVersion_.load(std::memory_order_acquire); + valid=v0==v1 && block.epoch==epoch && + block.revision==revision && interval>0 && anchor>0 && + anchor<=block.startFrame; + } + core_.setMusicBeatGrid(interval,anchor,block.startFrame,valid); Edit e{}; if(!done_.canPush()||!commands_.pop(e))return; const bool applied=e.kind==CommandKind::settings? @@ -101,6 +117,21 @@ class VocalThrowProcessor final : public juce::AudioProcessor, musicInterval_.store(valid?packet.intervalSamples:0, std::memory_order_release); } + // CONTROL ONLY: one source-derived BPM+phase packet is fenced by the + // accepted native PCM epoch/revision. The sample-grid anchor comes from + // onset timestamped INSIDE the same audio callback (10ms granularity). + // Writer is the existing serialized JUCE timer, not a second thread. + void publishMusicGrid(float bpm,std::uint64_t anchorFrame, + std::uint64_t epoch, + std::uint64_t revision) noexcept { + gridVersion_.fetch_add(1,std::memory_order_acq_rel); // odd, unstable + publishMusicBpm(bpm); + gridAnchor_.store(bpm>=60.f&&bpm<=200.f?anchorFrame:0, + std::memory_order_relaxed); + gridEpoch_.store(epoch,std::memory_order_relaxed); + gridRevision_.store(revision,std::memory_order_relaxed); + gridVersion_.fetch_add(1,std::memory_order_release); // even, ready + } bool queueSettings(const VocalThrowSettings& settings,std::uint64_t id) noexcept { if(!ready_||id==0)return false; Edit e{};e.id=id;e.kind=CommandKind::settings; @@ -180,6 +211,8 @@ class VocalThrowProcessor final : public juce::AudioProcessor, VocalThrowSettings accepted_{}; std::atomic observedThrows_{0}; std::atomic musicInterval_{0}; + std::atomic gridVersion_{0},gridAnchor_{0}; + std::atomic gridEpoch_{0},gridRevision_{0}; std::atomic observedTail_{false}; double rate_=0.; float lastTempoBpm_=0.f; // CONTROL only From f5821a63cca93d71a7ad0026e98d6e08af3191ff Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:08:16 +0700 Subject: [PATCH 06/32] feat(m3): deliver measured beat onset grid to native vocal inserts with epoch fencing --- src/Main.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 9033e4752..27f333d77 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1892,6 +1892,11 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr lastMusicTempo_.tempo.locked); reply->setProperty("musicBpm",lastMusicTempo_.tempo.bpm); reply->setProperty("musicConfidence",lastMusicTempo_.tempo.confidence); + reply->setProperty("musicGridAvailable",lastMusicTempo_.active&& + lastMusicTempo_.tempo.locked&& + lastMusicTempo_.tempo.beatAnchorFrame>0); + reply->setProperty("musicBeatAnchorFrame",juce::String( + std::to_string(lastMusicTempo_.tempo.beatAnchorFrame))); reply->setProperty("musicDroppedFrames", static_cast(lastMusicTempo_.dropped)); juce::Array bands; @@ -2035,12 +2040,17 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // vocal inserts consume a precomputed atomic interval, not a WebView BPM. void serviceNativeMusicTempo() { lastMusicTempo_=engine_.pollNativeMusicTempo(); - const auto bpm=lastMusicTempo_.active&&lastMusicTempo_.tempo.locked? - lastMusicTempo_.tempo.bpm:0.f; - engine_.forEachNativeProcessor([bpm]( + const bool locked=lastMusicTempo_.active&& + lastMusicTempo_.tempo.locked&& + lastMusicTempo_.tempo.beatAnchorFrame>0; + const float bpm=locked?lastMusicTempo_.tempo.bpm:0.f; + const auto anchor=locked?lastMusicTempo_.tempo.beatAnchorFrame:0; + const auto epoch=lastMusicTempo_.epoch; + const auto revision=lastMusicTempo_.revision; + engine_.forEachNativeProcessor([bpm,anchor,epoch,revision]( armix::mixer::ChannelId,juce::AudioProcessor* p) { if(auto* vocal=dynamic_cast(p)) - vocal->publishMusicBpm(bpm); + vocal->publishMusicGrid(bpm,anchor,epoch,revision); }); } From 338b9745e0d83450872a11c312f7a241c214aea9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:09:23 +0700 Subject: [PATCH 07/32] test(m3): exact native sample-grid delay onset and frozen-tail stability at 64/128 frames --- tests/builtin_vocal_throw_test.cpp | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 11ed08ab3..909da86c3 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -284,6 +284,57 @@ static void musicTempoChangesOnlyFutureTail() { run(manual,0.f,0.f,7680,a,b); check(a>.01f&&b>.01f); } +// M3 beat-phase regression. Vocal PCM remains zero-latency dry, while the +// first frozen echo is snapped to the accepted source beat lattice. Changing +// transport AFTER the cue never changes the frozen tail's scheduled onset. +static void nativeMusicBeatGridQuantization(int quantum) { + VocalThrow gridded,unquantized; + check(gridded.prepare(48000)&&unquantized.prepare(48000)); + auto settings=gridded.settingsForTests(); + settings.mode=0;settings.captureMs=120.f; + settings.repeats=1;settings.bpm=120.f; + settings.division=0;settings.wet=1.f;settings.ducking=0.f; + check(gridded.resetUnpublished(settings)); + check(unquantized.resetUnpublished(settings)); + float l=0.f,r=0.f; + run(gridded,.65f,.35f,12000,l,r); + run(unquantized,.65f,.35f,12000,l,r); + run(gridded,0.f,0.f,3000,l,r); + run(unquantized,0.f,0.f,3000,l,r); + // Both processors have local sample 15000; one backing music onset + // anchor is at global sample 8000 (12000 sample quarter beat). + gridded.setMusicBeatGrid(12000,8000,15000,true); + noHeap.store(true,std::memory_order_release); + const auto snapped=gridded.throwNow(); + const auto plain=unquantized.throwNow(); + // Simulate late rejection of source / changed BPM immediately following + // the cue. The old grid snapshot must remain in this tail. + gridded.setMusicBeatGrid(10000,15000,15000,false); + noHeap.store(false,std::memory_order_release); + check(snapped&&plain); + const auto onset=[&](VocalThrow& fx) { + std::array ll{},rr{}; + for(int start=0;start<35000;start+=quantum) { + const int n=std::min(quantum,35000-start); + ll.fill(0.f);rr.fill(0.f); + noHeap.store(true,std::memory_order_release); + fx.processStereo(ll.data(),rr.data(),static_cast(n)); + noHeap.store(false,std::memory_order_release); + for(int k=0;k.0002f)return start+k; + } + } + return -1; + }; + // First graph grid point >= min scheduled echo: frame 32000. + // Cue began at graph frame 15000, so observable wet begins at ~17000. + const int quantized=onset(gridded); + const int fallback=onset(unquantized); + check(quantized>=17000&&quantized<17020); + check(fallback>=11980&&fallback<13500); + check(quantized>fallback+3000); +} int main() { validation(); manualAndDry(8000); @@ -299,5 +350,7 @@ int main() { autoThenManualMustNotDoubleEcho(); denseRepeatsStayBounded(); musicTempoChangesOnlyFutureTail(); + nativeMusicBeatGridQuantization(64); + nativeMusicBeatGridQuantization(128); std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); } From fe188e06a76ef3e1d47e05fc5c8a0975bbd0c833 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:10:01 +0700 Subject: [PATCH 08/32] test(m3): correct manual quarter-note baseline at 120 BPM in 48k PCM fixture --- tests/builtin_vocal_throw_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 909da86c3..ea906d57c 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -314,8 +314,8 @@ static void nativeMusicBeatGridQuantization(int quantum) { check(snapped&&plain); const auto onset=[&](VocalThrow& fx) { std::array ll{},rr{}; - for(int start=0;start<35000;start+=quantum) { - const int n=std::min(quantum,35000-start); + for(int start=0;start<50000;start+=quantum) { + const int n=std::min(quantum,50000-start); ll.fill(0.f);rr.fill(0.f); noHeap.store(true,std::memory_order_release); fx.processStereo(ll.data(),rr.data(),static_cast(n)); @@ -332,8 +332,8 @@ static void nativeMusicBeatGridQuantization(int quantum) { const int quantized=onset(gridded); const int fallback=onset(unquantized); check(quantized>=17000&&quantized<17020); - check(fallback>=11980&&fallback<13500); - check(quantized>fallback+3000); + check(fallback>=23980&&fallback<25000); // manual 120 BPM / quarter + check(quantized+5000 Date: Mon, 9 Nov 2026 04:10:30 +0700 Subject: [PATCH 09/32] test(m3): valid 180 BPM quarter grid anchored to earlier native music onset --- tests/builtin_vocal_throw_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index ea906d57c..30f125715 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -301,9 +301,9 @@ static void nativeMusicBeatGridQuantization(int quantum) { run(unquantized,.65f,.35f,12000,l,r); run(gridded,0.f,0.f,3000,l,r); run(unquantized,0.f,0.f,3000,l,r); - // Both processors have local sample 15000; one backing music onset - // anchor is at global sample 8000 (12000 sample quarter beat). - gridded.setMusicBeatGrid(12000,8000,15000,true); + // Both processors have local sample 15000. Music tempo is 180 BPM + // (16000 sample quarter) with an observed beat at graph frame 100. + gridded.setMusicBeatGrid(16000,100,15000,true); noHeap.store(true,std::memory_order_release); const auto snapped=gridded.throwNow(); const auto plain=unquantized.throwNow(); @@ -327,11 +327,11 @@ static void nativeMusicBeatGridQuantization(int quantum) { } return -1; }; - // First graph grid point >= min scheduled echo: frame 32000. - // Cue began at graph frame 15000, so observable wet begins at ~17000. + // First native music grid point >= intended onset: frame 32100. + // Cue at graph frame 15000 => first wet sample around offset 17100. const int quantized=onset(gridded); const int fallback=onset(unquantized); - check(quantized>=17000&&quantized<17020); + check(quantized>=17100&&quantized<17120); check(fallback>=23980&&fallback<25000); // manual 120 BPM / quarter check(quantized+5000 Date: Mon, 9 Nov 2026 04:10:47 +0700 Subject: [PATCH 10/32] test(m3): timestamp real music onsets and assert one scoped native sample clock --- tests/native_music_tempo_test.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp index 558d61c72..8c3a038ab 100644 --- a/tests/native_music_tempo_test.cpp +++ b/tests/native_music_tempo_test.cpp @@ -36,7 +36,9 @@ static void renderWindow(NativeMusicTempoMonitor& tap,int index,int period, l.fill(level);r.fill(level); // A 10ms bucket is split across 64+36 ASIO callback frames at 10kHz. noHeap.store(true,std::memory_order_release); + (void)tap.beginAudioBlock(epoch,64); tap.capture(ChannelId{301},l.data(),r.data(),64,epoch,revision); + (void)tap.beginAudioBlock(epoch,36); tap.capture(ChannelId{301},l.data()+64,r.data()+64,36,epoch,revision); noHeap.store(false,std::memory_order_release); if(index%8==0)(void)tap.poll(epoch,revision); // host timer, not RT @@ -54,6 +56,8 @@ static void lockTempo(int bpm,bool hats=false) { check(std::abs(state.tempo.bpm-bpm)<=3.1f); check(state.tempo.confidence>=.28f); check(state.tempo.beatAnchorTick>0); + check(state.tempo.beatAnchorFrame>0); + check(state.tempo.observationFrame>state.tempo.beatAnchorFrame); check(state.dropped==0); // One second of no music must NOT produce spurious half/double BPM. for(int n=1100;n<1200;++n)renderWindow(tap,n,6000); @@ -112,10 +116,17 @@ static void actualGraphSourcePcm() { check(graph.setMusicTempoSource(epoch,1,music,10000)); std::array input{},outL{},outR{}; const float* physical[]{input.data()}; - const auto dryFx=[](ChannelId,float*,float*,int) noexcept {}; + int expectedTick=0; + const auto dryFx=[&](ChannelId,float*,float*,int n) noexcept { + const auto current=NativeBeatFrameScope::current(); + check(current.valid && current.epoch==epoch && + current.revision==1 && n==100); + check(current.startFrame==static_cast(expectedTick)*100); + }; for(int tick=0;tick<1000;++tick) { input.fill((tick%50)==0?.65f:0.f); // 120 BPM from real graph noHeap.store(true,std::memory_order_release); + expectedTick=tick; const bool rendered=graph.render(epoch,physical,1, outL.data(),outR.data(),100,false,dryFx); noHeap.store(false,std::memory_order_release); @@ -125,6 +136,10 @@ static void actualGraphSourcePcm() { auto state=graph.pollMusicTempo(epoch,1); check(state.active&&state.source==music); check(state.tempo.locked&&std::abs(state.tempo.bpm-120.f)<=3.f); + check(state.tempo.beatAnchorFrame>0 && + state.tempo.beatAnchorFrame<=100000); + check(state.tempo.observationFrame>=state.tempo.beatAnchorFrame); + check(!NativeBeatFrameScope::current().valid); // callback scope restored // The *same* music ChannelId survives a graph revision with no second // callback or preserved stale PCM pointers. const auto newer=graph.commit(roster,request,1,epoch,epoch,true); From 719be4a82b3961f1590fb67ce618e0518a9098db Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:11:56 +0700 Subject: [PATCH 11/32] feat(m3): independent beat-phase confidence gate, safely retain BPM-only on ambiguity --- engine/core/NativeMusicTempoMonitor.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h index a86c7c049..eb2efb60d 100644 --- a/engine/core/NativeMusicTempoMonitor.h +++ b/engine/core/NativeMusicTempoMonitor.h @@ -17,7 +17,8 @@ namespace armix::mixer { class MusicTempoEstimator final { public: struct Result final { - float bpm=0.f,confidence=0.f; + float bpm=0.f,confidence=0.f,phaseConfidence=0.f; + bool phaseLocked=false; std::uint64_t beatAnchorTick=0,observationTick=0; // Both are authoritative native callback sample-frame positions. // Onset is quantized by the 10ms summary window; not sample-perfect @@ -50,6 +51,7 @@ class MusicTempoEstimator final { if(endingFrame)result_.observationFrame=endingFrame; if(result_.locked && tick>lastHit_+320) { result_.locked=false;result_.confidence=0.f; + result_.phaseLocked=false;result_.phaseConfidence=0.f; candidateBpm_=stableCount_=0; } if(tick>=lastScan_+50) { @@ -130,6 +132,28 @@ class MusicTempoEstimator final { result_.beatAnchorFrame=anchorFrame; result_.observationTick=lastTick_; result_.locked=true; + // A reliable BPM is not enough to claim a stable downbeat phase. + // Quantize only if a majority of transient strength agrees on the + // detected pulse lattice. Secondary off-beat hats lower confidence; + // syncopated mixes safely stay BPM-only (no fabricated grid). + float total=0.f,coherent=0.f; + const float tolerance=std::max(1.6f,period*.075f); + for(std::size_t i=0;i1100)continue; + const float weight=h.strength; + const float elapsed=std::abs(static_cast(h.tick)- + static_cast(anchor)); + const float cycles=std::round(elapsed/period); + const float difference=std::abs(elapsed-cycles*period); + total+=weight; + if(difference0.f? + std::clamp(coherent/total,0.f,1.f):0.f; + result_.phaseLocked=anchorFrame>0 && + result_.phaseConfidence>=.50f; } }; From ff6b30d0e3db2e978654d53e155df859e0f608d8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:12:12 +0700 Subject: [PATCH 12/32] fix(m3): retain detected BPM when phase ambiguous, fail closed on stale native grid --- engine/builtin_fx/VocalThrowProcessor.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index c8d264410..dde1edb89 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -85,10 +85,16 @@ class VocalThrowProcessor final : public juce::AudioProcessor, interval=musicInterval_.load(std::memory_order_relaxed); const auto v1=gridVersion_.load(std::memory_order_acquire); valid=v0==v1 && block.epoch==epoch && - block.revision==revision && interval>0 && anchor>0 && - anchor<=block.startFrame; + block.revision==revision && interval>0; } - core_.setMusicBeatGrid(interval,anchor,block.startFrame,valid); + // Low-confidence music can provide a real BPM while its beat + // position is ambiguous. Keep that useful interval, but do NOT + // claim grid quantization. If the whole transport is stale/torn, + // fall all the way back to accepted Manual/TAP. + if(valid&&anchor>0&&anchor<=block.startFrame) + core_.setMusicBeatGrid(interval,anchor,block.startFrame,true); + else + core_.setMusicIntervalSamples(valid?interval:0); Edit e{}; if(!done_.canPush()||!commands_.pop(e))return; const bool applied=e.kind==CommandKind::settings? From d60a44e7315234fada71b3119aca1bc0516acf52 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:12:28 +0700 Subject: [PATCH 13/32] feat(m3): distinguish reliable Auto BPM from confidence-qualified native beat grid --- src/Main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 27f333d77..ec0fe6aea 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1894,7 +1894,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr reply->setProperty("musicConfidence",lastMusicTempo_.tempo.confidence); reply->setProperty("musicGridAvailable",lastMusicTempo_.active&& lastMusicTempo_.tempo.locked&& - lastMusicTempo_.tempo.beatAnchorFrame>0); + lastMusicTempo_.tempo.phaseLocked); + reply->setProperty("musicPhaseConfidence", + lastMusicTempo_.tempo.phaseConfidence); reply->setProperty("musicBeatAnchorFrame",juce::String( std::to_string(lastMusicTempo_.tempo.beatAnchorFrame))); reply->setProperty("musicDroppedFrames", @@ -2040,11 +2042,14 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // vocal inserts consume a precomputed atomic interval, not a WebView BPM. void serviceNativeMusicTempo() { lastMusicTempo_=engine_.pollNativeMusicTempo(); - const bool locked=lastMusicTempo_.active&& - lastMusicTempo_.tempo.locked&& + const bool bpmLocked=lastMusicTempo_.active&& + lastMusicTempo_.tempo.locked; + const bool phaseLocked=bpmLocked&& + lastMusicTempo_.tempo.phaseLocked&& lastMusicTempo_.tempo.beatAnchorFrame>0; - const float bpm=locked?lastMusicTempo_.tempo.bpm:0.f; - const auto anchor=locked?lastMusicTempo_.tempo.beatAnchorFrame:0; + const float bpm=bpmLocked?lastMusicTempo_.tempo.bpm:0.f; + const std::uint64_t anchor=phaseLocked? + lastMusicTempo_.tempo.beatAnchorFrame:0; const auto epoch=lastMusicTempo_.epoch; const auto revision=lastMusicTempo_.revision; engine_.forEachNativeProcessor([bpm,anchor,epoch,revision]( From 9e710a199ed1cf05f157f3e5efbfdbd5bbe9f224 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:13:00 +0700 Subject: [PATCH 14/32] ui(m3): show distinct confidence-qualified beat-grid vs BPM-only states --- site/preview-v2/assets/mixer-native-vocal-throw.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 46bb46cfe..9a2d96b31 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -87,7 +87,8 @@ function renderMusicStatus(tempo){ if(!tempo.musicLocked){label.textContent="Listening for beat · manual fallback";return;} const confidence=Math.round(Math.max(0,Math.min(1,Number(tempo.musicConfidence)||0))*100); label.textContent="AUTO "+Math.round(Number(tempo.musicBpm))+ - " BPM · "+confidence+"% confidence"; + " BPM · "+(tempo.musicGridAvailable===true?"BEAT GRID":"BPM only")+ + " · "+confidence+"%"; } function syncPower(){ const state=snapshot(),id=current&&window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(current.track); From 6d522e129321b67e7ad1ac74801dfdb99c5e2a7a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:13:16 +0700 Subject: [PATCH 15/32] test(m3-ui): visual BPM-only vs native beat-grid readback in desktop/mobile --- tests/approved_native_vocal_throw_smoke.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index b4a799984..23bd0e2e1 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -32,6 +32,8 @@ def reply_snapshot(page,state,settings,applied=None,count=0,tail=False,music=Non "musicLocked":bool(music), "musicBpm":music["bpm"] if music else 0, "musicConfidence":music["confidence"] if music else 0, + "musicGridAvailable":music["grid"] if music else False, + "musicPhaseConfidence":music["confidence"] if music and music["grid"] else 0, "settings":copy.deepcopy(settings)} if applied:data["appliedRequestId"]=applied emit(page,"arMixBuiltinThrowSnapshot",data) @@ -138,6 +140,14 @@ def main(): count=1 if width==1366 else 0,tail=width==1366, music={"source":RECEIVER,"bpm":120,"confidence":.85}) assert "AUTO 120 BPM" in editor.locator("#vtMusicStatus").inner_text() + assert "BPM only" in editor.locator("#vtMusicStatus").inner_text() + # Confidence-approved grid is a separate native fact; the GUI + # must never fabricate it from BPM alone. + reply_snapshot(page,state, + {**DEFAULTS,"mode":0} if width==1366 else DEFAULTS, + count=1 if width==1366 else 0,tail=width==1366, + music={"source":RECEIVER,"bpm":120,"confidence":.85,"grid":True}) + assert "BEAT GRID" in editor.locator("#vtMusicStatus").inner_text() if width==1366: # The next changed graph invalidates the old editor instance. state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" From e229496a71ebbbce601007d0711ec93ae2bfcd57 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:13:47 +0700 Subject: [PATCH 16/32] test(m3): genuine PCM sample clock survives graph revision; confidence-gated phase lock --- tests/native_music_tempo_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp index 8c3a038ab..70b03814a 100644 --- a/tests/native_music_tempo_test.cpp +++ b/tests/native_music_tempo_test.cpp @@ -55,6 +55,7 @@ static void lockTempo(int bpm,bool hats=false) { check(state.tempo.locked); check(std::abs(state.tempo.bpm-bpm)<=3.1f); check(state.tempo.confidence>=.28f); + check(state.tempo.phaseLocked && state.tempo.phaseConfidence>=.50f); check(state.tempo.beatAnchorTick>0); check(state.tempo.beatAnchorFrame>0); check(state.tempo.observationFrame>state.tempo.beatAnchorFrame); @@ -136,6 +137,7 @@ static void actualGraphSourcePcm() { auto state=graph.pollMusicTempo(epoch,1); check(state.active&&state.source==music); check(state.tempo.locked&&std::abs(state.tempo.bpm-120.f)<=3.f); + check(state.tempo.phaseLocked&&state.tempo.phaseConfidence>=.50f); check(state.tempo.beatAnchorFrame>0 && state.tempo.beatAnchorFrame<=100000); check(state.tempo.observationFrame>=state.tempo.beatAnchorFrame); @@ -147,6 +149,17 @@ static void actualGraphSourcePcm() { state=graph.pollMusicTempo(epoch,2); check(state.active&&state.source==music); check(!graph.pollMusicTempo(epoch,1).active); + const auto newGraphFx=[&](ChannelId,float*,float*,int n) noexcept { + const auto block=NativeBeatFrameScope::current(); + check(block.valid && block.epoch==epoch && + block.revision==2 && block.startFrame==100000 && n==100); + }; + noHeap.store(true,std::memory_order_release); + const bool next=graph.render(epoch,physical,1, + outL.data(),outR.data(),100,false,newGraphFx); + noHeap.store(false,std::memory_order_release); + check(next); + check(!NativeBeatFrameScope::current().valid); graph.unpublish(); graph.pollRetirement(); } From 2dea914db1b37a7c4266297e9ded03767f4f3002 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:15:23 +0700 Subject: [PATCH 17/32] docs(m3): sample-clock musical echo grid, no-RT-work contract and field limits --- ...ARSON_VOCAL_THROW_BEAT_GRID_M3_20261109.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/ARSON_VOCAL_THROW_BEAT_GRID_M3_20261109.md diff --git a/docs/ARSON_VOCAL_THROW_BEAT_GRID_M3_20261109.md b/docs/ARSON_VOCAL_THROW_BEAT_GRID_M3_20261109.md new file mode 100644 index 000000000..6cb0512fb --- /dev/null +++ b/docs/ARSON_VOCAL_THROW_BEAT_GRID_M3_20261109.md @@ -0,0 +1,45 @@ +# ArSon Vocal Throw M3 — native music beat-phase quantized echo + +**Branch:** `feature/arson-vocal-throw-phase-grid-m3-20261109`; builds on draft M2 PR #474 (which builds on M1 PR #469). Product issue #473. **Not a hardware-certified stage release.** + +## What changed + +A stable BPM alone cannot locate the *beat boundary*. M3 shares the existing native ChannelId audio renderer's monotonically increasing callback frame counter with its built-in FX processing, then quantizes **only the newly scheduled echo** when the selected MUSIC ChannelId has a credible beat-phase estimate. + +``` +ONE native ASIO/JUCE ChannelId render (epoch + graph revision) + beginAudioBlock(frames) -> monotonic native sample-frame start + NativeBeatFrameScope (thread-local, callback-only and restored on exit) + pre-FX MUSIC ChannelId -> 10ms nonmutating energy frames + each summary carries its exact observed audio end-frame (within 10ms) + SPSC -> existing control timer -> BPM, onset anchor, phase confidence + CONTROL publishes BPM + sample-frame anchor + epoch/revision to FX + -> atomic version-fenced snapshot (one read attempt per callback) + VOICE FX on SAME callback/thread + -> read versioned tempo + scoped native frame origin + -> if source/epoch/revision invalid: accepted Manual/TAP + -> if BPM stable, beat phase weak: BPM-derived interval, NO grid + -> if BPM and phase credible: snapshot anchor & interval at THROW + -> freeze voice with existing two-tail bounded PCM + -> schedule next echo at FIRST native music grid point >= + intended (phrase end + musical subdivision), with correction + bounded to ONE subdivision and zero change to dry PCM + -> already sounding echo tails retain frozen timing across BPM/graph edits +``` + +### Realtime invariant +No new audio callback, dynamic allocation, model inference, FFT, lock, waiting, JS audio, logging or file I/O from the callback. Channel PCM enters one mixer graph and is never processed twice. The timing scope is a trivially copied thread-local struct, no global audio clock thread. Tempo/phase inference (up to 121 BPM candidates) is CONTROL-only. Packed atomic scalar fields are protected by an even/odd version; the audio callback makes **one** bounded read attempt and immediately falls back on inconsistency. + +### Confidence and fallback +- BPM confidence and beat-phase confidence are independent. A musical onset beat grid is used only if a majority of percussive onset strength agrees on a single pulse lattice. +- Ambiguous rhythmic patterns remain **AUTO BPM · BPM only**, not a speculative grid. A missing source or stale graph becomes **Manual / TAP** without losing the accepted preset. +- A 10ms analysis window means onset time has approximately up to one window of inherent beat-position uncertainty, even though *subsequent scheduling* uses exact callback sample indices. This is not sample-perfect transient detection. +- Phase quantization is measured against **pre-FX** selected music PCM, not against a fully latency-compensated external performance clock. Vendor VST3 latency, off-beat percussion, compressed music, drift, sample-rate changes, ASIO callback reentrancy and sparse backing must still pass field tests. + +### Automated acceptance +- Native DSP unit test verifies an actual frozen phrase's first echo is scheduled on the music frame lattice and remains there after transport disappears, compared with Manual/TAP quarter-note fallback; repeats at 64/128-frame PCM chunks with callback heap forbidden. +- Native graph PCM test stamps the selected music ChannelId from one authoritative callback at variable 64+36 sample chunks, verifies anchored BPM/phase confidence at 72/95/120/160 BPM, one block-clock scope, frame counter continuity after a graph revision, and restoration of callback-only context. +- Desktop/mobile Chromium smoke explicitly distinguishes a native ACKed source's **BPM only** from **BEAT GRID** status. No user-facing opt-in or extra monitor/arm step. + +### Deferred release qualification +Physical ASIO 64/128 frame loops at 44.1/48/96 kHz; on-stage singer/backing leakage, syncopated 4/4 and half/double-time, large FX PDC, dropout/replug, fade/no-click audition, real CPU/xrun vs bypass, and sustained stress still require field evidence. Do not merge while the PR chain and these safety gates remain unresolved. From 07b61622091f1d8e9e3be93061f53dc40f308767 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:18:00 +0700 Subject: [PATCH 18/32] fix(m3-ui-test): tolerate legacy BPM-only native readbacks without grid field --- tests/approved_native_vocal_throw_smoke.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 23bd0e2e1..d84ae98d5 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -32,8 +32,8 @@ def reply_snapshot(page,state,settings,applied=None,count=0,tail=False,music=Non "musicLocked":bool(music), "musicBpm":music["bpm"] if music else 0, "musicConfidence":music["confidence"] if music else 0, - "musicGridAvailable":music["grid"] if music else False, - "musicPhaseConfidence":music["confidence"] if music and music["grid"] else 0, + "musicGridAvailable":music.get("grid",False) if music else False, + "musicPhaseConfidence":music["confidence"] if music and music.get("grid",False) else 0, "settings":copy.deepcopy(settings)} if applied:data["appliedRequestId"]=applied emit(page,"arMixBuiltinThrowSnapshot",data) From 433109ba64919a8f3bddc2c4f619e9d7be88aeca Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:19:33 +0700 Subject: [PATCH 19/32] test(m3-ui): wait for a fresh native snapshot request before phase-lock readback --- tests/approved_native_vocal_throw_smoke.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index d84ae98d5..375d3ca0a 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -141,6 +141,13 @@ def main(): music={"source":RECEIVER,"bpm":120,"confidence":.85}) assert "AUTO 120 BPM" in editor.locator("#vtMusicStatus").inner_text() assert "BPM only" in editor.locator("#vtMusicStatus").inner_text() + # Snapshot transport is request/response, not unsolicited push. + # Wait for a fresh native read request before testing a second + # DSP status update; a replay of the prior request is ignored. + previous=last(page,"nativeThrowSnapshot")["requestId"] + page.wait_for_function( + """old=>window.__actions.filter(x=>x.action==='nativeThrowSnapshot').at(-1)?.requestId!==old""", + arg=previous,timeout=4000) # Confidence-approved grid is a separate native fact; the GUI # must never fabricate it from BPM alone. reply_snapshot(page,state, From 33364fe74c188ca4bb1d9bbe2ca8142aeb36b9fb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:22:47 +0700 Subject: [PATCH 20/32] test(m3): no-heap callback frame epoch reset and nested render-scope restoration --- tests/native_music_tempo_test.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp index 70b03814a..8d378b0f7 100644 --- a/tests/native_music_tempo_test.cpp +++ b/tests/native_music_tempo_test.cpp @@ -163,6 +163,33 @@ static void actualGraphSourcePcm() { graph.unpublish(); graph.pollRetirement(); } +static void callbackClockEpochAndNestedScope() { + using armix::mixer::NativeBeatFrameScope; + NativeMusicTempoMonitor tap; + check(!NativeBeatFrameScope::current().valid); + noHeap.store(true,std::memory_order_release); + check(tap.beginAudioBlock(82,64)==0); + check(tap.beginAudioBlock(82,128)==64); + { + NativeBeatFrameScope outer{82,7,192}; + const auto a=NativeBeatFrameScope::current(); + check(a.valid&&a.epoch==82&&a.revision==7&&a.startFrame==192); + { + NativeBeatFrameScope nested{82,8,320}; + const auto b=NativeBeatFrameScope::current(); + check(b.valid&&b.revision==8&&b.startFrame==320); + } + const auto restored=NativeBeatFrameScope::current(); + check(restored.valid&&restored.revision==7&&restored.startFrame==192); + } + check(!NativeBeatFrameScope::current().valid); + check(tap.beginAudioBlock(82,256)==192); + // Physical device restart must establish a NEW sample origin. This + // prevents a beat from the old ASIO epoch appearing on the new device. + check(tap.beginAudioBlock(83,64)==0); + check(tap.beginAudioBlock(83,128)==64); + noHeap.store(false,std::memory_order_release); +} int main() { lockTempo(72); lockTempo(95); @@ -170,6 +197,7 @@ int main() { lockTempo(160); lockTempo(120,true); failClosed(); + callbackClockEpochAndNestedScope(); actualGraphSourcePcm(); std::puts("PASS: native music-channel BPM 72/95/120/160, silence holdover, stale graph, no RT heap"); } From fe6801a51e22beed5d056fba4628bc01972305af Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:09:04 +0700 Subject: [PATCH 21/32] dsp(tempo): incumbent octave hysteresis and strongest coherent beat-phase lattice --- engine/core/NativeMusicTempoMonitor.h | 96 +++++++++++++++++++-------- 1 file changed, 67 insertions(+), 29 deletions(-) diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h index eb2efb60d..96f7805e6 100644 --- a/engine/core/NativeMusicTempoMonitor.h +++ b/engine/core/NativeMusicTempoMonitor.h @@ -81,6 +81,10 @@ class MusicTempoEstimator final { if(at(count_-1).tick-at(0).tick<300)return; int bestBpm=0; float bestScore=0.f; + // CONTROL-owned fixed stack scratch; no heap or unbounded history. + // Retain the incumbent candidate's score so a transient half/double + // time accent cannot steal an already convincing song clock. + std::array candidates{}; // CONTROL ONLY: bounded 121 candidates x 128 onsets. Emphasize // one-beat matches; harmonics, half- and double-time are penalized. for(int bpm=60;bpm<=180;++bpm) { @@ -103,9 +107,22 @@ class MusicTempoEstimator final { (cycles==1?1.f:cycles==2?1.6f:2.25f); } } + candidates[static_cast(bpm-60)]=score; if(score>bestScore) {bestScore=score;bestBpm=bpm;} } if(bestBpm==0 || bestScore<2.0f)return; + if(result_.locked) { + const int previous=static_cast(std::lround(result_.bpm)); + const bool octave=std::abs(2*previous-bestBpm)<=3 || + std::abs(previous-2*bestBpm)<=3; + if(octave && previous>=60 && previous<=180 && + candidates[static_cast(previous-60)]>= + bestScore*.70f) { + // The rhythmic subdivision is ambiguous. Stay on the song + // BPM until a genuine, repeatedly stronger tempo emerges. + bestBpm=previous; + } + } if(std::abs(bestBpm-candidateBpm_)<=2)++stableCount_; else {candidateBpm_=bestBpm;stableCount_=1;} // A proven lock resists transient alternate half/double-time peaks. @@ -116,44 +133,65 @@ class MusicTempoEstimator final { result_.confidence=std::clamp(bestScore/ static_cast(std::max(7,count_))*.9f,0.f,1.f); if(result_.confidence<.28f)return; - // The strongest recent transient is a practical pulse anchor; - // explicit "beat-phase certified" remains a separate field FAT. - float strength=0.f; + // CONTROL: phase is a separate decision from the BPM estimate. + // Search the bounded onset set for the strongest coherent pulse + // lattice, not simply the most recent loud snare / clap. + const float period=6000.f/result_.bpm; + const float tolerance=std::max(1.6f,period*.075f); + const auto matches=[&](std::uint64_t a,std::uint64_t b) noexcept { + const float elapsed=static_cast(a>b?a-b:b-a); + const float cycles=std::round(elapsed/period); + const float difference=std::abs(elapsed-cycles*period); + return std::max(0.f,1.f-difference/tolerance); + }; + float total=0.f; + for(std::size_t i=0;iperiod*1.8f)continue; - if(h.strength>=strength) { - strength=h.strength;anchor=h.tick;anchorFrame=h.frame; + if(total>0.f)for(std::size_t candidate=0;candidate1100)continue; + float coherence=0.f; + for(std::size_t i=0;ileading+.0001f || + (std::abs(coherence-leading)<=.0001f && + center.tick>anchor)) { + leading=coherence; + anchor=center.tick; + anchorFrame=center.frame; + } + } + // Competing off-beat cohorts mean the quarter-note phase is not + // established, even when interval BPM itself is reliable. + float competing=0.f; + if(anchor)for(std::size_t candidate=0;candidate1100 || + matches(center.tick,anchor)>.15f)continue; + float coherence=0.f; + for(std::size_t i=0;i1100)continue; - const float weight=h.strength; - const float elapsed=std::abs(static_cast(h.tick)- - static_cast(anchor)); - const float cycles=std::round(elapsed/period); - const float difference=std::abs(elapsed-cycles*period); - total+=weight; - if(difference0.f? - std::clamp(coherent/total,0.f,1.f):0.f; + std::clamp(leading/total,0.f,1.f):0.f; result_.phaseLocked=anchorFrame>0 && - result_.phaseConfidence>=.50f; + result_.phaseConfidence>=.52f && + competing Date: Mon, 9 Nov 2026 05:10:32 +0700 Subject: [PATCH 22/32] ui(vocal-throw): precision LCD, native readback status and exact shared EQ/Compressor header buttons --- .../assets/mixer-native-vocal-throw.js | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 9a2d96b31..03eb36da5 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -30,10 +30,10 @@ panel.className="mx-vthrow";panel.id="mxNativeVocalThrow";panel.hidden=true; panel.setAttribute("role","dialog");panel.setAttribute("aria-modal","false"); panel.setAttribute("aria-label","ArSon Vocal Throw"); panel.innerHTML=[ - '
Vocal Throw', + '
ARSONVOCAL THROW', '', - '
', - '
TRIGGER MODE
', + '
', + '
ARSON / PHRASE ENGINEMANUAL CLOCK
120BPM1/4 · HYBRID
TRIGGER MODE
', '
', '
', '
', @@ -55,7 +55,7 @@ for(const [key,[title,unit,step]] of Object.entries(fields)){ } let current=null,accepted=defaults(),draft=defaults(),pending=null, readId="",readSent=0,seq=1,taps=[],windowDrag=null; -let tempoPending=null,musicSource="0"; +let tempoPending=null,musicSource="0",musicReadback=null; const context=()=>{ const state=snapshot(),id=current&&window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(current.track); const fx=state?.graph?.channels?.find(ch=>ch.id===id)?.inserts?.[current?.slot]; @@ -80,25 +80,39 @@ function refreshMusicChannels(){ selector.disabled=!ctx||!native()||Boolean(tempoPending); } function renderMusicStatus(tempo){ - const label=$("vtMusicStatus"); - if(tempoPending){label.textContent="Validating music channel…";return;} - if(musicSource==="0"){label.textContent="Manual BPM / TAP";return;} - if(!tempo?.musicSourceActive){label.textContent="Source stale · manual fallback";return;} - if(!tempo.musicLocked){label.textContent="Listening for beat · manual fallback";return;} - const confidence=Math.round(Math.max(0,Math.min(1,Number(tempo.musicConfidence)||0))*100); - label.textContent="AUTO "+Math.round(Number(tempo.musicBpm))+ - " BPM · "+(tempo.musicGridAvailable===true?"BEAT GRID":"BPM only")+ + if(tempo)musicReadback=tempo; + const label=$("vtMusicStatus"),clock=$("vtClockLabel"); + if(tempoPending){label.textContent="Validating music channel…";clock.textContent="SOURCE CHECK";return;} + if(musicSource==="0"){ + label.textContent="Manual BPM / TAP";clock.textContent="MANUAL CLOCK"; + $("vtDisplayBpm").textContent=String(Math.round(accepted.bpm));return; + } + if(!musicReadback?.musicSourceActive){ + label.textContent="Source stale · manual fallback";clock.textContent="MANUAL CLOCK"; + $("vtDisplayBpm").textContent=String(Math.round(accepted.bpm));return; + } + if(!musicReadback.musicLocked){ + label.textContent="Listening for beat · manual fallback";clock.textContent="LISTENING"; + $("vtDisplayBpm").textContent=String(Math.round(accepted.bpm));return; + } + const confidence=Math.round(Math.max(0,Math.min(1,Number(musicReadback.musicConfidence)||0))*100); + const beatGrid=musicReadback.musicGridAvailable===true; + label.textContent="AUTO "+Math.round(Number(musicReadback.musicBpm))+ + " BPM · "+(beatGrid?"BEAT GRID":"BPM only")+ " · "+confidence+"%"; + clock.textContent=beatGrid?"GRID LOCK":"AUTO BPM"; + $("vtDisplayBpm").textContent=String(Math.round(Number(musicReadback.musicBpm))); } function syncPower(){ const state=snapshot(),id=current&&window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(current.track); const lane=state?.graph?.channels?.find(ch=>ch.id===id),fx=lane?.inserts?.[current?.slot]; const value=!context()?"unknown":lane.fxRackBypassed?"rack-off":fx.bypassed?"off":"on"; - const btn=$("vtPower");btn.dataset.state=value; + const btn=$("vtPower");btn.dataset.fxState=value; btn.disabled=value==="unknown"||value==="rack-off"; btn.title=value==="on"?"Active · click to bypass":value==="off"?"Bypassed · click to enable": value==="rack-off"?"FX rack bypassed":"Native FX unavailable"; btn.setAttribute("aria-pressed",String(value==="on")); + btn.setAttribute("aria-label",btn.title); $("vtThrow").disabled=value!=="on"||!!pending; } function paint(){ @@ -111,6 +125,12 @@ function paint(){ (unit==="%"?Math.round(draft[key]*100):Math.round(draft[key]))+unit; } $("vtPreset").value=Object.entries(presets).find(([,v])=>same(v,draft))?.[0]||"Custom"; + const rhythmic=["1/4","1/8","DOTTED 1/8","1/2"][accepted.division]; + const modes=["MANUAL","AUTO","HYBRID"]; + $("vtRhythm").textContent=rhythmic+" · "+modes[accepted.mode]; + for(const [index,led] of [...$("vtBeatRail").children].entries()) + led.dataset.on=String(indexch.id===id)?.inserts?.[slot]; if(native()&&state?.admitted&&insert?.catalogId===ID&&insert.id){ @@ -247,6 +267,7 @@ backend()?.addEventListener?.("arMixBuiltinThrowSnapshot",reply=>{ } $("vtCount").textContent=String(reply.throwCount||0)+" throws"; $("vtDot").classList.toggle("active",reply.tailActive===true); + $("vtBeatRail").dataset.playing=String(reply.tailActive===true); $("vtStatus").textContent=reply.tailActive?"ECHO TAIL":"NATIVE DSP"; if(pending){ if(!pending.ack||reply.appliedRequestId!==pending.requestId)return; From cbc07f13301f3c0bbf7462a4c172a2e32da9a703 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:11:58 +0700 Subject: [PATCH 23/32] style(vocal-throw): premium calm VST face with native LCD; delegate Close/Power to shared EQ/Comp CSS --- site/preview-v2/assets/mixer-fx-rack.css | 123 +++++++++++++++++++---- 1 file changed, 102 insertions(+), 21 deletions(-) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index a8b968fe9..f1e6baf2b 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -398,26 +398,107 @@ .mx-comp{top:4px;max-height:calc(100dvh - 8px)} } -/* ArSon Vocal Throw shares the single approved FX CSS owner. */ -.mx-vthrow{position:fixed;z-index:15001;left:clamp(10px,12vw,170px);top:clamp(10px,12vh,100px);width:min(410px,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:auto;box-sizing:border-box;background:#16232d;color:#dce8ef;font:12px/1.4 Inter,Arial,sans-serif;border:1px solid #385064;border-radius:10px;box-shadow:0 18px 45px #000b;overflow:hidden} +/* ArSon Vocal Throw: refined compact concert-FX surface. The exact + Close/Power hit boxes, icon glyph and state paint are NOT owned here: + mixer-contextual-buttons.css owns them jointly with EQ and Compressor. */ +.mx-vthrow{position:fixed;z-index:15001;left:clamp(8px,12vw,190px);top:clamp(8px,11vh,100px); + width:min(438px,calc(100vw - 16px));max-height:calc(100dvh - 16px);display:flex;flex-direction:column; + overflow:hidden;box-sizing:border-box;border:1px solid #3d5969;border-radius:8px; + background:linear-gradient(140deg,#1b303d 0%,#11232f 62%,#142734 100%);color:#e2edf3; + box-shadow:inset 0 1px #ffffff18,0 2px 6px #0009,0 20px 58px #030b13d9; + font:400 11px/1.35 Inter,'Segoe UI',sans-serif} .mx-vthrow[hidden]{display:none}.mx-vthrow *{box-sizing:border-box} -.mx-vthrow header{display:flex;gap:7px;align-items:center;padding:8px 10px;background:#20313d;border-bottom:1px solid #354b5b;user-select:none;cursor:move} -.mx-vthrow .brand{font-weight:600;font-size:13px;white-space:nowrap}.mx-vthrow .channel{flex:1;color:#99b2c4;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} -.mx-vthrow select,.mx-vthrow input{background:#101c26;color:#e6f1f9;border:1px solid #41576a;border-radius:5px;font:inherit;min-height:26px;max-width:100%} -.mx-vthrow select{padding:3px 5px;cursor:pointer}.mx-vthrow button{background:#2a3c49;color:#dcebf3;border:1px solid #456072;border-radius:5px;font:inherit;cursor:pointer;min-height:27px} -.mx-vthrow button:hover{background:#37576a}.mx-vthrow button:disabled{opacity:.5;cursor:default}.mx-vthrow .power{min-width:26px;font-size:15px} -.mx-vthrow .power[data-state=on]{color:#99f5bd;background:#23503d}.mx-vthrow .power[data-state=off]{color:#f5a4a4;background:#593238} -.mx-vthrow .close{font-size:18px;border:0;border-radius:5px;min-width:26px;background:transparent}.mx-vthrow .close:hover{background:#b8333f;color:#fff} -.mx-vthrow .body{padding:11px;display:grid;gap:10px}.mx-vthrow .row{display:flex;align-items:center;justify-content:space-between;gap:9px} -.mx-vthrow .topline{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}.mx-vthrow .field{display:grid;gap:4px;min-width:0} -.mx-vthrow label,.mx-vthrow .label{color:#9fb6c5;font-size:10px;letter-spacing:.035em}.mx-vthrow .field input{width:100%;padding:4px 7px} -.mx-vthrow .music-source{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px 9px;align-items:center;border-top:1px solid #344957;padding-top:7px} +.mx-vthrow header{display:flex;flex:0 0 38px;align-items:center;gap:8px;min-width:0;padding:0 8px 0 13px; + background:linear-gradient(180deg,#2b414e,#1c303e);border-bottom:1px solid #4a6574; + cursor:move;touch-action:none;user-select:none;box-shadow:inset 0 1px #ffffff16} +.mx-vthrow .brand{display:inline-flex;align-items:baseline;gap:7px;flex:0 0 auto;white-space:nowrap} +.mx-vthrow .brand-mark{font-size:9px;font-weight:670;letter-spacing:.12em;color:#6dd3d9} +.mx-vthrow .brand-name{font-size:11px;font-weight:570;letter-spacing:.032em;color:#f0f6fa} +.mx-vthrow .channel{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8fb0c0;font-size:10px} +.mx-vthrow select,.mx-vthrow input{min-height:26px;max-width:100%;border:1px solid #476172;border-radius:4px; + background:linear-gradient(#152a37,#10232f);color:#ecf6f9;font:inherit;outline:none} +.mx-vthrow select{padding:2px 5px;cursor:pointer} +.mx-vthrow input[type=number]{width:100%;padding:4px 7px;text-align:left;font-variant-numeric:tabular-nums} +.mx-vthrow :is(select,input,button,summary):focus-visible{outline:2px solid #8bdde6;outline-offset:2px} +.mx-vthrow #vtPreset{width:103px;min-width:0;max-width:103px;flex:0 1 103px;margin-left:auto;font-size:10px; + background:linear-gradient(#2d4653,#213b4a)} +.mx-vthrow option{color:#e9f4f7;background:#1c3341} +.mx-vthrow .body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px 13px 11px; + display:grid;gap:9px;scrollbar-color:#3e5a67 #162835;scrollbar-width:thin} +.mx-vthrow .lcd{position:relative;min-width:0;display:grid;gap:5px;padding:10px 13px 8px;border:1px solid #355969; + border-radius:5px;background:radial-gradient(ellipse 80% 60% at 50% 0%,#1b475477,transparent), + linear-gradient(165deg,#0b1d27,#0a202c 55%,#0d2632); + box-shadow:inset 0 1px 8px #0009,inset 0 -1px #41667456,0 1px #ffffff0d;overflow:hidden} +.mx-vthrow .lcd::before{content:"";pointer-events:none;position:absolute;inset:0 0 auto;height:1px; + background:linear-gradient(90deg,transparent,#7ab5c455,transparent)} +.mx-vthrow .lcd-top{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0; + color:#6994a8;font-size:9px;letter-spacing:.095em} +.mx-vthrow #vtClockLabel{color:#7dcbcc;white-space:nowrap;font-size:9px;font-weight:580} +.mx-vthrow .lcd-numbers{display:flex;align-items:baseline;gap:8px;min-height:45px} +.mx-vthrow #vtDisplayBpm{color:#d9fff1;font:500 36px/1.1 'Segoe UI',Inter,sans-serif; + font-variant-numeric:tabular-nums;letter-spacing:-.045em;text-shadow:0 0 18px #66e7ce2b} +.mx-vthrow .lcd-unit{color:#84b6bd;font-size:10px;letter-spacing:.13em} +.mx-vthrow .lcd-division{margin-left:auto;color:#c1dce7;font-size:10px;letter-spacing:.05em;white-space:nowrap} +.mx-vthrow .lcd-beats{height:9px;display:flex;align-items:center;gap:5px;justify-content:flex-end; + padding-top:6px;border-top:1px solid #37526177} +.mx-vthrow .lcd-beats i{height:3px;width:21px;display:block;border-radius:2px;background:#2e4a56; + box-shadow:inset 0 1px #ffffff08} +.mx-vthrow .lcd-beats i[data-on="true"]{background:linear-gradient(90deg,#3e8c94,#6cc8c7)} +.mx-vthrow .lcd-beats[data-playing=true] i[data-on="true"]{background:linear-gradient(90deg,#5baaa2,#b1eac5)} +.mx-vthrow .row{display:flex;justify-content:space-between;align-items:center;gap:10px;min-width:0} +.mx-vthrow .row #vtMode{width:160px;background:linear-gradient(#273e4c,#182d39);font-size:11px} +.mx-vthrow .topline{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px} +.mx-vthrow .field{display:grid;gap:4px;min-width:0} +.mx-vthrow :is(label,.label){font-size:9px;letter-spacing:.075em;color:#8aafc1;font-weight:530} +.mx-vthrow .field input,.mx-vthrow .field select{height:29px;font-size:12px} +.mx-vthrow .music-source{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr); + column-gap:11px;row-gap:5px;align-items:center;padding:9px 0 2px;border-top:1px solid #324c5b} .mx-vthrow .music-source label{grid-column:1/-1} -.mx-vthrow .music-source select{min-width:0;width:100%;font-size:11px} -.mx-vthrow .music-status{font-size:10px;color:#91b6c4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} -.mx-vthrow .manual{display:grid;grid-template-columns:1fr 80px;gap:9px}.mx-vthrow .throw{background:#277d9b;font-size:13px;font-weight:600;min-height:46px;letter-spacing:.07em}.mx-vthrow .throw:hover{background:#2b9ebf}.mx-vthrow .tap{min-height:46px} -.mx-vthrow .hint{color:#8fb1c2;min-height:15px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mx-vthrow .detail{border-top:1px solid #334b5b;padding-top:8px} -.mx-vthrow details>summary{cursor:pointer;color:#bad1df;padding-bottom:7px;font-size:11px}.mx-vthrow .ranges{display:grid;grid-template-columns:1fr 1fr;gap:8px 13px} -.mx-vthrow .range{display:grid;grid-template-columns:1fr auto;gap:3px}.mx-vthrow .range input{grid-column:1/-1;width:100%;height:15px;accent-color:#56bada} -.mx-vthrow output{font-variant-numeric:tabular-nums;font-size:11px}.mx-vthrow .status{display:flex;justify-content:space-between;font-size:10px;color:#89a6b8}.mx-vthrow .dot{display:inline-block;border-radius:50%;width:6px;height:6px;background:#7892a3;margin-right:5px}.mx-vthrow .dot.active{background:#55ddac} -@media(max-width:480px){.mx-vthrow{left:10px;top:10px}} +.mx-vthrow .music-source select{width:100%;min-width:0} +.mx-vthrow .music-status{min-width:0;color:#8fc7d1;font-size:10px;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums} +.mx-vthrow button:not(#vtPower):not(#vtClose){font:inherit;cursor:pointer;color:#dceef3; + border:1px solid #4a6977;border-radius:4px;background:linear-gradient(#2c4654,#203b49); + box-shadow:inset 0 1px #ffffff17,0 1px 2px #06121a60} +.mx-vthrow button:not(#vtPower):not(#vtClose):hover:not(:disabled){border-color:#6794a4; + background:linear-gradient(#365c6c,#2a4c5c)} +.mx-vthrow button:disabled{opacity:.52;cursor:not-allowed} +.mx-vthrow .manual{display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:8px} +.mx-vthrow button.throw{min-height:44px;font-size:13px!important;font-weight:650!important; + letter-spacing:.15em;color:#eaffff!important;border-color:#3d8b95!important; + background:linear-gradient(180deg,#20849a,#16677d 72%,#11556a)!important; + box-shadow:inset 0 1px #9de7ef49,0 2px 5px #00131e9c!important} +.mx-vthrow button.throw:hover:not(:disabled){background:linear-gradient(#299db1,#1c8298)!important} +.mx-vthrow button.throw:active:not(:disabled){background:linear-gradient(#155e70,#1d7c8d)!important; + box-shadow:inset 0 2px 5px #081c29!important} +.mx-vthrow button.tap{min-height:44px;letter-spacing:.035em} +.mx-vthrow .hint{min-height:14px;color:#8eaebb;font-size:10px;white-space:nowrap; + overflow:hidden;text-overflow:ellipsis} +.mx-vthrow .detail{padding:7px 0 0;border-top:1px solid #2e4755} +.mx-vthrow details>summary{padding:2px 0 7px;cursor:pointer;color:#b5d5df;font-size:10px} +.mx-vthrow .ranges{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 15px;padding:3px 0 5px} +.mx-vthrow .range{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;align-items:center} +.mx-vthrow .range input{grid-column:1/-1;width:100%;height:14px;accent-color:#6cc5d0;cursor:pointer} +.mx-vthrow .range output{color:#d8e9ef;font-size:10px;font-variant-numeric:tabular-nums} +.mx-vthrow .status{display:flex;justify-content:space-between;gap:10px;padding-top:8px; + border-top:1px solid #2d4855;color:#84a8b7;font-size:9px;letter-spacing:.045em} +.mx-vthrow .dot{display:inline-block;width:6px;height:6px;margin-right:5px;border-radius:50%; + background:#627f8f;box-shadow:0 0 0 1px #142c39} +.mx-vthrow .dot.active{background:#71d6b6;box-shadow:0 0 5px #71d6b677} +@media(max-width:480px){ + .mx-vthrow{top:6px;left:6px;width:calc(100vw - 12px);max-height:calc(100dvh - 12px)} + .mx-vthrow header{gap:5px;padding:0 6px 0 8px} + .mx-vthrow .brand{gap:4px}.mx-vthrow .brand-mark{font-size:8px} + .mx-vthrow .brand-name{font-size:10px}.mx-vthrow .channel{font-size:9px} + .mx-vthrow #vtPreset{width:88px;flex-basis:88px} + .mx-vthrow .body{padding:9px;gap:8px} + .mx-vthrow .lcd{padding:8px 10px} + .mx-vthrow #vtDisplayBpm{font-size:30px} +} +@media(max-width:350px){.mx-vthrow .channel{display:none}.mx-vthrow #vtPreset{flex-basis:78px;width:78px}} +@media(max-height:570px){ + .mx-vthrow{top:4px;max-height:calc(100dvh - 8px)} + .mx-vthrow .body{padding-top:6px;gap:6px} + .mx-vthrow .lcd{padding:6px 9px} + .mx-vthrow #vtDisplayBpm{font-size:27px} +} From d85a520ab5feb86d1a0cb6a426d9f9007bb94053 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:12:53 +0700 Subject: [PATCH 24/32] test(vocal-throw): exact shared EQ/Compressor 24/26px Power/Close and premium LCD responsive FAT --- tests/approved_native_vocal_throw_smoke.py | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 375d3ca0a..b272e9864 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -90,8 +90,18 @@ def main(): editor=page.locator("#mxNativeVocalThrow") editor.wait_for(state="visible") assert editor.locator("#vtPreset").count()==1 - assert editor.locator("#vtClose.armix-floating-close").count()==1 - assert editor.locator("#vtPower").get_attribute("data-state")=="on" + assert editor.locator("#vtClose.mx-comp-close.armix-floating-close").count()==1 + assert editor.locator("#vtPower.mx-comp-power").count()==1 + assert editor.locator("#vtPower").get_attribute("data-fx-state")=="on" + assert editor.locator("#vtPower").get_attribute("aria-pressed")=="true" + # EQ and Compressor have ONE CSS owner for 24px Close and 26px + # Power hit boxes, the same as Vocal Throw (no local overrides). + close_box=editor.locator("#vtClose").bounding_box() + power_box=editor.locator("#vtPower").bounding_box() + assert close_box and power_box + assert abs(close_box["width"]-24)<.1 and abs(close_box["height"]-24)<.1 + assert abs(power_box["width"]-26)<.1 and abs(power_box["height"]-24)<.1 + assert power_box["x"]+power_box["width"]<=close_box["x"]+1 assert editor.locator("#vtMode").input_value()=="2" initial=last(page,"nativeThrowSnapshot") page.wait_for_timeout(300) @@ -101,10 +111,13 @@ def main(): assert editor.locator("#vtStatus").inner_text()=="NATIVE DSP" assert editor.locator("#vtCount").inner_text()=="0 throws" box=editor.bounding_box() - assert box and box["width"]<=410 and box["width"]<=width and \ + assert box and box["width"]<=438 and box["width"]<=width and \ box["x"]>=0 and box["x"]+box["width"]<=width+1,(width,box) assert editor.evaluate("(el)=>el.scrollWidth<=el.clientWidth+1"),\ - "compact FX window overflows horizontal viewport" + "premium FX editor overflows horizontal viewport" + assert editor.locator("#vtDisplayBpm").inner_text()=="120" + assert editor.locator("#vtClockLabel").inner_text()=="MANUAL CLOCK" + assert editor.locator("#vtBeatRail i[data-on='true']").count()==3 page.screenshot(path="arsonmix-vocal-throw-"+str(width)+".png") editor.screenshot(path="arsonmix-vocal-throw-editor-"+str(width)+".png") if width==1366: @@ -141,6 +154,7 @@ def main(): music={"source":RECEIVER,"bpm":120,"confidence":.85}) assert "AUTO 120 BPM" in editor.locator("#vtMusicStatus").inner_text() assert "BPM only" in editor.locator("#vtMusicStatus").inner_text() + assert editor.locator("#vtClockLabel").inner_text()=="AUTO BPM" # Snapshot transport is request/response, not unsolicited push. # Wait for a fresh native read request before testing a second # DSP status update; a replay of the prior request is ignored. @@ -155,6 +169,7 @@ def main(): count=1 if width==1366 else 0,tail=width==1366, music={"source":RECEIVER,"bpm":120,"confidence":.85,"grid":True}) assert "BEAT GRID" in editor.locator("#vtMusicStatus").inner_text() + assert editor.locator("#vtClockLabel").inner_text()=="GRID LOCK" if width==1366: # The next changed graph invalidates the old editor instance. state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" From 80fcc4e60b489044b4297fab25e5d269f2fe4099 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:13:54 +0700 Subject: [PATCH 25/32] dsp(tempo): conservative beat-grid lock under competing offbeat accents --- engine/core/NativeMusicTempoMonitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h index 96f7805e6..9d3a84cd8 100644 --- a/engine/core/NativeMusicTempoMonitor.h +++ b/engine/core/NativeMusicTempoMonitor.h @@ -191,7 +191,7 @@ class MusicTempoEstimator final { std::clamp(leading/total,0.f,1.f):0.f; result_.phaseLocked=anchorFrame>0 && result_.phaseConfidence>=.52f && - competing Date: Mon, 9 Nov 2026 05:14:19 +0700 Subject: [PATCH 26/32] test(tempo): strong offbeats never certify ambiguous phase; sustained pads cannot acquire BPM --- tests/native_music_tempo_test.cpp | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp index 8d378b0f7..f088d4510 100644 --- a/tests/native_music_tempo_test.cpp +++ b/tests/native_music_tempo_test.cpp @@ -69,6 +69,57 @@ static void lockTempo(int bpm,bool hats=false) { state=tap.poll(7,13); check(!state.tempo.locked); } +// A full backing groove can carry snare/hi-hat accents on the eighth-note +// offbeat. Its BPM may be correct while a quarter-note phase is ambiguous. +static void harmonicAndPhaseAmbiguity() { + NativeMusicTempoMonitor tap; + check(tap.select(ChannelId{301},7,13,10000)); + const auto groove=[&](int index,float offbeat) { + std::array left{},right{}; + const int p=index%50; // quarter note at 120 BPM + const float value=p==0?.78f:p==25?offbeat:0.f; + left.fill(value);right.fill(value); + noHeap.store(true,std::memory_order_release); + (void)tap.beginAudioBlock(7,64); + tap.capture(ChannelId{301},left.data(),right.data(),64,7,13); + (void)tap.beginAudioBlock(7,36); + tap.capture(ChannelId{301},left.data()+64,right.data()+64,36,7,13); + noHeap.store(false,std::memory_order_release); + if(index%8==0)(void)tap.poll(7,13); + }; + for(int i=0;i<1150;++i)groove(i,.035f); + auto baseline=tap.poll(7,13); + check(baseline.tempo.locked && std::abs(baseline.tempo.bpm-120.f)<=3.f); + check(baseline.tempo.phaseLocked); + // For 11s, the equal-strength offbeat pulse could be mistaken for a + // new beat lattice; do not switch to 60 BPM, or claim a phase lock. + for(int i=1150;i<2450;++i)groove(i,.78f); + auto ambiguous=tap.poll(7,13); + check(ambiguous.tempo.locked); + check(std::abs(ambiguous.tempo.bpm-120.f)<=3.f); + check(!ambiguous.tempo.phaseLocked); + // The music clears; the true quarter-note lattice should recover. + for(int i=2450;i<3650;++i)groove(i,.035f); + auto recovered=tap.poll(7,13); + check(recovered.tempo.locked); + check(std::abs(recovered.tempo.bpm-120.f)<=3.f); + check(recovered.tempo.phaseLocked); + check(recovered.dropped==0); +} +static void steadyPadIsNotAClock() { + NativeMusicTempoMonitor tap; + check(tap.select(ChannelId{301},7,13,10000)); + std::array pcm{};pcm.fill(.22f); + for(int index=0;index<1200;++index) { + noHeap.store(true); + (void)tap.beginAudioBlock(7,100); + tap.capture(ChannelId{301},pcm.data(),pcm.data(),100,7,13); + noHeap.store(false); + if(index%8==0)(void)tap.poll(7,13); + } + const auto state=tap.poll(7,13); + check(!state.tempo.locked); +} static void failClosed() { NativeMusicTempoMonitor tap; check(tap.select(ChannelId{301},7,13,48000)); @@ -196,6 +247,8 @@ int main() { lockTempo(120); lockTempo(160); lockTempo(120,true); + harmonicAndPhaseAmbiguity(); + steadyPadIsNotAClock(); failClosed(); callbackClockEpochAndNestedScope(); actualGraphSourcePcm(); From fd33e36a45889898e40f6e01d1c45e2717a9c0c7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:15:12 +0700 Subject: [PATCH 27/32] ui(fx): common semantic Power/Close chrome across EQ, Compressor and Vocal Throw --- site/preview-v2/assets/mixer-native-peq.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/preview-v2/assets/mixer-native-peq.js b/site/preview-v2/assets/mixer-native-peq.js index e0b2e990e..270ec25b0 100644 --- a/site/preview-v2/assets/mixer-native-peq.js +++ b/site/preview-v2/assets/mixer-native-peq.js @@ -76,7 +76,8 @@ close.innerHTML=' Date: Mon, 9 Nov 2026 05:15:15 +0700 Subject: [PATCH 28/32] ui(fx): common semantic Power/Close chrome across EQ, Compressor and Vocal Throw --- site/preview-v2/assets/mixer-native-compressor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/site/preview-v2/assets/mixer-native-compressor.js b/site/preview-v2/assets/mixer-native-compressor.js index 979adfe56..621a8cfa0 100644 --- a/site/preview-v2/assets/mixer-native-compressor.js +++ b/site/preview-v2/assets/mixer-native-compressor.js @@ -60,6 +60,7 @@ power.title="FX STATE UNAVAILABLE";power.dataset.fxState="unknown"; power.disabled=true;power.setAttribute("aria-pressed","false"); power.setAttribute("aria-label","Compressor state unavailable"); close.setAttribute("aria-label","Close Compressor"); +power.classList.add("armix-builtin-fx-power");close.classList.add("armix-builtin-fx-close"); header.append(brand,channel,presetSelect,stateDot,power,close); const controls=dom("div","mx-comp-controls"); const left=dom("div","mx-comp-left"); From 86bc2eb47665cfc4dd5fe0f0925b96526095239a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:15:18 +0700 Subject: [PATCH 29/32] ui(fx): common semantic Power/Close chrome across EQ, Compressor and Vocal Throw --- site/preview-v2/assets/mixer-native-vocal-throw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 03eb36da5..5d66f9089 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -32,7 +32,7 @@ panel.setAttribute("aria-label","ArSon Vocal Throw"); panel.innerHTML=[ '
ARSONVOCAL THROW', '', - '', + '', '
ARSON / PHRASE ENGINEMANUAL CLOCK
120BPM1/4 · HYBRID
TRIGGER MODE
', '
', '
', From b920a3c8d66ebfabc7665a16ba07a8ba72eceae7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:15:23 +0700 Subject: [PATCH 30/32] ui(fx): common semantic Power/Close chrome across EQ, Compressor and Vocal Throw --- site/preview-v2/assets/mixer-native-vocal-throw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 5d66f9089..93ec25c91 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -32,7 +32,7 @@ panel.setAttribute("aria-label","ArSon Vocal Throw"); panel.innerHTML=[ '
ARSONVOCAL THROW', '', - '
', + '', '
ARSON / PHRASE ENGINEMANUAL CLOCK
120BPM1/4 · HYBRID
TRIGGER MODE
', '
', '
', From 6b48071ee2130cab271c225f132e21470476d8aa Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:15:41 +0700 Subject: [PATCH 31/32] style(fx): one shared 24px Close / 26px Power chrome for all native built-in VST editors --- .../assets/mixer-contextual-buttons.css | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/site/preview-v2/assets/mixer-contextual-buttons.css b/site/preview-v2/assets/mixer-contextual-buttons.css index e7e4558e4..eb0e5bf6f 100644 --- a/site/preview-v2/assets/mixer-contextual-buttons.css +++ b/site/preview-v2/assets/mixer-contextual-buttons.css @@ -197,19 +197,21 @@ } /* Single authoritative modal Close + built-in FX Power chrome. + The semantic .armix-builtin-fx-power / -close classes are mandatory on + every built-in editor, while legacy EQ/Compressor names remain compatible. All cards: same 24px hit box, same icon, same pressed-red interaction. Green ON, muted red insert bypass, amber rack bypass, grey unavailable. FX state is assigned exclusively from accepted DSP graph readback. */ -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close){display:inline-flex!important;align-items:center!important;justify-content:center!important;position:relative!important;box-sizing:border-box!important;flex:0 0 24px!important;width:24px!important;min-width:24px!important;max-width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;padding:0!important;margin:0!important;font-size:0!important;line-height:1!important;color:#e0edf2!important;cursor:pointer!important;border:1px solid #607d8c!important;border-radius:4px!important;background:linear-gradient(#3e5866,#293e4b)!important;box-shadow:inset 0 1px #ffffff22,0 1px 2px #06131f75!important;transform:none!important;text-shadow:none!important;transition:background-color .10s,border-color .10s,color .10s!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close) svg{display:none!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close)::before{content:none!important;display:none!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close)::after,:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close):active::after{content:""!important;display:block!important;position:relative!important;flex:0 0 12px!important;inset:auto!important;width:12px!important;height:12px!important;opacity:1!important;border:0!important;border-radius:0!important;transform:none!important;box-shadow:none!important;pointer-events:none!important;background:linear-gradient(45deg,transparent 43%,currentColor 43% 57%,transparent 57%),linear-gradient(-45deg,transparent 43%,currentColor 43% 57%,transparent 57%)!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close):hover:not(:disabled){color:#fff!important;border-color:#b27078!important;background:linear-gradient(#64424f,#4d343f)!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close):active:not(:disabled){color:#fff!important;border-color:#ee8b93!important;background:linear-gradient(#cc4753,#982a36)!important;box-shadow:inset 0 2px 4px #4c0c1790,0 0 0 1px #ef698069!important;transition:none!important} -:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close):focus-visible{outline:2px solid #a2dce9!important;outline-offset:2px!important} -body :is(.mx-peq-global,.mx-comp-power){display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;flex:0 0 26px!important;width:26px!important;height:24px!important;opacity:1!important;padding:0!important;border:1px solid #4b6572!important;border-radius:4px!important;background:linear-gradient(#384b56,#243846)!important;box-shadow:inset 0 1px #ffffff20!important;font-size:18px!important;transition:none!important} -body :is(.mx-peq-global,.mx-comp-power)[data-fx-state="on"]{color:#76f0b9!important;border-color:#428969!important;background:linear-gradient(#335c51,#204539)!important;text-shadow:0 0 5px #7df0b85c!important} -body :is(.mx-peq-global,.mx-comp-power)[data-fx-state="off"]{color:#e99b9f!important;border-color:#83525a!important;background:linear-gradient(#533b42,#3a3039)!important;text-shadow:none!important} -body :is(.mx-peq-global,.mx-comp-power)[data-fx-state="rack-off"]{color:#f0c483!important;border-color:#846948!important;background:linear-gradient(#544737,#41382d)!important;text-shadow:none!important;cursor:not-allowed!important} -body :is(.mx-peq-global,.mx-comp-power)[data-fx-state="unknown"]{color:#8498a4!important;border-color:#4b5d66!important;background:linear-gradient(#3a4751,#2b3941)!important;text-shadow:none!important;cursor:not-allowed!important} -body :is(.mx-peq-global,.mx-comp-power):focus-visible{outline:2px solid #9cdbe7!important;outline-offset:2px!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close){display:inline-flex!important;align-items:center!important;justify-content:center!important;position:relative!important;box-sizing:border-box!important;flex:0 0 24px!important;width:24px!important;min-width:24px!important;max-width:24px!important;height:24px!important;min-height:24px!important;max-height:24px!important;padding:0!important;margin:0!important;font-size:0!important;line-height:1!important;color:#e0edf2!important;cursor:pointer!important;border:1px solid #607d8c!important;border-radius:4px!important;background:linear-gradient(#3e5866,#293e4b)!important;box-shadow:inset 0 1px #ffffff22,0 1px 2px #06131f75!important;transform:none!important;text-shadow:none!important;transition:background-color .10s,border-color .10s,color .10s!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close) svg{display:none!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close)::before{content:none!important;display:none!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close)::after,:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close):active::after{content:""!important;display:block!important;position:relative!important;flex:0 0 12px!important;inset:auto!important;width:12px!important;height:12px!important;opacity:1!important;border:0!important;border-radius:0!important;transform:none!important;box-shadow:none!important;pointer-events:none!important;background:linear-gradient(45deg,transparent 43%,currentColor 43% 57%,transparent 57%),linear-gradient(-45deg,transparent 43%,currentColor 43% 57%,transparent 57%)!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close):hover:not(:disabled){color:#fff!important;border-color:#b27078!important;background:linear-gradient(#64424f,#4d343f)!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close):active:not(:disabled){color:#fff!important;border-color:#ee8b93!important;background:linear-gradient(#cc4753,#982a36)!important;box-shadow:inset 0 2px 4px #4c0c1790,0 0 0 1px #ef698069!important;transition:none!important} +:is(.app,body) :is(#identityClose,#pluginClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose,.armix-floating-close,.mx-peq-close,.mx-comp-close,.armix-builtin-fx-close):focus-visible{outline:2px solid #a2dce9!important;outline-offset:2px!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power){display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;flex:0 0 26px!important;width:26px!important;height:24px!important;opacity:1!important;padding:0!important;border:1px solid #4b6572!important;border-radius:4px!important;background:linear-gradient(#384b56,#243846)!important;box-shadow:inset 0 1px #ffffff20!important;font-size:18px!important;transition:none!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power)[data-fx-state="on"]{color:#76f0b9!important;border-color:#428969!important;background:linear-gradient(#335c51,#204539)!important;text-shadow:0 0 5px #7df0b85c!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power)[data-fx-state="off"]{color:#e99b9f!important;border-color:#83525a!important;background:linear-gradient(#533b42,#3a3039)!important;text-shadow:none!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power)[data-fx-state="rack-off"]{color:#f0c483!important;border-color:#846948!important;background:linear-gradient(#544737,#41382d)!important;text-shadow:none!important;cursor:not-allowed!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power)[data-fx-state="unknown"]{color:#8498a4!important;border-color:#4b5d66!important;background:linear-gradient(#3a4751,#2b3941)!important;text-shadow:none!important;cursor:not-allowed!important} +body :is(.mx-peq-global,.mx-comp-power,.armix-builtin-fx-power):focus-visible{outline:2px solid #9cdbe7!important;outline-offset:2px!important} From 8dbf6d575cd8e37de5a5249743bdc86902bc1960 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 05:15:59 +0700 Subject: [PATCH 32/32] test(fx): shared Power and Close class contract across EQ Compressor and Vocal Throw --- tests/approved_native_vocal_throw_smoke.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index b272e9864..4d760efc9 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -91,7 +91,12 @@ def main(): editor.wait_for(state="visible") assert editor.locator("#vtPreset").count()==1 assert editor.locator("#vtClose.mx-comp-close.armix-floating-close").count()==1 - assert editor.locator("#vtPower.mx-comp-power").count()==1 + assert editor.locator("#vtPower.mx-comp-power.armix-builtin-fx-power").count()==1 + assert editor.locator("#vtClose.armix-builtin-fx-close").count()==1 + assert page.locator("#mxNativePeq .armix-builtin-fx-power").count()==1 + assert page.locator("#mxNativePeq .armix-builtin-fx-close").count()==1 + assert page.locator("#mxNativeComp .armix-builtin-fx-power").count()==1 + assert page.locator("#mxNativeComp .armix-builtin-fx-close").count()==1 assert editor.locator("#vtPower").get_attribute("data-fx-state")=="on" assert editor.locator("#vtPower").get_attribute("aria-pressed")=="true" # EQ and Compressor have ONE CSS owner for 24px Close and 26px