From e74b622da7a759ecda62b42ae11856109628cc1c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:04:53 +0700 Subject: [PATCH 001/124] feat(vocal-throw): implement bounded zero-added-latency phrase capture and rhythmic echo DSP --- engine/builtin_fx/VocalThrow.h | 226 +++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 engine/builtin_fx/VocalThrow.h diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h new file mode 100644 index 000000000..1ca18fbfa --- /dev/null +++ b/engine/builtin_fx/VocalThrow.h @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include +#include +#include +#include + +// ArSon Vocal Throw. One audio-thread owner; preparation allocates on CONTROL. +// The microphone's dry PCM is never buffered or delayed. A rolling history +// freezes the last word/phrase for tempo-spaced stereo echoes. All samples and +// triggers run on the existing native ChannelId PCM callback, never WebView. +namespace armix::builtin_fx { +struct VocalThrowSettings final { + int mode=2; // 0 manual, 1 automatic, 2 hybrid + float bpm=120.f; // explicit/host or tap BPM (not claimed auto-detected) + int division=0; // 0 quarter, 1 eighth, 2 dotted eighth, 3 half + int repeats=3; + float captureMs=460.f; + float silenceMs=220.f; + float thresholdDb=-35.f; + float wet=.42f; + float decay=.55f; // successive repeat amplitude multiplier + float ducking=.7f; // suppress echo while lead vocalist is active +}; +class VocalThrow final { +public: + static constexpr int addedLatencySamples=0; + static constexpr int maxRepeats=6; + static constexpr float maxCaptureMs=1500.f; + struct PreparedEdit { + VocalThrowSettings settings{}; + double sampleRate=0.; + std::uint32_t intervalSamples=0, captureSamples=0, silenceSamples=0; + float gateLinear=0.f; + bool valid=false; + }; + static bool validSettings(const VocalThrowSettings& s) noexcept { + return s.mode>=0&&s.mode<=2&&s.division>=0&&s.division<=3&& + s.repeats>=1&&s.repeats<=maxRepeats&& + std::isfinite(s.bpm)&&s.bpm>=60.f&&s.bpm<=200.f&& + std::isfinite(s.captureMs)&&s.captureMs>=80.f&&s.captureMs<=maxCaptureMs&& + std::isfinite(s.silenceMs)&&s.silenceMs>=80.f&&s.silenceMs<=900.f&& + std::isfinite(s.thresholdDb)&&s.thresholdDb>=-65.f&&s.thresholdDb<=-15.f&& + std::isfinite(s.wet)&&s.wet>=0.f&&s.wet<=1.f&& + std::isfinite(s.decay)&&s.decay>=.15f&&s.decay<=.9f&& + std::isfinite(s.ducking)&&s.ducking>=0.f&&s.ducking<=1.f; + } + static bool prepareEdit(const VocalThrowSettings& s,double sampleRate,PreparedEdit& out) noexcept { + if(!validSettings(s)||!std::isfinite(sampleRate)|| + sampleRate<8000.||sampleRate>192000.)return false; + constexpr std::array beats{{1.,.5,.75,2.}}; + PreparedEdit next{}; + next.settings=s;next.sampleRate=sampleRate; + next.intervalSamples=std::max(1u,static_cast( + std::llround(60.*sampleRate*beats[static_cast(s.division)]/s.bpm))); + next.captureSamples=std::max(1u,static_cast( + std::llround(sampleRate*s.captureMs/1000.))); + next.silenceSamples=std::max(1u,static_cast( + std::llround(sampleRate*s.silenceMs/1000.))); + next.gateLinear=static_cast(std::pow(10.,s.thresholdDb/20.)); + next.valid=next.gateLinear>0.f; + out=next;return true; + } + // CONTROL thread only, before publishing the insert. Maximum memory is + // bounded by the selected device rate and independent of song duration. + bool prepare(double rate) { + PreparedEdit packet{}; + if(!prepareEdit(VocalThrowSettings{},rate,packet))return false; + const auto historyFrames=static_cast(std::ceil(rate*2.5))+4; + const auto freezeFrames=static_cast(std::ceil(rate*maxCaptureMs/1000.))+4; + if(historyFrames>500000||freezeFrames>300000)return false; + historyL_.assign(historyFrames,0.f); + historyR_.assign(historyFrames,0.f); + freezeL_.assign(freezeFrames,0.f); + freezeR_.assign(freezeFrames,0.f); + rate_=rate;ready_=true;settings_=packet;reset(); + return true; + } + // CONTROL, before publication. No vector resizing during state restore. + bool resetUnpublished(const VocalThrowSettings& settings) noexcept { + PreparedEdit next{}; + if(!ready_||!prepareEdit(settings,rate_,next))return false; + settings_=next;reset();return true; + } + // AUDIO: trivially copied, completely validated, no heap/locks. + bool applyPrepared(const PreparedEdit& edit) noexcept { + if(!ready_||!edit.valid||edit.sampleRate!=rate_|| + !validSettings(edit.settings)||edit.intervalSamples==0|| + edit.captureSamples==0||edit.captureSamples>freezeL_.size()|| + edit.silenceSamples==0)return false; + settings_=edit;return true; + } + // AUDIO: triggers the most recent word/phrase, preferring the latest + // vocal end if the singer stopped within the last 700 ms. + bool throwNow() noexcept { + if(!ready_||recorded_==0)return false; + const auto recent=static_cast(rate_*.7); + const bool ended=lastSoundEnd_>0 && clock_>=lastSoundEnd_ && + clock_-lastSoundEnd_<=recent && quiet_>0; + return freezeAt(ended?lastSoundEnd_:clock_); + } + void processStereo(float* left,float* right,std::size_t frames) noexcept { + if(!ready_||!left||!right)return; + const bool mono=left==right; + for(std::size_t i=0;i(clock_%historyL_.size()); + historyL_[location]=dryL;historyR_[location]=dryR; + ++clock_;recorded_=std::min(recorded_+1,historyL_.size()); + const float peak=std::max(std::abs(dryL),std::abs(dryR)); + // Fast attack, slow release. Singing detector is independent of + // output echo, so feedback cannot self-trigger another phrase. + const float coeff=peak>envelope_?envAttack_:envRelease_; + envelope_=coeff*envelope_+(1.f-coeff)*peak; + if(envelope_<1.0e-20f)envelope_=0.f; + const bool singing=envelope_>=settings_.gateLinear; + if(singing) { + if(quiet_>static_cast(rate_*.06))voiced_=0; + quiet_=0; + voiced_=std::min(voiced_+1,static_cast(rate_)); + lastSoundEnd_=clock_; + if(voiced_>=static_cast(rate_*.08))armed_=true; + } else { + ++quiet_; + if(armed_ && quiet_>=settings_.silenceSamples) { + if(settings_.settings.mode!=0 && clock_>=nextAutoEligible_) { + const bool captured=freezeAt(lastSoundEnd_); + if(captured)nextAutoEligible_=clock_+ + static_cast(rate_*.4); + } + armed_=false; + } + } + float echoL=0.f,echoR=0.f; + if(playing_) { + // A new manual throw replaces the old tail atomically. + // Each voice has a fixed offset in the captured buffer; + // multiple phrases may overlap at short note divisions. + for(int tap=0;tap(tap)]; + if(clock_<=start)continue; + const std::uint64_t offset=clock_-start-1; + if(offset>=freezeCount_)continue; + float ramp=1.f; + const auto edge=static_cast(rate_*.004); + if(edge>0) { + ramp=std::min(ramp,static_cast(offset)/static_cast(edge)); + ramp=std::min(ramp,static_cast(freezeCount_-offset-1)/ + static_cast(edge)); + } + const auto p=static_cast(offset); + const float gain=repeatGains_[static_cast(tap)]*std::max(0.f,ramp); + echoL+=freezeL_[p]*gain;echoR+=freezeR_[p]*gain; + } + const auto end=repeatStarts_[static_cast(settings_.settings.repeats-1)] + +freezeCount_; + if(clock_>end)playing_=false; + } + const float target=singing?1.f-settings_.settings.ducking:1.f; + // Fixed 8-ms one-pole gain smoothing: no clicks on duck transitions. + duck_=duck_*duckCoeff_+target*(1.f-duckCoeff_); + left[i]=dryL+echoL*settings_.settings.wet*duck_; + if(!mono)right[i]=dryR+echoR*settings_.settings.wet*duck_; + } + } + [[nodiscard]] bool ready() const noexcept{return ready_;} + [[nodiscard]] VocalThrowSettings settingsForTests() const noexcept{return settings_.settings;} + [[nodiscard]] bool echoActive() const noexcept{return playing_;} + [[nodiscard]] unsigned throwCount() const noexcept{return throwCount_;} + [[nodiscard]] double sampleRate() const noexcept{return rate_;} +private: + bool freezeAt(std::uint64_t end) noexcept { + if(end==0||end>clock_||historyL_.empty())return false; + const auto available=std::min(end,recorded_); + const auto count=std::min(available,settings_.captureSamples); + if(count(rate_*.025))return false; + const auto from=end-count; + for(std::uint64_t i=0;i((from+i)%historyL_.size()); + freezeL_[static_cast(i)]=historyL_[source]; + freezeR_[static_cast(i)]=historyR_[source]; + } + freezeCount_=count; + // Wait until the next subdivision after the detected phrase end; + // if the silence detector was late, fire immediately (never in past). + const std::uint64_t first=std::max(clock_,end+settings_.intervalSamples); + float amplitude=1.f; + for(int tap=0;tap(tap); + repeatStarts_[slot]=first+static_cast(tap)*settings_.intervalSamples; + repeatGains_[slot]=amplitude;amplitude*=settings_.settings.decay; + } + playing_=true;++throwCount_; + return true; + } + void reset() noexcept { + clock_=lastSoundEnd_=nextAutoEligible_=0; + recorded_=freezeCount_=0; + voiced_=quiet_=0;armed_=playing_=false; + envelope_=0.f;duck_=1.f;throwCount_=0; + if(rate_>0) { + envAttack_=static_cast(std::exp(-1./(rate_*.004))); + envRelease_=static_cast(std::exp(-1./(rate_*.060))); + duckCoeff_=static_cast(std::exp(-1./(rate_*.008))); + } + repeatStarts_.fill(0);repeatGains_.fill(0.f); + std::fill(historyL_.begin(),historyL_.end(),0.f); + std::fill(historyR_.begin(),historyR_.end(),0.f); + } + PreparedEdit settings_{}; + std::vector historyL_,historyR_,freezeL_,freezeR_; + std::array repeatStarts_{}; + std::array repeatGains_{}; + std::uint64_t clock_=0,lastSoundEnd_=0,nextAutoEligible_=0; + std::size_t recorded_=0; + std::uint64_t freezeCount_=0; + std::uint32_t voiced_=0,quiet_=0; + float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f,duck_=1.f; + double rate_=0.; + unsigned throwCount_=0; + bool armed_=false,playing_=false,ready_=false; +}; +} // namespace armix::builtin_fx From 070ed0c7c3a36788ec0dd3f9720c3265750176f7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:05:36 +0700 Subject: [PATCH 002/124] feat(vocal-throw): add native JUCE insert, lock-free DSP commands and schema-versioned state --- engine/builtin_fx/VocalThrowProcessor.h | 151 ++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 engine/builtin_fx/VocalThrowProcessor.h diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h new file mode 100644 index 000000000..a6842bed7 --- /dev/null +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "VocalThrow.h" +#include "FxSpsc.h" +#include "../core/RealtimeNativeFxControl.h" +#include +#include +#include + +// JUCE adapter for the existing ChannelId FX rack. All setting/throw requests +// are bound to an exact accepted graph instance by ConsoleWindow before they +// enter the control->audio SPSC. Audio never posts a WebView event. +namespace armix::builtin_fx { +class VocalThrowProcessor final : public juce::AudioProcessor, + public armix::mixer::RealtimeNativeFxControl { +public: + static constexpr const char* catalogIdentity="armix.builtin.vocal-throw.v1"; + enum class CommandKind : std::uint8_t { settings, trigger }; + struct Completion { + std::uint64_t requestId=0; + VocalThrowSettings settings{}; + CommandKind kind=CommandKind::settings; + bool applied=false; + }; + VocalThrowProcessor() + : juce::AudioProcessor(BusesProperties() + .withInput("Input",juce::AudioChannelSet::stereo(),true) + .withOutput("Output",juce::AudioChannelSet::stereo(),true)) { + setLatencySamples(VocalThrow::addedLatencySamples); + } + const juce::String getName() const override {return "ArSon Vocal Throw";} + bool acceptsMidi() const override{return false;} + bool producesMidi() const override{return false;} + bool isMidiEffect() const override{return false;} + double getTailLengthSeconds() const override{return 16.;} + int getNumPrograms() override{return 1;} + int getCurrentProgram() override{return 0;} + void setCurrentProgram(int) override{} + const juce::String getProgramName(int) override{return "Current";} + void changeProgramName(int,const juce::String&) override{} + bool hasEditor() const override{return false;} + juce::AudioProcessorEditor* createEditor() override{return nullptr;} + bool isBusesLayoutSupported(const BusesLayout& layout) const override { + return layout.getMainInputChannelSet()==juce::AudioChannelSet::stereo()&& + layout.getMainOutputChannelSet()==juce::AudioChannelSet::stereo(); + } + void prepareToPlay(double sampleRate,int) override { + ready_=core_.prepare(sampleRate)&&core_.resetUnpublished(accepted_); + if(ready_)rate_=sampleRate; + } + void releaseResources() override{ready_=false;} + void processBlock(juce::AudioBuffer& pcm,juce::MidiBuffer&) override { + juce::ScopedNoDenormals noDenormals; + if(!ready_||pcm.getNumChannels()<2||pcm.getNumSamples()<=0)return; + consumeRealtimeEdits(); + core_.processStereo(pcm.getWritePointer(0),pcm.getWritePointer(1), + static_cast(pcm.getNumSamples())); + observedThrows_.store(core_.throwCount(),std::memory_order_relaxed); + observedTail_.store(core_.echoActive(),std::memory_order_relaxed); + } + void processBlock(juce::AudioBuffer&,juce::MidiBuffer&) override{} + void consumeRealtimeEdits() noexcept override { + Edit e{}; + if(!ready_||!done_.canPush()||!commands_.pop(e))return; + const bool applied=e.kind==CommandKind::settings? + core_.applyPrepared(e.prepared):core_.throwNow(); + (void)done_.push({e.id,e.prepared.settings,e.kind,applied}); + } + 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; + if(!VocalThrow::prepareEdit(settings,rate_,e.prepared))return false; + return commands_.push(e); + } + bool queueTrigger(std::uint64_t id) noexcept { + if(!ready_||id==0)return false; + Edit e{};e.id=id;e.kind=CommandKind::trigger; + return commands_.push(e); + } + bool pollCompletion(Completion& out) noexcept { + if(!done_.pop(out))return false; + if(out.applied&&out.kind==CommandKind::settings)accepted_=out.settings; + return true; + } + VocalThrowSettings acceptedSettings() const noexcept{return accepted_;} + double acceptedSampleRate() const noexcept{return rate_;} + unsigned observedThrowCount() const noexcept { + return observedThrows_.load(std::memory_order_relaxed); + } + bool observedTailActive() const noexcept { + return observedTail_.load(std::memory_order_relaxed); + } + bool isReady() const noexcept{return ready_;} + void sealForRealtime() noexcept override{published_=true;} + bool stateSnapshotQuiescent() const noexcept override{ + return commands_.empty()&&done_.empty(); + } + void getStateInformation(juce::MemoryBlock& out) override { + juce::MemoryOutputStream writer(out,false); + writer.writeInt(0x41565448); // AVTH + writer.writeInt(1); + writer.writeInt(accepted_.mode); + writer.writeFloat(accepted_.bpm); + writer.writeInt(accepted_.division); + writer.writeInt(accepted_.repeats); + writer.writeFloat(accepted_.captureMs); + writer.writeFloat(accepted_.silenceMs); + writer.writeFloat(accepted_.thresholdDb); + writer.writeFloat(accepted_.wet); + writer.writeFloat(accepted_.decay); + writer.writeFloat(accepted_.ducking); + } + bool restoreUnpublishedState(const void* data,int bytes) { + if(published_||!data||bytes!=44||!commands_.empty()||!done_.empty()) + return false; + juce::MemoryInputStream reader(data,static_cast(bytes),false); + if(reader.readInt()!=0x41565448||reader.readInt()!=1)return false; + VocalThrowSettings s{}; + s.mode=reader.readInt(); + s.bpm=reader.readFloat(); + s.division=reader.readInt(); + s.repeats=reader.readInt(); + s.captureMs=reader.readFloat(); + s.silenceMs=reader.readFloat(); + s.thresholdDb=reader.readFloat(); + s.wet=reader.readFloat(); + s.decay=reader.readFloat(); + s.ducking=reader.readFloat(); + if(!reader.isExhausted()||!VocalThrow::validSettings(s))return false; + if(ready_&&!core_.resetUnpublished(s))return false; + accepted_=s;return true; + } + void setStateInformation(const void* data,int bytes) override{ + (void)restoreUnpublishedState(data,bytes); + } +private: + struct Edit { + std::uint64_t id=0; + CommandKind kind=CommandKind::settings; + VocalThrow::PreparedEdit prepared{}; + }; + VocalThrow core_{}; + FxSpsc commands_{}; + FxSpsc done_{}; + VocalThrowSettings accepted_{}; + std::atomic observedThrows_{0}; + std::atomic observedTail_{false}; + double rate_=0.; + bool ready_=false,published_=false; +}; +} // namespace armix::builtin_fx From e13c3fc1424852b3a83254ae30d40b53bbb48a2e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:07:10 +0700 Subject: [PATCH 003/124] feat(vocal-throw): install real native FX node on authoritative ChannelId graph --- src/LiveAudioEngine.h | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index 4bf678b1b..bf3a78b34 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -12,6 +12,7 @@ #include "../engine/dsp/NativeMasterLoudness.h" #include "../engine/builtin_fx/ChannelEqProcessor.h" #include "../engine/builtin_fx/ChannelCompressorProcessor.h" +#include "../engine/builtin_fx/VocalThrowProcessor.h" #include "DiagnosticTone.h" #include "../engine/device/JuceIndependentClockDevice.h" #include "../engine/device/LiveSecondaryOutputDevice.h" @@ -1755,6 +1756,49 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback } } + // ArSon Vocal Throw: single native PCM graph, same insert leases, bypass, + // ChannelId topology and dry monitoring as EQ/Compressor. + LiveDryRoutingLab::NativeBusResult installNativeBuiltInVocalThrow( + std::uint64_t ep,std::uint64_t pcmRevision, + std::uint64_t rosterRevision,armix::mixer::ChannelId id) { + LiveDryRoutingLab::NativeBusResult fail{}; + fail.error="NATIVE_THROW_HOST_UNAVAILABLE"; + auto* device=deviceManager_.getCurrentAudioDevice(); + if(independent_.active()||!attached_||!device|| + !directFence_.permitted()||secondaryOutput_.armed()|| + handoff_.busy()||fxMovePhase_.load(std::memory_order_acquire)!=0|| + routeReconfiguring_.load(std::memory_order_acquire)|| + diagnosticRoute_.load(std::memory_order_acquire)!= + armix::diagnostics::Route::normal)return fail; + if(ep!=dryRoutingLab_.epoch()){ + fail.error="NATIVE_THROW_DEVICE_CHANGED";return fail; + } + const auto rate=device->getCurrentSampleRate(); + const int frames=juce::jmax(32,device->getCurrentBufferSizeSamples()); + if(!(rate>=8000.&&rate<=192000.)|| + frames>LiveDryRoutingLab::Block::hardFrameLimit) { + fail.error="NATIVE_THROW_UNSUPPORTED_AUDIO_FORMAT";return fail; + } + try { + auto processor=std::make_unique(); + processor->prepareToPlay(rate,frames); + if(!processor->isReady()){ + fail.error="NATIVE_THROW_PREPARE_REJECTED";return fail; + } + auto lease=std::make_shared< + armix::mixer::LiveChannelFxGraph::FxInstance>( + std::move(processor), + juce::String(armix::builtin_fx::VocalThrowProcessor::catalogIdentity), + "ArSon Vocal Throw",LiveDryRoutingLab::Block::hardFrameLimit); + return dryRoutingLab_.attachNativeInsert(ep,pcmRevision, + rosterRevision,id, + armix::builtin_fx::VocalThrowProcessor::catalogIdentity, + std::move(lease),true); + } catch(...) { + fail.error="NATIVE_THROW_PREPARE_EXCEPTION";return fail; + } + } + // User-owned VST3 on a true dynamic ChannelId. Instantiation/scan/layout // work is CONTROL only; the callback receives an immutable fx lease. LiveDryRoutingLab::NativeBusResult installNativeVst3( From 29ab4395c2de35c4b9a488d5593b3006068e0e8b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:07:13 +0700 Subject: [PATCH 004/124] feat(vocal-throw): restore schema-validated native FX settings in saved shows --- src/NativeMixerSessionFxRestore.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/NativeMixerSessionFxRestore.h b/src/NativeMixerSessionFxRestore.h index e85e3fbc1..de808929b 100644 --- a/src/NativeMixerSessionFxRestore.h +++ b/src/NativeMixerSessionFxRestore.h @@ -5,6 +5,7 @@ #include "Vst3DescriptionCache.h" #include "../engine/builtin_fx/ChannelEqProcessor.h" #include "../engine/builtin_fx/ChannelCompressorProcessor.h" +#include "../engine/builtin_fx/VocalThrowProcessor.h" #include #include #include @@ -85,6 +86,16 @@ class NativeMixerSessionFxRestore final { static_cast(state.bytes.getSize()))) return "Saved native Compressor state rejected; graph unchanged"; processor=std::move(comp); + } else if(insert.catalogId== + armix::builtin_fx::VocalThrowProcessor::catalogIdentity) { + auto throwFx=std::make_unique(); + throwFx->prepareToPlay(sampleRate,frames); + if(!throwFx->isReady()|| + !throwFx->restoreUnpublishedState( + state.bytes.getData(), + static_cast(state.bytes.getSize()))) + return "Saved native Vocal Throw state rejected; graph unchanged"; + processor=std::move(throwFx); } else { if(!format|| !format->fileMightContainThisPluginType(insert.path)) @@ -104,7 +115,9 @@ class NativeMixerSessionFxRestore final { if(insert.catalogId!= armix::builtin_fx::ChannelEqProcessor::catalogIdentity && insert.catalogId!= - armix::builtin_fx::ChannelCompressorProcessor::catalogIdentity) + armix::builtin_fx::ChannelCompressorProcessor::catalogIdentity && + insert.catalogId!= + armix::builtin_fx::VocalThrowProcessor::catalogIdentity) processor->setStateInformation(state.bytes.getData(), static_cast(state.bytes.getSize())); const int latency=processor->getLatencySamples(); From 56b5cca0e4adeec23326bdd328cc473f24c9122d Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:07:16 +0700 Subject: [PATCH 005/124] feat(vocal-throw): catalog stable native effect identity --- engine/builtin_fx/BuiltInFxCatalog.h | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/builtin_fx/BuiltInFxCatalog.h b/engine/builtin_fx/BuiltInFxCatalog.h index bbc6b83d3..67db030e2 100644 --- a/engine/builtin_fx/BuiltInFxCatalog.h +++ b/engine/builtin_fx/BuiltInFxCatalog.h @@ -11,6 +11,7 @@ namespace armix::builtin_fx { inline constexpr std::string_view channelEqId = "armix.builtin.channel-eq.v1"; inline constexpr std::string_view channelCompressorId = "armix.builtin.channel-compressor.v1"; +inline constexpr std::string_view vocalThrowId = "armix.builtin.vocal-throw.v1"; enum class FilterKind : std::uint8_t { highPass, lowShelf, bell, highShelf, lowPass }; enum class Slope : std::uint8_t { db12 = 12, db24 = 24 }; From f8917ec5f5f18a68b90589c787dfc9c9b11f47fd Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:07:19 +0700 Subject: [PATCH 006/124] test(vocal-throw): include deterministic RT-safe DSP tests in existing Windows CI target --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1af6ea30..2c1702fae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,6 +379,12 @@ if(BUILD_TESTING) add_test(NAME NativeCompressorZeroLatencyAndLinkedStereoPCM COMMAND ARMixNativeCompressorTests) add_dependencies(ARMixMixerRoutingTests ARMixNativeCompressorTests) + add_executable(ARMixNativeVocalThrowTests tests/builtin_vocal_throw_test.cpp + engine/builtin_fx/VocalThrow.h) + target_compile_features(ARMixNativeVocalThrowTests PRIVATE cxx_std_20) + add_test(NAME NativeVocalThrowPhraseCaptureManualAutoAndNoHeap COMMAND ARMixNativeVocalThrowTests) + add_dependencies(ARMixMixerRoutingTests ARMixNativeVocalThrowTests) + add_executable(ARMixNativeMasterLoudnessTests tests/native_master_loudness_test.cpp engine/dsp/NativeMasterLoudness.h) target_compile_features(ARMixNativeMasterLoudnessTests PRIVATE cxx_std_20) add_test(NAME P1KMeasuredNativeBS1770StereoAnd4xTruePeak COMMAND ARMixNativeMasterLoudnessTests) From 07ae515306cef065219e7302261f78ada676e3c0 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:07:48 +0700 Subject: [PATCH 007/124] fix(vocal-throw): validate exact 48-byte settings state --- engine/builtin_fx/VocalThrowProcessor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index a6842bed7..42f2b4af1 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -111,7 +111,7 @@ class VocalThrowProcessor final : public juce::AudioProcessor, writer.writeFloat(accepted_.ducking); } bool restoreUnpublishedState(const void* data,int bytes) { - if(published_||!data||bytes!=44||!commands_.empty()||!done_.empty()) + if(published_||!data||bytes!=48||!commands_.empty()||!done_.empty()) return false; juce::MemoryInputStream reader(data,static_cast(bytes),false); if(reader.readInt()!=0x41565448||reader.readInt()!=1)return false; From 080bd84a77c17e93811115c523dbb2890d533b96 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:08:13 +0700 Subject: [PATCH 008/124] feat(vocal-throw): route native insert and lifecycle through approved ChannelId engine --- src/Main.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index fb4da2320..2f752d1f9 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -392,6 +392,13 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr } pendingNativeComp_; juce::String lastNativeCompRequest_,lastNativeCompInstance_; juce::String lastNativeCompEpoch_,lastNativeCompRevision_; + struct PendingNativeThrow { + armix::mixer::LiveChannelFxGraph::InstanceLease owner; + juce::String request,channelId,deviceEpoch,revision,instanceId; + juce::uint32 started=0; + } pendingNativeThrow_; + juce::String lastNativeThrowRequest_,lastNativeThrowInstance_; + juce::String lastNativeThrowEpoch_,lastNativeThrowRevision_; std::unique_ptr editorWindow_; std::unique_ptr audioSetupWindow_; juce::String startupError_, lastAudioXml_; @@ -1073,9 +1080,12 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr armix::builtin_fx::ChannelEqProcessor::catalogIdentity; const bool builtInComp=catalogId== armix::builtin_fx::ChannelCompressorProcessor::catalogIdentity; - const auto* plugin=(builtInEq||builtInComp)?nullptr:catalog_.find(catalogId); + const bool builtInThrow=catalogId== + armix::builtin_fx::VocalThrowProcessor::catalogIdentity; + const auto* plugin=(builtInEq||builtInComp||builtInThrow)? + nullptr:catalog_.find(catalogId); std::uint64_t ep=0,rev=0,roster=0,target=0; - if((!builtInEq&&!builtInComp&&!plugin)||catalog_.busy()||nativeShowBusy_|| + if((!builtInEq&&!builtInComp&&!builtInThrow&&!plugin)||catalog_.busy()||nativeShowBusy_|| studioBackupBusy_||engine_.isGraphSwitchPending()) { nativeError="NATIVE_VST3_CATALOG_OR_HOST_BUSY"; } else if(!armix::console::approvedNativeId( @@ -1094,6 +1104,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr builtInComp? engine_.installNativeBuiltInCompressor( ep,rev,roster,armix::mixer::ChannelId{target}): + builtInThrow? + engine_.installNativeBuiltInVocalThrow( + ep,rev,roster,armix::mixer::ChannelId{target}): engine_.installNativeVst3( ep,rev,roster,armix::mixer::ChannelId{target}, plugin->path,plugin->uid,plugin->key()); @@ -2023,7 +2036,8 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr bool captureIdentity) { for(auto& insert:doc.inserts) { if(insert.catalogId==armix::builtin_fx::ChannelEqProcessor::catalogIdentity || - insert.catalogId==armix::builtin_fx::ChannelCompressorProcessor::catalogIdentity) { + insert.catalogId==armix::builtin_fx::ChannelCompressorProcessor::catalogIdentity || + insert.catalogId==armix::builtin_fx::VocalThrowProcessor::catalogIdentity) { if(insert.path.isNotEmpty() || insert.uid!=0) return "Saved built-in FX identity was modified"; continue; @@ -2265,7 +2279,8 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr action == "routingNativeFxRackBypass" || action == "routingNativeFxInsertBypass" || action == "routingFxRackBypass" || - action == "nativeEqSetBand" || action == "nativeCompSet")) + action == "nativeEqSetBand" || action == "nativeCompSet" || + action == "nativeThrowSet" || action == "nativeThrowTrigger")) { const auto reason=juce::String( "Studio backup in progress. Finish backup before editing saved FX or VST library."); @@ -4390,6 +4405,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr ++timerTicks_; servicePendingNativeEq(); servicePendingNativeComp(); + servicePendingNativeThrow(); // A hidden JUCE/WebView2 peer may defer first navigation. Expose the // compositor behind the opaque startup splash after the first tick; // the user sees the completed mixer only after the ready handshake. From b47fe83b8369abfa29844a4dec1a4ddfd0cd03c6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:08:55 +0700 Subject: [PATCH 009/124] feat(vocal-throw): expose accepted FX settings, capture activity and DSP ACK --- src/Main.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 2f752d1f9..c212e190e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -2017,6 +2017,90 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr "arMixBuiltinCompAck",juce::var(ack.release())); } + // Native Vocal Throw settings, manual cue and auto-trigger readback. + // Settings and triggers are not accepted until the AUDIO-owned SPSC + // completion is drained on JUCE's message thread. + void emitNativeThrowSnapshot(const juce::String& request, + const juce::String& channelId,const juce::String& epoch, + const juce::String& revision,const juce::String& instanceId, + armix::builtin_fx::VocalThrowProcessor* processor) { + auto reply=std::make_unique(); + reply->setProperty("requestId",request); + reply->setProperty("channelId",channelId); + reply->setProperty("deviceEpoch",epoch); + reply->setProperty("graphRevision",revision); + reply->setProperty("instanceId",instanceId); + reply->setProperty("schemaVersion",1); + reply->setProperty("status",processor?"ACCEPTED":"REJECTED"); + if(processor) { + auto settings=std::make_unique(); + const auto s=processor->acceptedSettings(); + settings->setProperty("mode",s.mode); + settings->setProperty("bpm",s.bpm); + settings->setProperty("division",s.division); + settings->setProperty("repeats",s.repeats); + settings->setProperty("captureMs",s.captureMs); + settings->setProperty("silenceMs",s.silenceMs); + settings->setProperty("thresholdDb",s.thresholdDb); + settings->setProperty("wet",s.wet); + settings->setProperty("decay",s.decay); + settings->setProperty("ducking",s.ducking); + reply->setProperty("settings",juce::var(settings.release())); + reply->setProperty("sampleRate",processor->acceptedSampleRate()); + reply->setProperty("throwCount",static_cast(processor->observedThrowCount())); + reply->setProperty("tailActive",processor->observedTailActive()); + reply->setProperty("addedLatencySamples",processor->getLatencySamples()); + if(instanceId==lastNativeThrowInstance_&& + epoch==lastNativeThrowEpoch_&&revision==lastNativeThrowRevision_) + reply->setProperty("appliedRequestId",lastNativeThrowRequest_); + } else reply->setProperty("error","NATIVE_THROW_INSTANCE_OR_REVISION_UNAVAILABLE"); + if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( + "arMixBuiltinThrowSnapshot",juce::var(reply.release())); + } + + void servicePendingNativeThrow() { + if(!pendingNativeThrow_.owner)return; + auto* processor=dynamic_cast( + pendingNativeThrow_.owner->processor.get()); + if(!processor){pendingNativeThrow_={};return;} + armix::builtin_fx::VocalThrowProcessor::Completion completion{}; + if(!processor->pollCompletion(completion)&& + juce::Time::getMillisecondCounter()-pendingNativeThrow_.started<3000u) + return; + const auto request=pendingNativeThrow_.request; + bool applied=completion.applied&&completion.requestId!=0&& + request=="throw-"+juce::String(std::to_string(completion.requestId)); + const auto snap=approvedNativeSnapshot(); + const auto device=snap.getProperty("device",{}); + const auto graph=snap.getProperty("graph",{}); + applied=applied&&pendingNativeThrow_.deviceEpoch== + device.getProperty("epoch","").toString()&& + pendingNativeThrow_.revision== + graph.getProperty("revision","").toString(); + if(applied) { + lastNativeThrowRequest_=request; + lastNativeThrowInstance_=pendingNativeThrow_.instanceId; + lastNativeThrowEpoch_=pendingNativeThrow_.deviceEpoch; + lastNativeThrowRevision_=pendingNativeThrow_.revision; + } + auto ack=std::make_unique(); + ack->setProperty("requestId",request); + ack->setProperty("channelId",pendingNativeThrow_.channelId); + ack->setProperty("deviceEpoch",pendingNativeThrow_.deviceEpoch); + ack->setProperty("graphRevision",pendingNativeThrow_.revision); + ack->setProperty("instanceId",pendingNativeThrow_.instanceId); + ack->setProperty("status",applied?"APPLIED":"REJECTED"); + ack->setProperty("command",completion.kind== + armix::builtin_fx::VocalThrowProcessor::CommandKind::trigger? + "TRIGGER":"SETTINGS"); + ack->setProperty("errorCode",applied?"NONE": + completion.kind==armix::builtin_fx::VocalThrowProcessor::CommandKind::trigger? + "NO_CAPTURE_OR_STALE_GRAPH":"DSP_EDIT_NOT_APPLIED_OR_STALE"); + pendingNativeThrow_={}; + if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( + "arMixBuiltinThrowAck",juce::var(ack.release())); + } + // Never confuse durable logical ChannelId state with a physical device // authorization. This message-thread report is status only, not PCM. void emitMixerSessionAck(const juce::String& operation, From 8729862b3bd5dedb686a0695198c6deb0469ec73 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:09:29 +0700 Subject: [PATCH 010/124] feat(vocal-throw): validate tempo/settings/trigger commands at native ACK boundary --- src/Main.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index c212e190e..6d65d072e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -2594,6 +2594,92 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr return; } + // ArSon Vocal Throw: all UI commands reference one exact installed + // ChannelId + device epoch + graph revision + insert instance. + if(action=="nativeThrowSnapshot"||action=="nativeThrowSet"|| + action=="nativeThrowTrigger") { + const auto rawChannel=args.getProperty("channelId",{}); + const auto rawEpoch=args.getProperty("deviceEpoch",{}); + const auto rawRevision=args.getProperty("graphRevision",{}); + const auto rawInstance=args.getProperty("instanceId",{}); + const auto request=args.getProperty("requestId",{}).toString(); + const int throwSlot=static_cast(args.getProperty("slot",-1)); + std::uint64_t ch=0,ep=0,rev=0; + const bool valid=armix::console::approvedNativeId(rawChannel,ch)&& + armix::console::approvedNativeId(rawEpoch,ep)&& + armix::console::approvedNativeId(rawRevision,rev)&& + rawInstance.isString()&&rawInstance.toString().isNotEmpty()&& + throwSlot>=0&&throwSlot(throwSlot), + rawInstance.toString()): + armix::mixer::LiveChannelFxGraph::InstanceLease{}; + auto* processor=owner?dynamic_cast( + owner->processor.get()):nullptr; + if(action=="nativeThrowSnapshot") { + emitNativeThrowSnapshot(request,rawChannel.toString(), + rawEpoch.toString(),rawRevision.toString(), + rawInstance.toString(),processor); + return; + } + const auto wire=request.startsWith("throw-")? + request.substring(6).toStdString():std::string(); + std::uint64_t numeric=0; + if(!wire.empty()&&wire.size()<=19&& + wire.find_first_not_of("0123456789")==std::string::npos) { + try{numeric=std::stoull(wire);}catch(...){numeric=0;} + } + const bool isSettings=action=="nativeThrowSet"; + const auto values=args.getProperty("settings",{}); + armix::builtin_fx::VocalThrowSettings settings{}; + auto read=[&values](const char* key,float& out) { + const auto value=values.getProperty(key,{}); + if(!value.isInt()&&!value.isDouble())return false; + const auto v=static_cast(value); + if(!std::isfinite(v))return false; + out=static_cast(v); + return std::isfinite(out); + }; + auto integer=[&read](const char* key,int& out) { + float candidate=0.f; + if(!read(key,candidate)||candidate!=std::floor(candidate)|| + candidate<0.f||candidate>1000.f)return false; + out=static_cast(candidate);return true; + }; + const bool settingsValid=!isSettings || (values.isObject()&& + integer("mode",settings.mode)&&read("bpm",settings.bpm)&& + integer("division",settings.division)&&integer("repeats",settings.repeats)&& + read("captureMs",settings.captureMs)&&read("silenceMs",settings.silenceMs)&& + read("thresholdDb",settings.thresholdDb)&&read("wet",settings.wet)&& + read("decay",settings.decay)&&read("ducking",settings.ducking)&& + armix::builtin_fx::VocalThrow::validSettings(settings)); + bool queued=false; + if(processor&&numeric>0&&settingsValid&&!pendingNativeThrow_.owner&& + !nativeShowBusy_&&!studioBackupBusy_&&!engine_.independentClockActive()) { + queued=isSettings?processor->queueSettings(settings,numeric): + processor->queueTrigger(numeric); + if(queued) { + pendingNativeThrow_.owner=owner; + pendingNativeThrow_.request=request; + pendingNativeThrow_.channelId=rawChannel.toString(); + pendingNativeThrow_.deviceEpoch=rawEpoch.toString(); + pendingNativeThrow_.revision=rawRevision.toString(); + pendingNativeThrow_.instanceId=rawInstance.toString(); + pendingNativeThrow_.started=juce::Time::getMillisecondCounter(); + } + } + auto ack=std::make_unique(); + ack->setProperty("requestId",request); + ack->setProperty("status",queued?"QUEUED":"REJECTED"); + ack->setProperty("errorCode",queued?"NONE": + pendingNativeThrow_.owner?"THROW_CONTROL_BUSY": + "INVALID_OR_STALE_NATIVE_THROW"); + if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( + "arMixBuiltinThrowQueue",juce::var(ack.release())); + return; + } + // Route the approved channel FX picker to the SAME prepared M4 // graph as physical IN/OUT. ID resolves exclusively in the JUCE // catalog; browser paths/names are never trusted as plugin identity. From b9ecd8a4b601d2cbb685d35b0d424e433ee7b4d3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:12:50 +0700 Subject: [PATCH 011/124] feat(vocal-throw): compact approved FX editor with TAP BPM, phrase sensitivity and native THROW ACK --- .../assets/mixer-native-vocal-throw.js | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 site/preview-v2/assets/mixer-native-vocal-throw.js diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js new file mode 100644 index 000000000..a6384307b --- /dev/null +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -0,0 +1,239 @@ +/* ArSon Vocal Throw: controls ONLY, on the single approved /preview/ mixer. + No browser DSP or optimistic FX ACK: all state comes from JUCE PCM graph. */ +(() => { +"use strict"; +const ID="armix.builtin.vocal-throw.v1"; +const defaults=()=>({mode:2,bpm:120,division:0,repeats:3,captureMs:460, + silenceMs:220,thresholdDb:-35,wet:.42,decay:.55,ducking:.7}); +const presets={ + Concert:defaults(), + Fast:{...defaults(),division:1,repeats:4,captureMs:330,decay:.6}, + Ballad:{...defaults(),bpm:72,captureMs:650,wet:.48}, + Word:{...defaults(),mode:0,captureMs:280,silenceMs:180} +}; +const ranges={bpm:[60,200],repeats:[1,6],captureMs:[80,1500],silenceMs:[80,900], + thresholdDb:[-65,-15],wet:[0,1],decay:[.15,.9],ducking:[0,1]}; +const fields={captureMs:["Capture","ms",5],silenceMs:["End pause","ms",10], + thresholdDb:["Voice gate","dB",1],wet:["Echo mix","%",.01], + decay:["Decay","%",.01],ducking:["Vocal duck","%",.01]}; +const valid=s=>s&&[0,1,2].includes(s.mode)&&[0,1,2,3].includes(s.division)&& + Object.entries(ranges).every(([k,[min,max]])=> + Number.isFinite(s[k])&&s[k]>=min&&s[k]<=max); +const same=(a,b)=>Object.keys(defaults()).every(k=>a[k]===b[k]); +const clamp=(v,min,max)=>Math.max(min,Math.min(max,v)); +const backend=()=>window.__JUCE__?.backend; +const native=()=>typeof backend()?.emitEvent==="function"; +const snapshot=()=>window.__ARMIX_NATIVE_M2__?.state?.()?.current; +const style=document.createElement("style"); +style.textContent=[ + ".mx-vthrow{position:fixed;z-index:15001;left:12vw;top:110px;width:min(410px,calc(100vw - 20px));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}", + ".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 .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}" +].join("\n"); +document.head.append(style); +const panel=document.createElement("section"); +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', + '', + '
', + '
TRIGGER MODE
', + '
', + '
', + '
', + '
', + '
Native DSP · waiting for accepted channel
', + '
Phrase & echo shaping
', + '
FX READY0 throws
' +].join(""); +document.body.append(panel); +const $=id=>panel.querySelector("#"+id); +for(const [key,[title,unit,step]] of Object.entries(fields)){ + const label=document.createElement("label");label.className="range";label.dataset.key=key; + label.innerHTML=''+title+''; + const input=label.querySelector("input"),bounds=ranges[key]; + input.min=String(bounds[0]);input.max=String(bounds[1]);input.step=String(step); + input.setAttribute("aria-label",title);label.querySelector("output").dataset.unit=unit; + $("vtRanges").append(label); +} +let current=null,accepted=defaults(),draft=defaults(),pending=null, + readId="",readSent=0,seq=1,taps=[],windowDrag=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]; + if(!state?.admitted||!id||fx?.catalogId!==ID||fx?.id!==current?.instanceId)return null; + return {channelId:id,slot:current.slot,instanceId:fx.id, + deviceEpoch:state.device.epoch,graphRevision:state.graph.revision}; +}; +const hint=text=>{$("vtHint").textContent=text;}; +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; + 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")); + $("vtThrow").disabled=value!=="on"||!!pending; +} +function paint(){ + $("vtMode").value=String(draft.mode);$("vtBpm").value=String(draft.bpm); + $("vtDivision").value=String(draft.division);$("vtRepeats").value=String(draft.repeats); + for(const [key,[,unit]] of Object.entries(fields)){ + const label=$("vtRanges").querySelector('[data-key="'+key+'"]'); + label.querySelector("input").value=String(draft[key]); + label.querySelector("output").textContent= + (unit==="%"?Math.round(draft[key]*100):Math.round(draft[key]))+unit; + } + $("vtPreset").value=Object.entries(presets).find(([,v])=>same(v,draft))?.[0]||"Custom"; + syncPower(); +} +function requestSnapshot(force=false){ + const ctx=context();if(!native()||!ctx||panel.hidden)return; + const now=Date.now();if(!force&&readId&&now-readSent<900)return; + readId="throwsnap-"+now+"-"+(++seq);readSent=now; + backend().emitEvent("arMixAction",{action:"nativeThrowSnapshot",requestId:readId,...ctx}); +} +function send(command){ + const ctx=context(); + if(!native()||!ctx){hint("Native DSP unavailable");return false;} + if(pending){hint("Waiting for DSP ACK");return false;} + if(command==="nativeThrowSet"&&(!valid(draft)||same(draft,accepted)))return false; + const requestId="throw-"+String(Date.now()*1000+(++seq%1000)); + pending={requestId,command,ack:false,created:Date.now()}; + const payload={action:command,requestId,...ctx}; + if(command==="nativeThrowSet")payload.settings={...draft}; + backend().emitEvent("arMixAction",payload); + hint(command==="nativeThrowTrigger"?"Waiting for audio callback":"Applying to DSP"); + syncPower();return true; +} +for(const [key,id] of [["mode","vtMode"],["bpm","vtBpm"], + ["division","vtDivision"],["repeats","vtRepeats"]]){ + $(id).addEventListener("change",()=>{ + draft={...draft,[key]:Number($(id).value)};paint();send("nativeThrowSet"); + }); +} +for(const key of Object.keys(fields)){ + const input=$("vtRanges").querySelector('[data-key="'+key+'"] input'); + input.addEventListener("input",()=>{ + const value=Number(input.value),bounds=ranges[key]; + draft={...draft,[key]:clamp(value,bounds[0],bounds[1])};paint(); + }); + input.addEventListener("change",()=>send("nativeThrowSet")); +} +$("vtPreset").addEventListener("change",()=>{ + const p=presets[$("vtPreset").value];if(!p)return; + draft={...p};paint();send("nativeThrowSet"); +}); +$("vtThrow").addEventListener("click",()=>send("nativeThrowTrigger")); +$("vtTap").addEventListener("click",()=>{ + const now=performance.now(); + if(taps.length&&now-taps[taps.length-1]>2500)taps=[]; + taps.push(now);if(taps.length>6)taps.shift(); + if(taps.length<3){hint("Tap at least three beats");return;} + const deltas=taps.slice(1).map((time,i)=>time-taps[i]).filter(v=>v>=280&&v<=1200); + if(deltas.length<2){hint("Tap a steady beat");return;} + const ordered=[...deltas].sort((a,b)=>a-b); + const median=ordered[Math.floor(ordered.length/2)]; + draft={...draft,bpm:clamp(Math.round(60000/median),60,200)}; + paint();send("nativeThrowSet"); +}); +$("vtPower").addEventListener("click",()=>{ + if(current&&context())window.__ARMIX_NATIVE_M2__?.consumeAction?.( + current.track,"slotPower",{dataset:{slot:String(current.slot)}}); +}); +$("vtClose").addEventListener("click",()=>{panel.hidden=true;pending=null;readId="";}); +window.addEventListener("keydown",e=>{ + if(e.key==="Escape"&&!panel.hidden){panel.hidden=true;pending=null;readId="";} +}); +const head=panel.querySelector("header"); +head.addEventListener("pointerdown",e=>{ + if(e.button||e.target.closest("button,select"))return; + const box=panel.getBoundingClientRect(); + windowDrag={id:e.pointerId,dx:e.clientX-box.left,dy:e.clientY-box.top}; + head.setPointerCapture(e.pointerId);e.preventDefault(); +}); +head.addEventListener("pointermove",e=>{ + if(!windowDrag||e.pointerId!==windowDrag.id)return; + panel.style.left=clamp(e.clientX-windowDrag.dx,0,Math.max(0,innerWidth-panel.offsetWidth))+"px"; + panel.style.top=clamp(e.clientY-windowDrag.dy,0,Math.max(0,innerHeight-panel.offsetHeight))+"px"; +}); +head.addEventListener("pointerup",e=>{windowDrag=null;head.releasePointerCapture?.(e.pointerId);}); +window.ArSonMixNativeVocalThrow=Object.freeze({ + id:ID, + insert(target){return Boolean(window.__ARMIX_NATIVE_M2__?.insertPlugin?.(ID,target));}, + open(track,slot){ + current={track,slot,instanceId:null};pending=null;readId=""; + const state=snapshot(),id=window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(track); + const insert=state?.graph?.channels?.find(ch=>ch.id===id)?.inserts?.[slot]; + if(native()&&state?.admitted&&insert?.catalogId===ID&&insert.id){ + current.instanceId=insert.id;draft=defaults();accepted=defaults(); + hint("Reading accepted DSP settings"); + }else if(!native()){draft=defaults();accepted=defaults(); + hint("Browser preview only · no PCM");} + else hint("Native FX instance unavailable"); + $("vtChannel").textContent=track.name||"CH"; + panel.hidden=false;paint();requestSnapshot(true); + }, + close(){panel.hidden=true;} +}); +backend()?.addEventListener?.("arMixBuiltinThrowQueue",reply=>{ + if(!pending||reply?.requestId!==pending.requestId)return; + if(reply.status==="REJECTED"){hint("DSP rejected · "+(reply.errorCode||"STALE")); + pending=null;requestSnapshot(true);syncPower();} +}); +backend()?.addEventListener?.("arMixBuiltinThrowAck",reply=>{ + if(!pending||reply?.requestId!==pending.requestId)return; + if(reply.status!=="APPLIED"){hint("DSP rejected · "+(reply.errorCode||"UNKNOWN")); + pending=null;requestSnapshot(true);syncPower();return;} + if(pending.command==="nativeThrowTrigger"){hint("THROW executed by audio callback"); + pending=null;requestSnapshot(true);syncPower();} + else{pending.ack=true;requestSnapshot(true);} +}); +backend()?.addEventListener?.("arMixBuiltinThrowSnapshot",reply=>{ + if(panel.hidden||reply?.requestId!==readId)return; + readId="";readSent=0; + const ctx=context(); + if(!ctx||reply.status!=="ACCEPTED"||reply.channelId!==ctx.channelId|| + reply.instanceId!==ctx.instanceId||reply.deviceEpoch!==ctx.deviceEpoch|| + reply.graphRevision!==ctx.graphRevision||!valid(reply.settings)|| + reply.addedLatencySamples!==0){hint("Stale FX graph · reopen editor");return;} + $("vtCount").textContent=String(reply.throwCount||0)+" throws"; + $("vtDot").classList.toggle("active",reply.tailActive===true); + $("vtStatus").textContent=reply.tailActive?"ECHO TAIL":"NATIVE DSP"; + if(pending){ + if(!pending.ack||reply.appliedRequestId!==pending.requestId)return; + accepted={...reply.settings};draft={...accepted};pending=null; + hint("Native DSP settings accepted"); + }else{accepted={...reply.settings};draft={...accepted};} + paint(); +}); +backend()?.addEventListener?.("arMixConsoleSnapshot",()=>{ + if(panel.hidden)return; + if(native()&&!context()){pending=null;hint("FX graph changed · reopen");} + syncPower(); +}); +window.setInterval(()=>{ + if(panel.hidden)return; + if(pending&&Date.now()-pending.created>3500){hint("DSP ACK timeout");pending=null;} + if(native())requestSnapshot(); + syncPower(); +},250); +})(); From 6043d30b6618b54657aef0547cfbab912d01fd82 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:13:21 +0700 Subject: [PATCH 012/124] feat(vocal-throw): expose native effect in same FX picker and compiled approved GUI --- scripts/compose_native_peq.py | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/compose_native_peq.py b/scripts/compose_native_peq.py index 1a61cf2e5..b697a4349 100644 --- a/scripts/compose_native_peq.py +++ b/scripts/compose_native_peq.py @@ -5,6 +5,7 @@ CATALOG="armix.builtin.channel-eq.v1" SCRIPT='' COMP_SCRIPT='' +THROW_SCRIPT='' PICKER_HEAD="function renderFastPicker(){" PICKER_FN="""function insertChosenNativeEq(){ const t=tracks.concat(master).find(x=>x.id===activeFxTarget?.channelId); @@ -50,22 +51,44 @@ refreshStrip(t);setFastPicker(false); say('Compressor · browser preview ONLY · no audio DSP');return true; } +function insertChosenNativeThrow(){ + const t=tracks.concat(master).find(x=>x.id===activeFxTarget?.channelId); + const slot=Number(activeFxTarget?.slot); + if(!t||!Number.isInteger(slot)||slot<0||slot>=8){ + say('Vocal Throw · choose an empty FX insert');return false; + } + if(window.__JUCE__?.backend?.emitEvent){ + const host=window.ArSonMixNativeVocalThrow; + if(!host?.insert){say('Native Vocal Throw host unavailable');return false;} + host.insert(activeFxTarget);return true; + } + if(t.fx[slot]!=='None'){ + say('FX slot already occupied · choose an empty insert');return false; + } + t.fx[slot]='ArSon Vocal Throw';t.slotBypass[slot]=false; + t.fxInsertIds[slot]={id:'visual-throw-'+t.id+'-'+slot,name:'ArSon Vocal Throw'}; + refreshStrip(t);setFastPicker(false); + say('Vocal Throw · browser preview ONLY · no audio DSP');return true; +} function renderFastPicker(){""" PICKER_RENDER="plugEl('fastResults').innerHTML=list.length?list.map(p=>" PICKER_RENDER_NEW="""const eqBuiltin=!q||['parametric eq','peq','channel eq','built-in fx'].some(n=>n.includes(q))? '':''; const compBuiltin=!q||['compressor','comp','dynamics','built-in fx'].some(n=>n.includes(q))? '':''; - const builtin=(eqBuiltin||compBuiltin?'
BUILT-IN FX
':'')+eqBuiltin+compBuiltin; + const throwBuiltin=!q||['vocal throw','throw','delay','echo','phrase','concert','built-in fx'].some(n=>n.includes(q))? + '':''; + const builtin=(eqBuiltin||compBuiltin||throwBuiltin?'
BUILT-IN FX
':'')+eqBuiltin+compBuiltin+throwBuiltin; plugEl('fastResults').innerHTML=builtin+'
VST3 PLUGINS
'+(list.length?list.map(p=>""" PICKER_END=""").join(''):'
No matching effects
';""" PICKER_END_NEW=""").join(''):'
No matching effects
');""" PICKER_CLICK=" const btn=e.target.closest('[data-fast-id]');if(btn)insertCatalogPlugin(btn.dataset.fastId);" PICKER_CLICK_NEW=""" if(e.target.closest('[data-fast-native-eq]')){insertChosenNativeEq();return;} if(e.target.closest('[data-fast-native-comp]')){insertChosenNativeCompressor();return;} + if(e.target.closest('[data-fast-native-throw]')){insertChosenNativeThrow();return;} const btn=e.target.closest('[data-fast-id]');if(btn)insertCatalogPlugin(btn.dataset.fastId);""" PICKER_ENTER="if(b){e.preventDefault();insertCatalogPlugin(b.dataset.fastId);}" -PICKER_ENTER_NEW="if(b){e.preventDefault();if(b.hasAttribute('data-fast-native-eq'))insertChosenNativeEq();else if(b.hasAttribute('data-fast-native-comp'))insertChosenNativeCompressor();else insertCatalogPlugin(b.dataset.fastId);}" +PICKER_ENTER_NEW="if(b){e.preventDefault();if(b.hasAttribute('data-fast-native-eq'))insertChosenNativeEq();else if(b.hasAttribute('data-fast-native-comp'))insertChosenNativeCompressor();else if(b.hasAttribute('data-fast-native-throw'))insertChosenNativeThrow();else insertCatalogPlugin(b.dataset.fastId);}" OPEN=" if(a==='openPlugin'){openFastPicker(t,Number(btn.dataset.slot),btn);return;}" OPEN_NEW=""" if(a==='openPlugin'){ const index=Number(btn.dataset.slot); @@ -75,6 +98,9 @@ if(t.fx[index]==='Compressor'){ window.ArSonMixNativeCompressor?.open(t,index);return; } + if(t.fx[index]==='ArSon Vocal Throw'){ + window.ArSonMixNativeVocalThrow?.open(t,index);return; + } openFastPicker(t,index,btn);return; }""" def apply_native_peq(html: str)->str: @@ -85,11 +111,11 @@ def apply_native_peq(html: str)->str: (PICKER_ENTER,PICKER_ENTER_NEW), (OPEN,OPEN_NEW)) if html.count('')!=1 or html.count('')!=1 or \ - SCRIPT in html or COMP_SCRIPT in html or 'insertChosenNativeEq' in html: + SCRIPT in html or COMP_SCRIPT in html or THROW_SCRIPT in html or 'insertChosenNativeEq' in html: raise ValueError("Parametric EQ requires one pristine approved compiled GUI") for before,after in anchors: if html.count(before)!=1: raise ValueError('Ambiguous approved picker/editor anchor: '+before[:90]) html=html.replace(before,after,1) - html=html.replace('',SCRIPT+'\n'+COMP_SCRIPT+'\n',1) + html=html.replace('',SCRIPT+'\n'+COMP_SCRIPT+'\n'+THROW_SCRIPT+'\n',1) return html From 49034ce42d9801a7daabfd937c5e44f1ee051c25 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:13:53 +0700 Subject: [PATCH 013/124] feat(vocal-throw): open approved native editor for exact ChannelId FX insert --- web/approved-native-bridge.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index a4a16534e..d58c974e5 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -2737,6 +2737,8 @@ window.ArSonMixNativeEq?.open(t,slot); } else if(insert.catalogId==='armix.builtin.channel-compressor.v1') { window.ArSonMixNativeCompressor?.open(t,slot); + } else if(insert.catalogId==='armix.builtin.vocal-throw.v1') { + window.ArSonMixNativeVocalThrow?.open(t,slot); } else backend.emitEvent("arMixAction",{action:"routingFxEditor",channelId:id,slot, instanceId:insert.id,deviceEpoch:current.device.epoch,revision:current.graph.revision}); } else {discoverFxOnFirstPickerOpen();scope?.openFastPicker?.(t,slot,btn);} @@ -2933,7 +2935,8 @@ if(pendingFxInsert){status("FX INSERT · wait for previous native ACK");return true;} const plugin=nativeCatalog.get(id) || (id==='armix.builtin.channel-eq.v1'?{id,name:'Parametric EQ'}: - id==='armix.builtin.channel-compressor.v1'?{id,name:'Compressor'}:null); + id==='armix.builtin.channel-compressor.v1'?{id,name:'Compressor'}: + id==='armix.builtin.vocal-throw.v1'?{id,name:'ArSon Vocal Throw'}:null); const track=scope?.tracks?.find(x=>x.id===target?.channelId)|| (scope?.master?.id===target?.channelId?scope.master:null); const channel=m4Index(track),slot=Number(target?.slot); From 40621bd9d118c0d482aae2fbb4c320e15e31bd9e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:14:57 +0700 Subject: [PATCH 014/124] test(vocal-throw): verify manual and phrase-aware echo, BPM grid, dry bypass and RT heap safety --- tests/builtin_vocal_throw_test.cpp | 140 +++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 tests/builtin_vocal_throw_test.cpp diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp new file mode 100644 index 000000000..092b71739 --- /dev/null +++ b/tests/builtin_vocal_throw_test.cpp @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#include "../engine/builtin_fx/VocalThrow.h" +#include +#include +#include +#include +#include +#include +#include +#include +#define check(x) do {if(!(x)){std::fprintf(stderr,"FAIL:%s:%d %s\n",__FILE__,__LINE__,#x);std::abort();}}while(false) +// Catch allocations from inside the audio callback, not from preparation. +static std::atomic noHeap{false}; +void* operator new(std::size_t n) { + if(noHeap.load(std::memory_order_relaxed))std::abort(); + if(void* p=std::malloc(n?n:1))return p; + throw std::bad_alloc(); +} +void* operator new[](std::size_t n) { + if(noHeap.load(std::memory_order_relaxed))std::abort(); + if(void* p=std::malloc(n?n:1))return p; + throw std::bad_alloc(); +} +void operator delete(void* p) noexcept{std::free(p);} +void operator delete[](void* p) noexcept{std::free(p);} +void operator delete(void* p,std::size_t) noexcept{std::free(p);} +void operator delete[](void* p,std::size_t) noexcept{std::free(p);} + +using armix::builtin_fx::VocalThrow; +using armix::builtin_fx::VocalThrowSettings; +static void run(VocalThrow& fx,float l,float r,int frames,float& maxL,float& maxR) { + std::array left{},right{}; + for(int begin=0;begin(n)); + noHeap.store(false,std::memory_order_release); + for(int i=0;i::quiet_NaN(); + check(!VocalThrow::prepareEdit(settings,48000,packet)); + settings=VocalThrowSettings{};settings.mode=3; + check(!VocalThrow::prepareEdit(settings,48000,packet)); + settings=VocalThrowSettings{};settings.repeats=7; + check(!VocalThrow::prepareEdit(settings,48000,packet)); + settings=VocalThrowSettings{};settings.captureMs=1550; + check(!VocalThrow::prepareEdit(settings,48000,packet)); +} +static void manualAndDry(double rate) { + VocalThrow fx;check(fx.prepare(rate)); + auto s=fx.settingsForTests();s.mode=0;s.captureMs=300;s.silenceMs=150; + check(fx.resetUnpublished(s)); + float peakL=0,peakR=0; + // No trigger: the leading vocalist is bit-exact dry, even in an insert. + std::array left{},right{}; + left.fill(.35f);right.fill(-.20f); + noHeap.store(true); + fx.processStereo(left.data(),right.data(),left.size()); + noHeap.store(false); + for(std::size_t n=0;n(rate*.35),peakL,peakR); + run(fx,0,0,static_cast(rate*.06),peakL,peakR); + check(fx.throwCount()==0); + noHeap.store(true); + const bool fired=fx.throwNow(); + noHeap.store(false); + check(fired&&fx.throwCount()==1); + peakL=peakR=0; + run(fx,0,0,static_cast(rate*.10),peakL,peakR); + check(peakL==0&&peakR==0); // beat-scheduled, no immediate echo smear + run(fx,0,0,static_cast(rate*.75),peakL,peakR); + check(peakL>.01f&&peakR>.005f); + // Recorded stereo is preserved (same gain on both channels). + check(peakL>peakR*1.4f); +} +static void automaticAndHybrid(double rate) { + VocalThrow fx;check(fx.prepare(rate)); + auto s=fx.settingsForTests(); + s.mode=1;s.captureMs=220;s.silenceMs=120;s.thresholdDb=-30; + check(fx.resetUnpublished(s)); + float l=0,r=0; + run(fx,.5f,.35f,static_cast(rate*.3),l,r); + run(fx,0,0,static_cast(rate*.23),l,r); + check(fx.throwCount()==1); + run(fx,0,0,static_cast(rate*1.0),l,r); + check(fx.throwCount()==1); // no retrigger on the echoed tail + run(fx,.5f,.35f,static_cast(rate*.28),l,r); + run(fx,0,0,static_cast(rate*.23),l,r); + check(fx.throwCount()==2); + +} +static void hybridEditAndNoHeap() { + VocalThrow fx;check(fx.prepare(48000)); + VocalThrowSettings s{};s.mode=2;s.bpm=95;s.division=1;s.repeats=6; + VocalThrow::PreparedEdit edit{};check(VocalThrow::prepareEdit(s,48000,edit)); + check(!fx.applyPrepared(VocalThrow::PreparedEdit{})); + auto stale=edit;stale.sampleRate=44100;check(!fx.applyPrepared(stale)); + noHeap.store(true);const bool ok=fx.applyPrepared(edit);noHeap.store(false); + check(ok); + float l=0,r=0; + run(fx,.4f,.2f,10000,l,r); + noHeap.store(true);const bool fired=fx.throwNow();noHeap.store(false); + check(fired); + run(fx,0,0,200000,l,r); + check(std::isfinite(l)&&std::isfinite(r)); +} +int main() { + validation(); + manualAndDry(8000); + manualAndDry(44100); + manualAndDry(48000); + automaticAndHybrid(8000); + automaticAndHybrid(48000); + hybridEditAndNoHeap(); + std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); +} From 4fc0de858313e69ea4ecb09f2ef303dbbea70d64 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:15:22 +0700 Subject: [PATCH 015/124] fix(vocal-throw): use faster vocal-end envelope for responsive phrase triggering --- engine/builtin_fx/VocalThrow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index 1ca18fbfa..a46c7512d 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -203,7 +203,7 @@ class VocalThrow final { envelope_=0.f;duck_=1.f;throwCount_=0; if(rate_>0) { envAttack_=static_cast(std::exp(-1./(rate_*.004))); - envRelease_=static_cast(std::exp(-1./(rate_*.060))); + envRelease_=static_cast(std::exp(-1./(rate_*.018))); duckCoeff_=static_cast(std::exp(-1./(rate_*.008))); } repeatStarts_.fill(0);repeatGains_.fill(0.f); From d37aa3a0bf1d1dc983cfe1aa2896a7e0c5009419 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:17:12 +0700 Subject: [PATCH 016/124] perf(vocal-throw): amortize frozen phrase copy with fixed RT work budget --- engine/builtin_fx/VocalThrow.h | 53 ++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index a46c7512d..f85ea3af8 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -134,12 +134,13 @@ class VocalThrow final { armed_=false; } } + if(copyPending_)copyFrozenChunk(); // fixed real-time budget float echoL=0.f,echoR=0.f; if(playing_) { // A new manual throw replaces the old tail atomically. // Each voice has a fixed offset in the captured buffer; // multiple phrases may overlap at short note divisions. - for(int tap=0;tap(tap)]; if(clock_<=start)continue; const std::uint64_t offset=clock_-start-1; @@ -155,7 +156,7 @@ class VocalThrow final { const float gain=repeatGains_[static_cast(tap)]*std::max(0.f,ramp); echoL+=freezeL_[p]*gain;echoR+=freezeR_[p]*gain; } - const auto end=repeatStarts_[static_cast(settings_.settings.repeats-1)] + const auto end=repeatStarts_[static_cast(active_.settings.repeats-1)] +freezeCount_; if(clock_>end)playing_=false; } @@ -177,29 +178,39 @@ class VocalThrow final { const auto available=std::min(end,recorded_); const auto count=std::min(available,settings_.captureSamples); if(count(rate_*.025))return false; - const auto from=end-count; - for(std::uint64_t i=0;i((from+i)%historyL_.size()); - freezeL_[static_cast(i)]=historyL_[source]; - freezeR_[static_cast(i)]=historyR_[source]; + // No large memcpy in a 64/128-sample ASIO callback. Copy only a + // fixed number of stereo frames per processed sample before playback. + copyFrom_=end-count;copyEnd_=end;copyIndex_=0; + freezeCount_=count;active_=settings_; + playing_=false;copyPending_=true;++throwCount_; + return true; + } + void copyFrozenChunk() noexcept { + if(!copyPending_)return; + for(int n=0;n<24 && copyIndex_( + (copyFrom_+copyIndex_)%historyL_.size()); + const auto dest=static_cast(copyIndex_++); + freezeL_[dest]=historyL_[source];freezeR_[dest]=historyR_[source]; } - freezeCount_=count; - // Wait until the next subdivision after the detected phrase end; - // if the silence detector was late, fire immediately (never in past). - const std::uint64_t first=std::max(clock_,end+settings_.intervalSamples); + if(copyIndex_!=freezeCount_)return; + copyPending_=false; + // The phrase-end interval is authoritative. If capture completion + // is later than the first repeat, begin on the next safe sample. + const auto first=std::max(clock_,copyEnd_+active_.intervalSamples); float amplitude=1.f; - for(int tap=0;tap(tap); - repeatStarts_[slot]=first+static_cast(tap)*settings_.intervalSamples; - repeatGains_[slot]=amplitude;amplitude*=settings_.settings.decay; + repeatStarts_[slot]=first+ + static_cast(tap)*active_.intervalSamples; + repeatGains_[slot]=amplitude;amplitude*=active_.settings.decay; } - playing_=true;++throwCount_; - return true; + playing_=true; } void reset() noexcept { clock_=lastSoundEnd_=nextAutoEligible_=0; - recorded_=freezeCount_=0; - voiced_=quiet_=0;armed_=playing_=false; + recorded_=freezeCount_=0;copyFrom_=copyEnd_=copyIndex_=0; + voiced_=quiet_=0;armed_=playing_=copyPending_=false; envelope_=0.f;duck_=1.f;throwCount_=0; if(rate_>0) { envAttack_=static_cast(std::exp(-1./(rate_*.004))); @@ -210,17 +221,17 @@ class VocalThrow final { std::fill(historyL_.begin(),historyL_.end(),0.f); std::fill(historyR_.begin(),historyR_.end(),0.f); } - PreparedEdit settings_{}; + PreparedEdit settings_{},active_{}; std::vector historyL_,historyR_,freezeL_,freezeR_; std::array repeatStarts_{}; std::array repeatGains_{}; std::uint64_t clock_=0,lastSoundEnd_=0,nextAutoEligible_=0; std::size_t recorded_=0; - std::uint64_t freezeCount_=0; + std::uint64_t freezeCount_=0,copyFrom_=0,copyEnd_=0,copyIndex_=0; std::uint32_t voiced_=0,quiet_=0; float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f,duck_=1.f; double rate_=0.; unsigned throwCount_=0; - bool armed_=false,playing_=false,ready_=false; + bool armed_=false,playing_=false,copyPending_=false,ready_=false; }; } // namespace armix::builtin_fx From 04d8dc7924cfb77aea3768c888db71918c39d6e8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:18:38 +0700 Subject: [PATCH 017/124] fix(vocal-throw): share approved 24px close-button chrome and red pressed feedback --- 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 a6384307b..bfa870516 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -52,7 +52,7 @@ panel.setAttribute("aria-label","ArSon Vocal Throw"); panel.innerHTML=[ '
Vocal Throw', '', - '
', + '', '
TRIGGER MODE
', '
', '
', From 7475cf63532aff8a46db7d627577b226de5666f3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:21:28 +0700 Subject: [PATCH 018/124] test(vocal-throw): guard single approved picker, editor, DSP ACK and bundled asset --- tests/native_peq_assembly_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/native_peq_assembly_test.py b/tests/native_peq_assembly_test.py index 890d798f1..647eb4851 100644 --- a/tests/native_peq_assembly_test.py +++ b/tests/native_peq_assembly_test.py @@ -24,6 +24,9 @@ def test_one_authoritative_mixer(self): self.assertEqual(self.assembled.count('src="assets/mixer-native-peq.js?v=eq-graph1"'),1) self.assertEqual(self.assembled.count('src="assets/mixer-native-compressor.js?v=comp-1"'),1) self.assertEqual(self.assembled.count("function insertChosenNativeCompressor(){"),1) + self.assertEqual(self.assembled.count("function insertChosenNativeThrow(){"),1) + self.assertEqual(self.assembled.count('src="assets/mixer-native-vocal-throw.js?v=throw-1"'),1) + self.assertEqual(self.assembled.count('data-fast-native-throw="1"'),1) def test_native_rack_uses_regular_insert_slot(self): self.assertIn("host.insert(activeFxTarget)",self.assembled) @@ -35,6 +38,7 @@ def test_native_rack_uses_regular_insert_slot(self): self.assertEqual(self.assembled.count('data-fast-native-eq="1"'),1) self.assertEqual(self.assembled.count('data-fast-native-comp="1"'),1) self.assertIn("if(t.fx[index]==='Compressor')",self.assembled) + self.assertIn("if(t.fx[index]==='ArSon Vocal Throw')",self.assembled) def test_single_style_owner(self): # The approved CSS compiler requires exactly 18 component-owner links. @@ -54,6 +58,13 @@ def test_single_style_owner(self): self.assertIn('addedLatencySamples!==0',compressor) self.assertNotIn("new AudioContext",compressor) self.assertIn(".mx-comp[hidden]{display:none}",css) + throw=(ROOT/"site/preview-v2/assets/mixer-native-vocal-throw.js").read_text("utf-8") + self.assertIn("arMixBuiltinThrowAck",throw) + self.assertIn("arMixBuiltinThrowSnapshot",throw) + self.assertIn("nativeThrowTrigger",throw) + self.assertIn('id="vtPreset"',throw) + self.assertIn("armix-floating-close",throw) + self.assertNotIn("new AudioContext",throw) def test_fail_closed_on_repeat(self): with self.assertRaises(ValueError): From 4d6e677bc48ec506dfbc250524d02df963891402 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:22:11 +0700 Subject: [PATCH 019/124] style(vocal-throw): integrate compact editor in existing FX CSS owner --- site/preview-v2/assets/mixer-fx-rack.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index 54a22709d..43bfac31a 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -397,3 +397,22 @@ @media(max-height:350px){ .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:12vw;top:110px;width:min(410px,calc(100vw - 20px));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} +.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 .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} From 1fdb7c281fe6d99d6b08afbe8353a085affb4dd6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:22:13 +0700 Subject: [PATCH 020/124] refactor(vocal-throw): remove runtime CSS injection, reuse canonical FX stylesheet --- .../assets/mixer-native-vocal-throw.js | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index bfa870516..f24859635 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -24,27 +24,7 @@ const clamp=(v,min,max)=>Math.max(min,Math.min(max,v)); const backend=()=>window.__JUCE__?.backend; const native=()=>typeof backend()?.emitEvent==="function"; const snapshot=()=>window.__ARMIX_NATIVE_M2__?.state?.()?.current; -const style=document.createElement("style"); -style.textContent=[ - ".mx-vthrow{position:fixed;z-index:15001;left:12vw;top:110px;width:min(410px,calc(100vw - 20px));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}", - ".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 .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}" -].join("\n"); -document.head.append(style); + const panel=document.createElement("section"); panel.className="mx-vthrow";panel.id="mxNativeVocalThrow";panel.hidden=true; panel.setAttribute("role","dialog");panel.setAttribute("aria-modal","false"); From a493896cdb4a78d48b65c6e3e904c2bbc4820f1b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:23:22 +0700 Subject: [PATCH 021/124] docs(vocal-throw): live DSP architecture, acceptance test and auto-BPM scope boundary --- docs/ARSON_VOCAL_THROW_NATIVE_20261108.md | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/ARSON_VOCAL_THROW_NATIVE_20261108.md diff --git a/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md b/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md new file mode 100644 index 000000000..d205881af --- /dev/null +++ b/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md @@ -0,0 +1,40 @@ +# ArSon Vocal Throw — native phrase-aware live delay + +**Status: functional prototype on a separate feature branch; not a certified live-performance release.** + +This is a first-class native ChannelId insert in ArSonMix's single JUCE PCM render graph, not a second audio callback, browser-generated sound or independent DAW. + +## Implemented + +- **Manual:** rolling ring buffer holds up to 1.5 seconds of the most recent vocal. THROW captures a word or phrase and schedules up to six decaying repeats. +- **Auto:** energy envelope, minimum voice duration, silence threshold and cooldown detect the end of a sung phrase without letting the wet echo re-trigger itself. +- **Hybrid (default):** phrase-end automation and manual cue together. +- **Tempo:** BPM entry (60-200), TAP BPM, quarter/eighth/dotted-eighth/half note subdivisions. Interval timing is in native samples at the actual device rate. +- **Mix:** direct dry input with zero added samples, stereo echo, decay, short fades, and ducking while the singer is active. +- **Real-time:** all rolling/frozen buffers are allocated off-callback; a fixed 24-stereo-frame-per-sample capture copy budget avoids a single large callback memcpy. A lock-free SPSC transfers host settings and manual cue to the audio callback. Callback never allocates/logs/locks. +- **Identity & persistence:** stable native catalog ID; ChannelId, device epoch, graph revision, and insert instance fencing. DSP completed ACK and later readback precede accepted display. Schema-versioned 48-byte AVTH settings blob validated during Show restore; audio capture and tails are not persisted. +- **UX:** a compact FX editor inside the exact approved /preview/ mixer; presets in header, uniform power/close, BPM/note/repeat, THROW, TAP and collapsible advanced controls. One shared FX stylesheet. + +## Architecture + +Hardware input → ChannelId mixer strip → upstream EQ/Compressor/VST3 → VocalThrowProcessor → downstream inserts → fader/pan → WIRE/BUS/MAIN → hardware output. + +Core files: engine/builtin_fx/VocalThrow.h (DSP), VocalThrowProcessor.h (JUCE), src/LiveAudioEngine.h (graph install), src/Main.cpp (validated command/readback), src/NativeMixerSessionFxRestore.h (versioned state), scripts/compose_native_peq.py (one picker), web/approved-native-bridge.js (real insert), site/preview-v2/assets/mixer-native-vocal-throw.js (controls only). + +## Tests / qualification + +The ARMixNativeVocalThrowTests CTest covers zero-added-sample dry, tempo divisions, captured stereo echoes after manual cue, auto-end detection and no self-trigger, bad parameter rejection, 8/44.1/48 kHz sample rates and a global allocator guard around realtime processing. Python native picker/compiled-gui tests enforce no extra mixer screen and real-ACK event names. + +Before shipping: exact-SHA Windows MSVC + CTest, actual approved /preview/ Chromium screenshots, ASIO 64/128-frame stress at 44.1/48/96 kHz, live singer audition, device restart, bypass/tail behavior, and Show restore. + +## Explicit limitations + +1. **Automatic BPM analysis from the music/backing bus is not yet implemented.** Auto currently means automatic vocal phrase-end trigger, not auto-estimated music tempo. BPM is entered or TAP-derived. Full beat tracking requires an independent music-bus feed, beat confidence and phase tracking. +2. Voice end detector uses an adjustable energy-envelope heuristic, not linguistic speech recognition or a trained singing model. Breaths, falsetto and microphone bleed can cause false cues. +3. No MIDI footswitch binding, simultaneous phrase layers, stretchable echo phrases, global music BPM transport integration, or direct song-snapshot binding in this milestone. +4. Green quick CI is not equivalent to real Windows native compilation or ASIO device certification. +5. Existing channel routing and independent secondary audio clock remain authoritative; the FX insert makes no new claims about unresolved WIRE/SOURCE ONLY issues. + +## Field test + +Insert ID armix.builtin.vocal-throw.v1 into real ChannelId vocal strip; confirm graph ACK; sing “atau tidak” then press THROW at 72/95/120/160 BPM; try Auto with varying held notes and short breaths; toggle bypass while dry vocal remains direct; change device/quantum and reject stale instance requests. Compare physical ASIO callback xruns, stereo/feedback, click-free fades and singer subjective quality. From d24014835164cb4f4fc54dbbfa533213b74a4b97 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:23:43 +0700 Subject: [PATCH 022/124] ci(vocal-throw): verify native FX editor syntax in existing cheap UI lane --- .github/workflows/ui-smoke.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 257a1396c..093c32350 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -107,6 +107,7 @@ jobs: node --check site/preview-v2/assets/gui-perf-probe.js node --check site/preview-v2/assets/mixer-native-peq.js node --check site/preview-v2/assets/mixer-native-compressor.js + node --check site/preview-v2/assets/mixer-native-vocal-throw.js python tests/native_peq_assembly_test.py python tests/approved_operator_ux_smoke.py python scripts/build_ui_css.py --check From c035f406bf2009230bfef8d753ab0bb2c95661d9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:25:45 +0700 Subject: [PATCH 023/124] fix(vocal-throw): bound compact editor to mobile viewport and allow vertical overflow --- site/preview-v2/assets/mixer-fx-rack.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index 43bfac31a..998e29db4 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -399,7 +399,7 @@ } /* ArSon Vocal Throw shares the single approved FX CSS owner. */ -.mx-vthrow{position:fixed;z-index:15001;left:12vw;top:110px;width:min(410px,calc(100vw - 20px));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} +.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} .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} @@ -416,3 +416,4 @@ .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}} From 62edf741124c4a11f707cbbe3e23b1506dd222fe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:26:34 +0700 Subject: [PATCH 024/124] test(vocal-throw): Chromium native FX insertion, manual cue ACK and compact desktop/mobile UI --- tests/approved_native_vocal_throw_smoke.py | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 tests/approved_native_vocal_throw_smoke.py diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py new file mode 100644 index 000000000..ea8421625 --- /dev/null +++ b/tests/approved_native_vocal_throw_smoke.py @@ -0,0 +1,134 @@ +"""Real approved /preview/ bundle: ArSon Vocal Throw picker, insert, native ACK. +The JUCE event transport is emulated, NOT the native DSP nor singing quality. +DSP is independently tested in standalone CTest on Windows.""" +import copy +import importlib.util +from pathlib import Path +import tempfile +from playwright.sync_api import sync_playwright +from approved_native_wire_gain_smoke import snapshot, emit, ack, SOURCE + +ROOT=Path(__file__).resolve().parents[1] +ID="armix.builtin.vocal-throw.v1" +INSTANCE="vocal-throw-test-instance" +DEFAULTS={"mode":2,"bpm":120,"division":0,"repeats":3, + "captureMs":460,"silenceMs":220,"thresholdDb":-35, + "wet":.42,"decay":.55,"ducking":.7} + +def last(page,action): + records=page.evaluate("name=>window.__actions.filter(x=>x.action===name)",action) + assert records, "No "+action+" event" + return records[-1] + +def reply_snapshot(page,state,settings,applied=None,count=0,tail=False): + act=last(page,"nativeThrowSnapshot") + data={"requestId":act["requestId"],"channelId":SOURCE,"slot":0, + "instanceId":INSTANCE,"status":"ACCEPTED","schemaVersion":1, + "deviceEpoch":state["device"]["epoch"], + "graphRevision":state["graph"]["revision"],"sampleRate":48000, + "addedLatencySamples":0,"throwCount":count,"tailActive":tail, + "settings":copy.deepcopy(settings)} + if applied:data["appliedRequestId"]=applied + emit(page,"arMixBuiltinThrowSnapshot",data) + +def main(): + spec=importlib.util.spec_from_file_location( + "bundle",ROOT/"scripts/build_approved_native_gui.py") + bundle=importlib.util.module_from_spec(spec);spec.loader.exec_module(bundle) + with tempfile.TemporaryDirectory(prefix="armix-throw-") as directory,sync_playwright() as pw: + out=Path(directory);bundle.stage(out) + browser=pw.chromium.launch(headless=True) + for width,height in [(1366,768),(390,844)]: + page=browser.new_page(viewport={"width":width,"height":height}) + errors=[] + page.on("pageerror",lambda e:errors.append(str(e))) + page.add_init_script("""window.__nativeListeners=new Map(); + window.__nativeIntents=[];window.__actions=[]; + window.__JUCE__={backend:{ + emitEvent(name,payload){ + if(name==='arMixConsoleIntent')window.__nativeIntents.push(payload); + if(name==='arMixAction')window.__actions.push(payload);}, + addEventListener(name,callback){ + const old=window.__nativeListeners.get(name); + window.__nativeListeners.set(name,old? + payload=>{old(payload);callback(payload);}:callback);}}};""") + page.goto((out/"index.html").as_uri()) + page.wait_for_function("()=>window.__ARMIX_NATIVE_M2__?.enabled && window.ArSonMixNativeVocalThrow") + state=snapshot() + state["graph"]["capabilities"]["supportedOps"]+=["LOAD_INSERT","REMOVE_INSERT","MOVE_INSERT"] + emit(page,"arMixConsoleSnapshot",state) + if width<=500:page.locator("#bankSelect").select_option("0") + strip=page.locator('#tracks .strip[data-id="1"]') + strip.locator('.fx-pick.empty').first.click() + picker=page.locator("#fastResults [data-fast-native-throw]") + picker.wait_for(state="visible") + assert picker.count()==1,"exactly one Vocal Throw built-in picker option" + picker.click() + intents=page.evaluate("""()=>window.__nativeIntents.filter( + x=>x.operation==='LOAD_INSERT')""") + assert len(intents)==1,intents + assert intents[0]["payload"]["catalogId"]==ID + assert page.locator("#mxNativeVocalThrow").is_hidden(),"no editor before accepted insert" + state["graph"].update(revision="3",rosterRevision="3") + state["graph"]["channels"][0]["fxRackBypassed"]=False + state["graph"]["channels"][0]["inserts"].append({ + "id":INSTANCE,"catalogId":ID,"name":"ArSon Vocal Throw","bypassed":False}) + state["mixerSession"].update(routeRevision="3",rosterRevision="3", + channels=copy.deepcopy(state["graph"]["channels"])) + ack(page,state,intents[0]);emit(page,"arMixConsoleSnapshot",state) + row=strip.locator('.fxslot-row[data-insert-id="'+INSTANCE+'"]') + row.wait_for(state="visible") + page.keyboard.press("Escape") + row.locator('[data-action="openPlugin"]').click() + 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("#vtMode").input_value()=="2" + initial=last(page,"nativeThrowSnapshot") + page.wait_for_timeout(300) + assert last(page,"nativeThrowSnapshot")["requestId"]==initial["requestId"],\ + "snapshot polling overwrote outstanding request too early" + reply_snapshot(page,state,DEFAULTS) + 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 \ + 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" + page.screenshot(path="arsonmix-vocal-throw-"+str(width)+".png") + editor.screenshot(path="arsonmix-vocal-throw-editor-"+str(width)+".png") + if width==1366: + editor.locator("#vtMode").select_option("0") + edit=last(page,"nativeThrowSet") + assert edit["settings"]["mode"]==0 and edit["instanceId"]==INSTANCE + assert edit["channelId"]==SOURCE + emit(page,"arMixBuiltinThrowQueue",{"requestId":edit["requestId"],"status":"QUEUED"}) + emit(page,"arMixBuiltinThrowAck",{"requestId":edit["requestId"],"status":"APPLIED"}) + reply_snapshot(page,state,{**DEFAULTS,"mode":0},applied=edit["requestId"]) + assert editor.locator("#vtMode").input_value()=="0" + editor.locator("#vtThrow").click() + cue=last(page,"nativeThrowTrigger") + assert cue["instanceId"]==INSTANCE and cue["channelId"]==SOURCE + assert cue["slot"]==0 + emit(page,"arMixBuiltinThrowQueue",{"requestId":cue["requestId"],"status":"QUEUED"}) + emit(page,"arMixBuiltinThrowAck",{"requestId":cue["requestId"],"status":"APPLIED"}) + reply_snapshot(page,state,{**DEFAULTS,"mode":0},count=1,tail=True) + assert editor.locator("#vtCount").inner_text()=="1 throws" + assert editor.locator("#vtStatus").inner_text()=="ECHO TAIL" + # The next changed graph invalidates the old editor instance. + state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" + state["mixerSession"]["channels"]=copy.deepcopy(state["graph"]["channels"]) + emit(page,"arMixConsoleSnapshot",state) + assert editor.locator("#vtThrow").is_disabled() + editor.locator("#vtClose").click() + assert editor.is_hidden(),"standard close must dismiss editor" + assert not errors,(width,errors) + page.close() + browser.close() + print("PASS: ArSon Vocal Throw native picker/ACK/manual cue/compact editor in 2 viewports") + +if __name__=="__main__": + main() From 32e1cc4b5513fb6acbc8e539ec1714904a13365b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:27:08 +0700 Subject: [PATCH 025/124] ci(vocal-throw): one scoped Chromium FAT for actual approved editor and callback ACK --- .github/workflows/ui-smoke.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 093c32350..822b894fe 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -127,6 +127,32 @@ jobs: - name: Block incomplete product release only when preparing product review if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft && startsWith(github.head_ref, 'integration/product-') }} run: node scripts/check_console_puzzle.mjs --release + vocal-throw-preview: + name: Vocal Throw native editor desktop/mobile Chromium FAT + needs: quick + if: ${{ github.event_name == 'pull_request' && github.head_ref == 'feature/arson-vocal-throw-native-20261108' }} + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install Chromium for targeted Vocal Throw UI + run: | + python -m pip install playwright + python -m playwright install --with-deps chromium + - name: Check exact mixer picker, native ACK and editor in desktop/mobile + run: python tests/approved_native_vocal_throw_smoke.py + - name: Keep compact editor screenshot evidence + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: ArSonMix-Vocal-Throw-Desktop-Mobile-${{ github.run_id }} + path: arsonmix-vocal-throw-*.png + if-no-files-found: ignore + retention-days: 7 + operator-ux-fat: name: Operator UX real Chromium / native-assembled GUI (5 viewports) needs: quick From 3a00451f89bf5d87c7db527b131e1e05249f67ee Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:28:55 +0700 Subject: [PATCH 026/124] test(vocal-throw): increment graph revision when simulating FX-instance replacement --- tests/approved_native_vocal_throw_smoke.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index ea8421625..2e9006266 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -120,9 +120,11 @@ def main(): assert editor.locator("#vtStatus").inner_text()=="ECHO TAIL" # The next changed graph invalidates the old editor instance. state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" - state["mixerSession"]["channels"]=copy.deepcopy(state["graph"]["channels"]) + state["graph"].update(revision="4",rosterRevision="4") + state["mixerSession"].update(routeRevision="4",rosterRevision="4", + channels=copy.deepcopy(state["graph"]["channels"])) emit(page,"arMixConsoleSnapshot",state) - assert editor.locator("#vtThrow").is_disabled() + page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) editor.locator("#vtClose").click() assert editor.is_hidden(),"standard close must dismiss editor" assert not errors,(width,errors) From 1bf4290676ef534bd7c4b09476f64b4220da6b6e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:29:41 +0700 Subject: [PATCH 027/124] fix(vocal-throw): manual throw rejects stale silence instead of reporting empty echo --- engine/builtin_fx/VocalThrow.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index f85ea3af8..4f218c286 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -95,10 +95,10 @@ class VocalThrow final { // AUDIO: triggers the most recent word/phrase, preferring the latest // vocal end if the singer stopped within the last 700 ms. bool throwNow() noexcept { - if(!ready_||recorded_==0)return false; + if(!ready_||recorded_==0||lastSoundEnd_==0||clock_(rate_*.7); - const bool ended=lastSoundEnd_>0 && clock_>=lastSoundEnd_ && - clock_-lastSoundEnd_<=recent && quiet_>0; + if(clock_-lastSoundEnd_>recent)return false; // reject stale/silent cues + const bool ended=quiet_>0; return freezeAt(ended?lastSoundEnd_:clock_); } void processStereo(float* left,float* right,std::size_t frames) noexcept { From a5e2565e5dab3b209bda9968a5e7615466fda7cb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:29:55 +0700 Subject: [PATCH 028/124] test(vocal-throw): reject long-after-singing manual cue --- tests/builtin_vocal_throw_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 092b71739..e8261848b 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -96,6 +96,10 @@ static void manualAndDry(double rate) { check(peakL>.01f&&peakR>.005f); // Recorded stereo is preserved (same gain on both channels). check(peakL>peakR*1.4f); + noHeap.store(true); + const bool staleCue=fx.throwNow(); + noHeap.store(false); + check(!staleCue); // 700ms after last vocal: never report an empty throw } static void automaticAndHybrid(double rate) { VocalThrow fx;check(fx.prepare(rate)); From bb9ed6bc2fc07faf31e609aacadaab54a5763bbf Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:53:46 +0700 Subject: [PATCH 029/124] perf(vocal-throw): keep overlapping tails and optimize RT capture copy --- engine/builtin_fx/VocalThrow.h | 199 +++++++++++++++++++++------------ 1 file changed, 125 insertions(+), 74 deletions(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index 4f218c286..ec1d3af9e 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -73,8 +73,11 @@ class VocalThrow final { if(historyFrames>500000||freezeFrames>300000)return false; historyL_.assign(historyFrames,0.f); historyR_.assign(historyFrames,0.f); - freezeL_.assign(freezeFrames,0.f); - freezeR_.assign(freezeFrames,0.f); + // Two independent tails: new phrases never overwrite an active echo. + for(auto& voice:voices_) { + voice.freezeL.assign(freezeFrames,0.f); + voice.freezeR.assign(freezeFrames,0.f); + } rate_=rate;ready_=true;settings_=packet;reset(); return true; } @@ -88,7 +91,7 @@ class VocalThrow final { bool applyPrepared(const PreparedEdit& edit) noexcept { if(!ready_||!edit.valid||edit.sampleRate!=rate_|| !validSettings(edit.settings)||edit.intervalSamples==0|| - edit.captureSamples==0||edit.captureSamples>freezeL_.size()|| + edit.captureSamples==0||edit.captureSamples>voices_[0].freezeL.size()|| edit.silenceSamples==0)return false; settings_=edit;return true; } @@ -99,139 +102,187 @@ class VocalThrow final { const auto recent=static_cast(rate_*.7); if(clock_-lastSoundEnd_>recent)return false; // reject stale/silent cues const bool ended=quiet_>0; - return freezeAt(ended?lastSoundEnd_:clock_); + const bool accepted=freezeAt(ended?lastSoundEnd_:clock_); + if(accepted)manualInCurrentPhrase_=true; + return accepted; } void processStereo(float* left,float* right,std::size_t frames) noexcept { if(!ready_||!left||!right)return; const bool mono=left==right; + const std::uint32_t maxQuiet=static_cast(rate_); + const std::uint32_t phraseGap=static_cast(rate_*.06); + const std::uint32_t minVoice=static_cast(rate_*.08); for(std::size_t i=0;i(clock_%historyL_.size()); - historyL_[location]=dryL;historyR_[location]=dryR; + historyL_[writeIndex_]=dryL;historyR_[writeIndex_]=dryR; + if(++writeIndex_==historyL_.size())writeIndex_=0; ++clock_;recorded_=std::min(recorded_+1,historyL_.size()); const float peak=std::max(std::abs(dryL),std::abs(dryR)); - // Fast attack, slow release. Singing detector is independent of - // output echo, so feedback cannot self-trigger another phrase. const float coeff=peak>envelope_?envAttack_:envRelease_; envelope_=coeff*envelope_+(1.f-coeff)*peak; if(envelope_<1.0e-20f)envelope_=0.f; const bool singing=envelope_>=settings_.gateLinear; if(singing) { - if(quiet_>static_cast(rate_*.06))voiced_=0; + if(quiet_>phraseGap) { + voiced_=0; + manualInCurrentPhrase_=false; // genuinely new sung phrase + } quiet_=0; - voiced_=std::min(voiced_+1,static_cast(rate_)); + voiced_=std::min(voiced_+1,maxQuiet); lastSoundEnd_=clock_; - if(voiced_>=static_cast(rate_*.08))armed_=true; + if(voiced_>=minVoice)armed_=true; } else { - ++quiet_; + if(quiet_=settings_.silenceSamples) { - if(settings_.settings.mode!=0 && clock_>=nextAutoEligible_) { - const bool captured=freezeAt(lastSoundEnd_); - if(captured)nextAutoEligible_=clock_+ - static_cast(rate_*.4); + if(settings_.settings.mode!=0 && !manualInCurrentPhrase_ + && clock_>=nextAutoEligible_) { + if(freezeAt(lastSoundEnd_)) { + nextAutoEligible_=clock_+ + static_cast(rate_*.4); + } } armed_=false; } } - if(copyPending_)copyFrozenChunk(); // fixed real-time budget float echoL=0.f,echoR=0.f; - if(playing_) { - // A new manual throw replaces the old tail atomically. - // Each voice has a fixed offset in the captured buffer; - // multiple phrases may overlap at short note divisions. - for(int tap=0;tap(tap)]; + for(auto& voice:voices_) { + if(voice.copying)copyFrozenChunk(voice); + if(!voice.playing)continue; + // Fixed six-tap limit, constant time; voice owns its capture + // and scheduling packet even when BPM changes mid-tail. + for(int tap=0;tap(tap); + const std::uint64_t start=voice.repeatStarts[slot]; if(clock_<=start)continue; const std::uint64_t offset=clock_-start-1; - if(offset>=freezeCount_)continue; + if(offset>=voice.freezeCount)continue; float ramp=1.f; - const auto edge=static_cast(rate_*.004); - if(edge>0) { - ramp=std::min(ramp,static_cast(offset)/static_cast(edge)); - ramp=std::min(ramp,static_cast(freezeCount_-offset-1)/ - static_cast(edge)); + if(voice.edgeSamples>0) { + ramp=std::min(ramp,static_cast(offset)/ + static_cast(voice.edgeSamples)); + ramp=std::min(ramp,static_cast(voice.freezeCount-offset-1)/ + static_cast(voice.edgeSamples)); } const auto p=static_cast(offset); - const float gain=repeatGains_[static_cast(tap)]*std::max(0.f,ramp); - echoL+=freezeL_[p]*gain;echoR+=freezeR_[p]*gain; + const float gain=voice.repeatGains[slot]*std::max(0.f,ramp); + echoL+=voice.freezeL[p]*gain;echoR+=voice.freezeR[p]*gain; } - const auto end=repeatStarts_[static_cast(active_.settings.repeats-1)] - +freezeCount_; - if(clock_>end)playing_=false; + const auto end=voice.repeatStarts[ + static_cast(voice.active.settings.repeats-1)] + +voice.freezeCount; + if(clock_>end)voice.playing=false; } - const float target=singing?1.f-settings_.settings.ducking:1.f; - // Fixed 8-ms one-pole gain smoothing: no clicks on duck transitions. - duck_=duck_*duckCoeff_+target*(1.f-duckCoeff_); - left[i]=dryL+echoL*settings_.settings.wet*duck_; - if(!mono)right[i]=dryR+echoR*settings_.settings.wet*duck_; + // Slew wet level and ducking independently to avoid zipper + // noise on rapid GUI edits and the next vocal entrance. + const float duckTarget=singing?1.f-settings_.settings.ducking:1.f; + duck_=duck_*duckCoeff_+duckTarget*(1.f-duckCoeff_); + wetSmoothed_=wetSmoothed_*duckCoeff_+ + settings_.settings.wet*(1.f-duckCoeff_); + const float echoGain=wetSmoothed_*duck_; + left[i]=dryL+echoL*echoGain; + if(!mono)right[i]=dryR+echoR*echoGain; } } [[nodiscard]] bool ready() const noexcept{return ready_;} [[nodiscard]] VocalThrowSettings settingsForTests() const noexcept{return settings_.settings;} - [[nodiscard]] bool echoActive() const noexcept{return playing_;} + [[nodiscard]] bool echoActive() const noexcept{ + for(const auto& voice:voices_)if(voice.playing)return true; + return false; + } [[nodiscard]] unsigned throwCount() const noexcept{return throwCount_;} [[nodiscard]] double sampleRate() const noexcept{return rate_;} private: + struct TailVoice final { + std::vector freezeL,freezeR; + std::array repeatStarts{}; + std::array repeatGains{}; + PreparedEdit active{}; + std::uint64_t copyEnd=0,freezeCount=0; + std::size_t copyIndex=0,sourceIndex=0; + std::uint32_t edgeSamples=0; + bool copying=false,playing=false; + }; bool freezeAt(std::uint64_t end) noexcept { if(end==0||end>clock_||historyL_.empty())return false; + // Bounded polyphony: do not cut or overwrite an existing phrase. + // A full pool rejects a cue (and reports this via native ACK). + TailVoice* slot=nullptr; + for(auto& voice:voices_) { + if(!voice.playing&&!voice.copying){slot=&voice;break;} + } + if(!slot)return false; const auto available=std::min(end,recorded_); const auto count=std::min(available,settings_.captureSamples); if(count(rate_*.025))return false; - // No large memcpy in a 64/128-sample ASIO callback. Copy only a - // fixed number of stereo frames per processed sample before playback. - copyFrom_=end-count;copyEnd_=end;copyIndex_=0; - freezeCount_=count;active_=settings_; - playing_=false;copyPending_=true;++throwCount_; + slot->copyEnd=end; + slot->freezeCount=count; + slot->copyIndex=0; + slot->sourceIndex=static_cast((end-count)%historyL_.size()); + slot->edgeSamples=static_cast(rate_*.004); + slot->active=settings_; + slot->copying=true; + ++throwCount_; return true; } - void copyFrozenChunk() noexcept { - if(!copyPending_)return; - for(int n=0;n<24 && copyIndex_( - (copyFrom_+copyIndex_)%historyL_.size()); - const auto dest=static_cast(copyIndex_++); - freezeL_[dest]=historyL_[source];freezeR_[dest]=historyR_[source]; - } - if(copyIndex_!=freezeCount_)return; - copyPending_=false; - // The phrase-end interval is authoritative. If capture completion - // is later than the first repeat, begin on the next safe sample. - const auto first=std::max(clock_,copyEnd_+active_.intervalSamples); + void copyFrozenChunk(TailVoice& voice) noexcept { + // A fixed 24-frame budget each sample. Contiguous bulk copying + // replaces per-frame division/modulo in the former implementation. + const std::size_t left=static_cast(voice.freezeCount)-voice.copyIndex; + const std::size_t n=std::min({24,left, + historyL_.size()-voice.sourceIndex}); + std::copy_n(historyL_.data()+voice.sourceIndex,n, + voice.freezeL.data()+voice.copyIndex); + std::copy_n(historyR_.data()+voice.sourceIndex,n, + voice.freezeR.data()+voice.copyIndex); + voice.copyIndex+=n; + voice.sourceIndex+=n; + 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); float amplitude=1.f; - for(int tap=0;tap(tap); - repeatStarts_[slot]=first+ - static_cast(tap)*active_.intervalSamples; - repeatGains_[slot]=amplitude;amplitude*=active_.settings.decay; + voice.repeatStarts[slot]=first+ + static_cast(tap)*voice.active.intervalSamples; + voice.repeatGains[slot]=amplitude; + amplitude*=voice.active.settings.decay; } - playing_=true; + voice.playing=true; } void reset() noexcept { clock_=lastSoundEnd_=nextAutoEligible_=0; - recorded_=freezeCount_=0;copyFrom_=copyEnd_=copyIndex_=0; - voiced_=quiet_=0;armed_=playing_=copyPending_=false; + recorded_=writeIndex_=0; + voiced_=quiet_=0; + armed_=manualInCurrentPhrase_=false; envelope_=0.f;duck_=1.f;throwCount_=0; + wetSmoothed_=settings_.settings.wet; if(rate_>0) { envAttack_=static_cast(std::exp(-1./(rate_*.004))); envRelease_=static_cast(std::exp(-1./(rate_*.018))); duckCoeff_=static_cast(std::exp(-1./(rate_*.008))); } - repeatStarts_.fill(0);repeatGains_.fill(0.f); + for(auto& voice:voices_) { + voice.copyEnd=voice.freezeCount=0; + voice.copyIndex=voice.sourceIndex=0; + voice.edgeSamples=0; + voice.copying=voice.playing=false; + voice.repeatStarts.fill(0);voice.repeatGains.fill(0.f); + } std::fill(historyL_.begin(),historyL_.end(),0.f); std::fill(historyR_.begin(),historyR_.end(),0.f); } - PreparedEdit settings_{},active_{}; - std::vector historyL_,historyR_,freezeL_,freezeR_; - std::array repeatStarts_{}; - std::array repeatGains_{}; + PreparedEdit settings_{}; + std::vector historyL_,historyR_; + std::array voices_{}; std::uint64_t clock_=0,lastSoundEnd_=0,nextAutoEligible_=0; - std::size_t recorded_=0; - std::uint64_t freezeCount_=0,copyFrom_=0,copyEnd_=0,copyIndex_=0; + std::size_t recorded_=0,writeIndex_=0; std::uint32_t voiced_=0,quiet_=0; - float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f,duck_=1.f; + float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f; + float duck_=1.f,wetSmoothed_=.42f; double rate_=0.; unsigned throwCount_=0; - bool armed_=false,playing_=false,copyPending_=false,ready_=false; + bool armed_=false,manualInCurrentPhrase_=false,ready_=false; }; } // namespace armix::builtin_fx From bbe0e868c81f68f00e23fc54b5c03260e20d1221 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:54:49 +0700 Subject: [PATCH 030/124] test(vocal-throw): assert overlapping tails, bounded cues and manual-auto dedup --- tests/builtin_vocal_throw_test.cpp | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index e8261848b..ed5b98205 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -132,6 +132,75 @@ static void hybridEditAndNoHeap() { run(fx,0,0,200000,l,r); check(std::isfinite(l)&&std::isfinite(r)); } +// Two separate frozen phrases must coexist. A new cue must not chop the +// already sounding repeat. All fixtures run as 64/128-ish PCM chunks without +// any callback allocations, including at the highest allowed device rate. +static void twoTailsStayLive(double rate) { + VocalThrow reference,overlap; + check(reference.prepare(rate)&&overlap.prepare(rate)); + auto s=reference.settingsForTests(); + s.mode=0;s.bpm=200;s.division=1;s.repeats=3; + s.captureMs=300;s.silenceMs=120; + check(reference.resetUnpublished(s)&&overlap.resetUnpublished(s)); + float l=0.f,r=0.f; + auto both=[&](float input,int frames) { + run(reference,input,input*.5f,frames,l,r); + run(overlap,input,input*.5f,frames,l,r); + }; + both(.5f,static_cast(rate*.20)); + both(0.f,static_cast(rate*.10)); + noHeap.store(true); + const bool firstA=reference.throwNow(),firstB=overlap.throwNow(); + noHeap.store(false); + check(firstA&&firstB); + both(.4f,static_cast(rate*.12)); + both(0.f,static_cast(rate*.03)); + noHeap.store(true); + const bool second=overlap.throwNow(); + const bool saturated=overlap.throwNow(); + noHeap.store(false); + check(second&&!saturated); + check(overlap.throwCount()==2); + // From 0.45 to 0.485 s the second voice is preparing, and its first + // scheduled echo is still in the future. Output must be IDENTICAL to + // the reference's first tail, not abruptly muted by the second cue. + std::array refL{},refR{},mixL{},mixR{}; + float maxReference=0.f,maxOverlap=0.f; + const int compareFrames=static_cast(rate*.035); + for(int done=0;done(std::min(128,compareFrames-done)); + noHeap.store(true); + reference.processStereo(refL.data(),refR.data(),count); + overlap.processStereo(mixL.data(),mixR.data(),count); + noHeap.store(false); + for(std::size_t i=0;i.001f&&maxOverlap>.001f); + run(overlap,0.f,0.f,static_cast(rate*.8),l,r); + check(overlap.throwCount()==2); +} +static void manualOverrideSuppressesAuto() { + VocalThrow fx;check(fx.prepare(48000)); + auto s=fx.settingsForTests(); + s.mode=2;s.silenceMs=160;s.captureMs=250; + check(fx.resetUnpublished(s)); + float l=0.f,r=0.f; + run(fx,.5f,.25f,12000,l,r); // phrase 1 + run(fx,0.f,0.f,2400,l,r); // manual cue before auto silence timeout + noHeap.store(true); + const bool fired=fx.throwNow(); + noHeap.store(false); + check(fired&&fx.throwCount()==1); + run(fx,0.f,0.f,12000,l,r); + check(fx.throwCount()==1); // same phrase must not double-fire + run(fx,.5f,.25f,12000,l,r); // genuinely new phrase + run(fx,0.f,0.f,10000,l,r); + check(fx.throwCount()==2); +} int main() { validation(); manualAndDry(8000); @@ -140,5 +209,9 @@ int main() { automaticAndHybrid(8000); automaticAndHybrid(48000); hybridEditAndNoHeap(); + twoTailsStayLive(8000); + twoTailsStayLive(48000); + twoTailsStayLive(96000); + manualOverrideSuppressesAuto(); std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); } From 5cc440009907279535b16ecf0f4eeaf654a82d66 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:56:28 +0700 Subject: [PATCH 031/124] audio(vocal-throw): contain dense multi-tap wet peak without touching dry monitoring --- engine/builtin_fx/VocalThrow.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index ec1d3af9e..95f1d5b75 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -145,7 +145,7 @@ class VocalThrow final { armed_=false; } } - float echoL=0.f,echoR=0.f; + float echoL=0.f,echoR=0.f,activeTapGain=0.f; for(auto& voice:voices_) { if(voice.copying)copyFrozenChunk(voice); if(!voice.playing)continue; @@ -167,6 +167,7 @@ class VocalThrow final { const auto p=static_cast(offset); const float gain=voice.repeatGains[slot]*std::max(0.f,ramp); echoL+=voice.freezeL[p]*gain;echoR+=voice.freezeR[p]*gain; + activeTapGain+=gain; } const auto end=voice.repeatStarts[ static_cast(voice.active.settings.repeats-1)] @@ -179,7 +180,11 @@ class VocalThrow final { duck_=duck_*duckCoeff_+duckTarget*(1.f-duckCoeff_); wetSmoothed_=wetSmoothed_*duckCoeff_+ settings_.settings.wet*(1.f-duckCoeff_); - const float echoGain=wetSmoothed_*duck_; + // Concert-safe overlap headroom: many closely spaced taps, + // including two phrases, must not multiply the wet peak by 6x. + // No attenuation for ordinary nonoverlapping delays. + const float echoGain=(wetSmoothed_*duck_)/ + std::max(1.f,activeTapGain*wetSmoothed_); left[i]=dryL+echoL*echoGain; if(!mono)right[i]=dryR+echoR*echoGain; } From 29b92b79097a2bb060f0e2b47061f8ce4572f980 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:56:54 +0700 Subject: [PATCH 032/124] test(vocal-throw): bound dense overlap level at full wet --- tests/builtin_vocal_throw_test.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index ed5b98205..b734fc5a6 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -183,6 +183,26 @@ static void twoTailsStayLive(double rate) { run(overlap,0.f,0.f,static_cast(rate*.8),l,r); check(overlap.throwCount()==2); } +static void denseRepeatsStayBounded() { + VocalThrow fx;check(fx.prepare(48000)); + auto settings=fx.settingsForTests(); + settings.mode=0;settings.bpm=200;settings.division=1; + settings.repeats=6;settings.decay=.9f; + settings.captureMs=1200.f;settings.wet=1.f;settings.ducking=0.f; + check(fx.resetUnpublished(settings)); + float maxL=0.f,maxR=0.f; + run(fx,.75f,.6f,48000,maxL,maxR); + noHeap.store(true); + const bool fired=fx.throwNow(); + noHeap.store(false); + check(fired); + maxL=maxR=0.f; + run(fx,0.f,0.f,static_cast(48000*2.5),maxL,maxR); + check(maxL>.20f&&maxR>.10f); + // An exposed six-tap feedback-like burst must not produce >0dBFS + // solely because echo taps overlap (dry path is unchanged). + check(maxL<=.751f&&maxR<=.601f); +} static void manualOverrideSuppressesAuto() { VocalThrow fx;check(fx.prepare(48000)); auto s=fx.settingsForTests(); @@ -213,5 +233,6 @@ int main() { twoTailsStayLive(48000); twoTailsStayLive(96000); manualOverrideSuppressesAuto(); + denseRepeatsStayBounded(); std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); } From 63d86189102a04425c3f5d3282f004651e72c191 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:57:51 +0700 Subject: [PATCH 033/124] docs(vocal-throw): qualification evidence and RT/musical hardening contract --- docs/ARSON_VOCAL_THROW_NATIVE_20261108.md | 28 +++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md b/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md index d205881af..e39acc139 100644 --- a/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md +++ b/docs/ARSON_VOCAL_THROW_NATIVE_20261108.md @@ -6,12 +6,12 @@ This is a first-class native ChannelId insert in ArSonMix's single JUCE PCM rend ## Implemented -- **Manual:** rolling ring buffer holds up to 1.5 seconds of the most recent vocal. THROW captures a word or phrase and schedules up to six decaying repeats. +- **Manual:** rolling ring buffer holds up to 1.5 seconds of the most recent vocal. THROW captures a word or phrase and schedules up to six decaying repeats. Two independent tail voices allow a subsequent phrase to overlap an existing echo instead of cutting it. - **Auto:** energy envelope, minimum voice duration, silence threshold and cooldown detect the end of a sung phrase without letting the wet echo re-trigger itself. -- **Hybrid (default):** phrase-end automation and manual cue together. +- **Hybrid (default):** phrase-end automation and manual cue together, with manual-cue suppression of a subsequent auto event for the same phrase. - **Tempo:** BPM entry (60-200), TAP BPM, quarter/eighth/dotted-eighth/half note subdivisions. Interval timing is in native samples at the actual device rate. -- **Mix:** direct dry input with zero added samples, stereo echo, decay, short fades, and ducking while the singer is active. -- **Real-time:** all rolling/frozen buffers are allocated off-callback; a fixed 24-stereo-frame-per-sample capture copy budget avoids a single large callback memcpy. A lock-free SPSC transfers host settings and manual cue to the audio callback. Callback never allocates/logs/locks. +- **Mix:** direct dry input with zero added samples, stereo echo, decay, short fades, smoothed wet edits, and ducking while the singer is active. A bounded active-tap gain normalizer prevents dense repeats/overlapping phrases from amplifying the wet bus simply because taps stack; dry is never attenuated. +- **Real-time:** all rolling/frozen buffers are allocated off-callback; a fixed maximum 24-stereo-frame-per-sample capture copy budget per active tail avoids a single large callback memcpy. Contiguous copy chunks eliminate per-frame modulo, and the ring write cursor rolls over without division. A lock-free SPSC transfers host settings and manual cue to the audio callback. Callback never allocates/logs/locks. - **Identity & persistence:** stable native catalog ID; ChannelId, device epoch, graph revision, and insert instance fencing. DSP completed ACK and later readback precede accepted display. Schema-versioned 48-byte AVTH settings blob validated during Show restore; audio capture and tails are not persisted. - **UX:** a compact FX editor inside the exact approved /preview/ mixer; presets in header, uniform power/close, BPM/note/repeat, THROW, TAP and collapsible advanced controls. One shared FX stylesheet. @@ -23,7 +23,7 @@ Core files: engine/builtin_fx/VocalThrow.h (DSP), VocalThrowProcessor.h (JUCE), ## Tests / qualification -The ARMixNativeVocalThrowTests CTest covers zero-added-sample dry, tempo divisions, captured stereo echoes after manual cue, auto-end detection and no self-trigger, bad parameter rejection, 8/44.1/48 kHz sample rates and a global allocator guard around realtime processing. Python native picker/compiled-gui tests enforce no extra mixer screen and real-ACK event names. +The ARMixNativeVocalThrowTests CTest covers zero-added-sample dry, tempo divisions, captured stereo echoes after manual cue, auto-end detection and no self-trigger, bad parameter rejection, 8/44.1/48 kHz sample rates and a global allocator guard around realtime processing. Additional deterministic tests cover 8/48/96 kHz two-tail preservation during a second cue, a full two-tail pool reporting cue refusal rather than overwriting a running phrase, suppression of manual/auto double-cues, and peak containment of dense six-tap echoes. Python native picker/compiled-gui tests enforce no extra mixer screen and real-ACK event names. Before shipping: exact-SHA Windows MSVC + CTest, actual approved /preview/ Chromium screenshots, ASIO 64/128-frame stress at 44.1/48/96 kHz, live singer audition, device restart, bypass/tail behavior, and Show restore. @@ -31,10 +31,24 @@ Before shipping: exact-SHA Windows MSVC + CTest, actual approved /preview/ Chrom 1. **Automatic BPM analysis from the music/backing bus is not yet implemented.** Auto currently means automatic vocal phrase-end trigger, not auto-estimated music tempo. BPM is entered or TAP-derived. Full beat tracking requires an independent music-bus feed, beat confidence and phase tracking. 2. Voice end detector uses an adjustable energy-envelope heuristic, not linguistic speech recognition or a trained singing model. Breaths, falsetto and microphone bleed can cause false cues. -3. No MIDI footswitch binding, simultaneous phrase layers, stretchable echo phrases, global music BPM transport integration, or direct song-snapshot binding in this milestone. -4. Green quick CI is not equivalent to real Windows native compilation or ASIO device certification. +3. No MIDI footswitch binding, more than two simultaneous phrase layers, stretchable echo phrases, global music BPM transport integration, or direct song-snapshot binding in this milestone. When both frozen-tail slots are busy, further THROW requests are rejected (native ACK reports not applied) rather than cutting an existing musical phrase. +4. Green quick CI is not equivalent to real Windows native compilation or ASIO device certification. Zero reported PDC applies only to the FX DSP's dry path; end-to-end hardware/driver latency and callback CPU load still require ASIO measurements. 5. Existing channel routing and independent secondary audio clock remain authoritative; the FX insert makes no new claims about unresolved WIRE/SOURCE ONLY issues. ## Field test Insert ID armix.builtin.vocal-throw.v1 into real ChannelId vocal strip; confirm graph ACK; sing “atau tidak” then press THROW at 72/95/120/160 BPM; try Auto with varying held notes and short breaths; toggle bypass while dry vocal remains direct; change device/quantum and reject stale instance requests. Compare physical ASIO callback xruns, stereo/feedback, click-free fades and singer subjective quality. + +## 2026-11-08 — performance and musicality hardening audit + +Audit of the first native revision identified these concrete risks: +- Triggering a second phrase reset `playing_` and overwrote the frozen buffer of the first tail; audible repeat discontinuity was possible. +- The original capture copied 24 frames via two per-frame ring modulo operations; this was an avoidable callback hot-path cost. +- Hybrid manual cues could be followed by auto-trigger of the same sung phrase, producing unintended double repeats. +- Wet level changed immediately on edits; close-spaced six-tap feedback-like echoes could produce unnecessarily high wet peaks. + +Hardening: two independent frozen voices, bounded cue admission (explicit rejection if full), bulk contiguous ring capture, write cursor without modulo, continuous smoothing of wet/duck gain, current-phrase manual suppression of auto replay, and peak-aware wet overlap normalization. Silence counters are now saturating for multi-hour sessions. + +**Realtime caveats:** No heap, locks, logging or file operations in `processStereo`, `throwNow`, or parameter application. Worst-case processing still includes two simultaneous 24-frame copy budgets, and an up-to-twelve-tap mix; on low-buffer ASIO that requires measured xrun and callback-duration evidence, not just source inspection. Extra frozen buffer memory is allocated only on channels with this effect. A full two-voice pool intentionally rejects a new cue, so polyphony and cue policies should be evaluated with vocalist/operator tests. + +**Next release gates:** exact-SHA MSVC CTest and native JUCE compile, 64/128-frame ASIO at 44.1/48/96 kHz, overnight stability and lifecycle/device-rate restart, phrase-ending listening sessions including breath/bleed/falsetto, bypass/re-enable and FX graph routing, and latency/xrun baseline comparisons versus bypass. Beat tracking from an isolated backing/music bus (confidence, phase and half/double-time hysteresis) remains a separate architecture milestone, not an already delivered feature. From b2657cd0e6c56a69599162c56e6d81fd60ba23d5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 21:58:57 +0700 Subject: [PATCH 034/124] test(vocal-throw): clear dry fixture between PCM comparison blocks --- tests/builtin_vocal_throw_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index b734fc5a6..7ceb38934 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -133,7 +133,7 @@ static void hybridEditAndNoHeap() { check(std::isfinite(l)&&std::isfinite(r)); } // Two separate frozen phrases must coexist. A new cue must not chop the -// already sounding repeat. All fixtures run as 64/128-ish PCM chunks without +// already sounding repeat. All fixtures run as bounded PCM chunks without // any callback allocations, including at the highest allowed device rate. static void twoTailsStayLive(double rate) { VocalThrow reference,overlap; @@ -169,6 +169,7 @@ static void twoTailsStayLive(double rate) { const int compareFrames=static_cast(rate*.035); for(int done=0;done(std::min(128,compareFrames-done)); + refL.fill(0.f);refR.fill(0.f);mixL.fill(0.f);mixR.fill(0.f); noHeap.store(true); reference.processStereo(refL.data(),refR.data(),count); overlap.processStereo(mixL.data(),mixR.data(),count); From 2a7c6a6fc496529edbd065097cdd22fac9b4a574 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:20:58 +0700 Subject: [PATCH 035/124] test(vocal-throw): account for envelope release in hybrid rearm gate --- tests/builtin_vocal_throw_test.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 7ceb38934..5909505e9 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -219,8 +219,13 @@ static void manualOverrideSuppressesAuto() { run(fx,0.f,0.f,12000,l,r); check(fx.throwCount()==1); // same phrase must not double-fire run(fx,.5f,.25f,12000,l,r); // genuinely new phrase - run(fx,0.f,0.f,10000,l,r); - check(fx.throwCount()==2); + // The 18ms release envelope must fall below the voice gate BEFORE + // the 160ms silence threshold begins. 208ms total is insufficient + // with a sustained 0.5 peak and threshold -35dB. + run(fx,0.f,0.f,9000,l,r); + check(fx.throwCount()==1); // no premature false-positive throw + run(fx,0.f,0.f,5000,l,r); + check(fx.throwCount()==2); // new phrase, after full release + gate } int main() { validation(); From f6ad2d6be41def2451603fca09bba1d1cbc8447c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:24:51 +0700 Subject: [PATCH 036/124] fix(vocal-throw): reject late manual duplicate of auto-triggered vocal phrase --- engine/builtin_fx/VocalThrow.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index 95f1d5b75..308bda56c 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -102,6 +102,9 @@ class VocalThrow final { const auto recent=static_cast(rate_*.7); if(clock_-lastSoundEnd_>recent)return false; // reject stale/silent cues const bool ended=quiet_>0; + // Auto already threw this finished phrase. A late manual click must + // not produce a second identical echo in Hybrid mode. + if(ended && lastSoundEnd_==autoTriggeredPhraseEnd_)return false; const bool accepted=freezeAt(ended?lastSoundEnd_:clock_); if(accepted)manualInCurrentPhrase_=true; return accepted; @@ -127,6 +130,7 @@ class VocalThrow final { if(quiet_>phraseGap) { voiced_=0; manualInCurrentPhrase_=false; // genuinely new sung phrase + autoTriggeredPhraseEnd_=0; } quiet_=0; voiced_=std::min(voiced_+1,maxQuiet); @@ -138,6 +142,7 @@ class VocalThrow final { if(settings_.settings.mode!=0 && !manualInCurrentPhrase_ && clock_>=nextAutoEligible_) { if(freezeAt(lastSoundEnd_)) { + autoTriggeredPhraseEnd_=lastSoundEnd_; nextAutoEligible_=clock_+ static_cast(rate_*.4); } @@ -257,7 +262,7 @@ class VocalThrow final { voice.playing=true; } void reset() noexcept { - clock_=lastSoundEnd_=nextAutoEligible_=0; + clock_=lastSoundEnd_=nextAutoEligible_=autoTriggeredPhraseEnd_=0; recorded_=writeIndex_=0; voiced_=quiet_=0; armed_=manualInCurrentPhrase_=false; @@ -281,7 +286,7 @@ class VocalThrow final { PreparedEdit settings_{}; std::vector historyL_,historyR_; std::array voices_{}; - std::uint64_t clock_=0,lastSoundEnd_=0,nextAutoEligible_=0; + std::uint64_t clock_=0,lastSoundEnd_=0,nextAutoEligible_=0,autoTriggeredPhraseEnd_=0; std::size_t recorded_=0,writeIndex_=0; std::uint32_t voiced_=0,quiet_=0; float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f; From 4db384851e6f6378cca4fd037b744c98bd1f0ba3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:25:12 +0700 Subject: [PATCH 037/124] test(vocal-throw): manual-after-auto idempotence and next-phrase rearm --- tests/builtin_vocal_throw_test.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 5909505e9..28d6ea9b2 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -184,6 +184,27 @@ static void twoTailsStayLive(double rate) { run(overlap,0.f,0.f,static_cast(rate*.8),l,r); check(overlap.throwCount()==2); } +static void autoThenManualMustNotDoubleEcho() { + VocalThrow fx;check(fx.prepare(48000)); + auto s=fx.settingsForTests(); + s.mode=2;s.silenceMs=120;s.captureMs=250; + check(fx.resetUnpublished(s)); + float l=0.f,r=0.f; + run(fx,.5f,.25f,14400,l,r); + run(fx,0.f,0.f,12000,l,r); + check(fx.throwCount()==1); + noHeap.store(true); + const bool duplicated=fx.throwNow(); + noHeap.store(false); + check(!duplicated&&fx.throwCount()==1); + // A fresh phrase re-arms the manual path: previous auto trigger must + // not poison legitimate new cues when the singer starts again. + run(fx,.5f,.25f,12000,l,r); + noHeap.store(true); + const bool newPhrase=fx.throwNow(); + noHeap.store(false); + check(newPhrase&&fx.throwCount()==2); +} static void denseRepeatsStayBounded() { VocalThrow fx;check(fx.prepare(48000)); auto settings=fx.settingsForTests(); @@ -239,6 +260,7 @@ int main() { twoTailsStayLive(48000); twoTailsStayLive(96000); manualOverrideSuppressesAuto(); + autoThenManualMustNotDoubleEcho(); denseRepeatsStayBounded(); std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); } From f95b748928ad479e74b62347a4a2b5df7daf97be Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:53:46 +0700 Subject: [PATCH 038/124] feat(vocal-throw): bounded native music-channel onset monitor and control-only BPM estimator --- engine/core/NativeMusicTempoMonitor.h | 209 ++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 engine/core/NativeMusicTempoMonitor.h diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h new file mode 100644 index 000000000..e84e9d270 --- /dev/null +++ b/engine/core/NativeMusicTempoMonitor.h @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "../builtin_fx/FxSpsc.h" +#include "DynamicChannelRoster.h" +#include +#include +#include +#include +#include +#include + +// ArSon M2: source-specific music tempo observation inside the ONE installed +// ChannelId renderer. AUDIO only summarizes its explicitly selected music +// channel into 10ms energy frames and pushes a bounded SPSC. CONTROL owns all +// onset, pulse-correlation and tempo work. This is NOT a second audio engine. +namespace armix::mixer { +class MusicTempoEstimator final { +public: + struct Result final { + float bpm=0.f,confidence=0.f; + std::uint64_t beatAnchorTick=0,observationTick=0; + bool locked=false; + }; + void reset() noexcept { + previous_=floor_=0.f;count_=write_=0; + lastHit_=lastScan_=lastTick_=0; + stableCount_=0;candidateBpm_=0;result_={}; + } + void ingest(float energy,std::uint64_t tick) noexcept { + if(!std::isfinite(energy)||energy<0.f)energy=0.f; + if(lastTick_ && (tick<=lastTick_ || tick-lastTick_>4))reset(); + lastTick_=tick; + floor_+=.005f*(energy-floor_); + const float rise=energy-previous_; + // Attack transient only; sustained pads/bleed cannot retrigger + // 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)}; + write_=(write_+1)%hits_.size(); + count_=std::min(count_+1,hits_.size()); + lastHit_=tick; + } + previous_=energy; + if(result_.locked && tick>lastHit_+320) { + result_.locked=false;result_.confidence=0.f; + candidateBpm_=stableCount_=0; + } + if(tick>=lastScan_+50) { + lastScan_=tick; + evaluate(); + } + } + Result result() const noexcept {return result_;} +private: + struct Hit {std::uint64_t tick=0;float strength=0.f;}; + std::array hits_{}; + std::size_t count_=0,write_=0; + std::uint64_t lastHit_=0,lastScan_=0,lastTick_=0; + float previous_=0.f,floor_=0.f; + int stableCount_=0,candidateBpm_=0; + Result result_{}; + + void evaluate() noexcept { + if(count_<7 || lastTick_<300 || lastTick_>lastHit_+320)return; + const auto at=[&](std::size_t i) noexcept ->const Hit& { + return hits_[(write_+hits_.size()-count_+i)%hits_.size()]; + }; + if(at(count_-1).tick-at(0).tick<300)return; + int bestBpm=0; + float bestScore=0.f; + // 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) { + const float period=6000.f/static_cast(bpm); + float score=0.f; + for(std::size_t j=1;j1100)continue; + for(std::size_t i=j;i-->0;) { + const auto& earlier=at(i); + const float dt=static_cast(later.tick-earlier.tick); + if(dt>period*3.08f)break; + const int cycles=static_cast(std::lround(dt/period)); + if(cycles<1||cycles>3)continue; + const float tolerance=std::max(1.4f,.022f*period*cycles); + const float error=std::abs(dt-period*cycles); + if(error>=tolerance)continue; + const float strength=std::sqrt(earlier.strength*later.strength); + score+=strength*(1.f-error/tolerance)/ + (cycles==1?1.f:cycles==2?1.6f:2.25f); + } + } + if(score>bestScore) {bestScore=score;bestBpm=bpm;} + } + if(bestBpm==0 || bestScore<2.0f)return; + if(std::abs(bestBpm-candidateBpm_)<=2)++stableCount_; + else {candidateBpm_=bestBpm;stableCount_=1;} + // A proven lock resists transient alternate half/double-time peaks. + if(result_.locked && std::abs(bestBpm-result_.bpm)>5.f && + stableCount_<6)return; + if(stableCount_<3)return; + result_.bpm=static_cast(candidateBpm_); + 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; + std::uint64_t anchor=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;} + } + result_.beatAnchorTick=anchor; + result_.observationTick=lastTick_; + result_.locked=true; + } +}; + +class NativeMusicTempoMonitor final { +public: + struct State final { + ChannelId source{}; + std::uint64_t epoch=0,revision=0; + MusicTempoEstimator::Result tempo{}; + std::uint32_t dropped=0; + bool active=false; + }; + // CONTROL, only after checking this exact ChannelId exists in the + // accepted PCM graph and does not point at vocals, MAIN or MONITOR. + bool select(ChannelId id,std::uint64_t epoch,std::uint64_t revision, + double sampleRate) noexcept { + if(id.value && (!epoch||!revision||!std::isfinite(sampleRate)|| + sampleRate<8000.||sampleRate>192000.))return false; + source_.store(id.value,std::memory_order_relaxed); + epoch_.store(epoch,std::memory_order_relaxed); + revision_.store(revision,std::memory_order_relaxed); + window_.store(id.value? + static_cast(std::lround(sampleRate*.01)):0, + std::memory_order_relaxed); + config_.fetch_add(1,std::memory_order_release); + return true; + } + // 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, + std::uint64_t epoch,std::uint64_t revision) noexcept { + const auto generation=config_.load(std::memory_order_acquire); + if(audioGeneration_!=generation) { + audioGeneration_=generation; + bucketSamples_=0;energySum_=0.f;audioTick_=0; + } + if(!id.value||id.value!=source_.load(std::memory_order_relaxed)|| + epoch!=epoch_.load(std::memory_order_relaxed)|| + revision!=revision_.load(std::memory_order_relaxed)|| + !left||!right||frames<=0)return; + const auto window=window_.load(std::memory_order_relaxed); + if(window==0)return; + for(int i=0;i frames_{}; + MusicTempoEstimator estimator_{}; // CONTROL owner only + std::atomic source_{0},epoch_{0},revision_{0}; + std::atomic config_{0},window_{0},dropped_{0}; + // The following fields are AUDIO-thread exclusive. + std::uint32_t audioGeneration_=0,bucketSamples_=0; + float energySum_=0.f; + std::uint64_t audioTick_=0; + std::uint32_t controlGeneration_=0; // CONTROL only +}; +} // namespace armix::mixer From 3c5265938fc00d9d0db51549ac737f013055eda3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:54:21 +0700 Subject: [PATCH 039/124] feat(music-tempo): tap exactly one accepted ChannelId pre-FX inside native PCM renderer --- engine/core/DynamicNativeSessionPublisher.h | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index a4f3d6ac8..24c519140 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -2,6 +2,7 @@ #pragma once #include "DynamicPreparedMixerBlock.h" #include "DynamicConsoleRoutingView.h" +#include "NativeMusicTempoMonitor.h" #include "RealtimeRoutePublisher.h" #include "RealtimeRenderPermit.h" #include @@ -191,6 +192,10 @@ class DynamicNativeSessionPublisher final { // Snapshot ownership pins the M4 instance throughout this callback; // only control-thread retirement releases the shared owner. const auto dispatch=[&](ChannelId id,float* l,float* r,int n) noexcept { + // Analysis source is the installed ChannelId MUSIC PCM, before + // its VST rack; never microphone/echo/main unless explicitly + // selected and role-checked on CONTROL. No analysis on AUDIO. + musicTempo_.capture(id,l,r,n,snap->deviceEpoch,snap->graphRevision); const auto& acceptedFx=snap->prepared->fx; if(acceptedFx.render) acceptedFx.render(acceptedFx.context,id,l,r,n); @@ -203,6 +208,25 @@ class DynamicNativeSessionPublisher final { return ok; } + // CONTROL ONLY: choose an actual active backing input/GROUP/FX return. + // Preserve the one authoritative PCM graph and reject stale selectors. + bool setMusicTempoSource(std::uint64_t epoch,std::uint64_t revision, + ChannelId source,double sampleRate) noexcept { + const auto* p=publisher_.controlPrepared(epoch,revision); + if(!p)return false; + if(source.value) { + const auto* ch=p->routing.find(source); + if(!ch || (ch->role!=ChannelRole::input && + ch->role!=ChannelRole::group && + ch->role!=ChannelRole::fxReturn) || + !p->graph.channelScheduled(source))return false; + } + return musicTempo_.select(source,epoch,revision,sampleRate); + } + NativeMusicTempoMonitor::State pollMusicTempo(std::uint64_t epoch, + std::uint64_t revision) noexcept { + return musicTempo_.poll(epoch,revision); + } // CONTROL ONLY; pointer is valid until the next structural commit. // The caller must COPY needed fields before yielding the writer thread. // Future WebView event serializes this only after native ACK, never draft. @@ -289,6 +313,7 @@ class DynamicNativeSessionPublisher final { } private: Publisher publisher_; + NativeMusicTempoMonitor musicTempo_{}; std::atomic_flag rendering_=ATOMIC_FLAG_INIT; }; } // namespace armix::mixer From c7c62bb0495954ae1a8c3cd21de5ce26281c014a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:54:46 +0700 Subject: [PATCH 040/124] feat(music-tempo): source/epoch admission and control-only insert traversal --- src/LiveDryRoutingLab.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index 5a0a6ac62..28ec60e42 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -5,6 +5,7 @@ #include "../engine/core/MasterOutputMonoPolicy.h" #include "../engine/core/LiveChannelFxGraph.h" #include "../engine/core/DynamicChannelFxLeaseBank.h" +#include "../engine/core/NativeMusicTempoMonitor.h" #include "../engine/device/DeviceSessionTransitionPolicy.h" #include "../engine/core/NativeFxRackTransaction.h" #include "../engine/core/UnifiedLegacyProductionAdmission.h" @@ -1389,6 +1390,32 @@ class LiveDryRoutingLab final { return nativeAccepted_.setFxBypass(nativePublisher_,epochAtEdit, pcmRevision,target,slot,token,bypass); } + // Native music onset analysis has no secondary audio callback. A source + // selector is admitted only against the ACTIVE epoch/revision graph. + bool selectMusicTempoSource(std::uint64_t ep,std::uint64_t rev, + armix::mixer::ChannelId source,double sampleRate) noexcept { + if(!channelIdPhysicalPcmActive()||ep!=epoch()|| + rev!=nativeAccepted_.pcmRevision)return false; + return nativePublisher_.setMusicTempoSource(ep,rev,source,sampleRate); + } + armix::mixer::NativeMusicTempoMonitor::State pollMusicTempo() noexcept { + const auto ep=channelIdPhysicalPcmActive()?epoch():0; + return nativePublisher_.pollMusicTempo(ep,nativeAccepted_.pcmRevision); + } + // CONTROL traversal of the *published* insert owners. No audio-thread + // graph search or raw unmanaged pointers survive this synchronous call. + template + void forEachNativeProcessor(Callback&& visit) const { + if(!channelIdPhysicalPcmActive()||!nativeAccepted_.fxOwners)return; + for(const auto& ch:nativeAccepted_.graph.roster.channels()) { + const auto count=nativeAccepted_.fxOwners->insertCount(ch.id); + for(std::size_t slot=0;slotownerForControl(ch.id,slot); + if(owner && *owner && (*owner)->processor) + visit(ch.id,(*owner)->processor.get()); + } + } + } bool nativeChannelIsOriginalCh1(armix::mixer::ChannelId target) const noexcept { return nativeAccepted_.fxOwners && nativeAccepted_.fxOwners->externalChannel()==target && From 853785f427449df74362ed19a15c3829ee9cb0eb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:55:01 +0700 Subject: [PATCH 041/124] feat(music-tempo): expose verified native tempo tap to existing JUCE control thread --- src/LiveAudioEngine.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index bf3a78b34..987494379 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -1799,6 +1799,22 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback } } + bool selectNativeMusicTempoSource(std::uint64_t epoch,std::uint64_t revision, + armix::mixer::ChannelId musicChannel) noexcept { + auto* device=deviceManager_.getCurrentAudioDevice(); + if(!device||independent_.active()||!attached_||!directFence_.permitted()) + return false; + return dryRoutingLab_.selectMusicTempoSource(epoch,revision, + musicChannel,device->getCurrentSampleRate()); + } + armix::mixer::NativeMusicTempoMonitor::State pollNativeMusicTempo() noexcept { + return dryRoutingLab_.pollMusicTempo(); + } + template + void forEachNativeProcessor(Callback&& visit) const { + dryRoutingLab_.forEachNativeProcessor(std::forward(visit)); + } + // User-owned VST3 on a true dynamic ChannelId. Instantiation/scan/layout // work is CONTROL only; the callback receives an immutable fx lease. LiveDryRoutingLab::NativeBusResult installNativeVst3( From d8ce4dbd920ab4e6f2a94059720161cc59072b12 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:55:32 +0700 Subject: [PATCH 042/124] feat(vocal-throw): consume precomputed native music BPM interval with manual fallback --- engine/builtin_fx/VocalThrow.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/builtin_fx/VocalThrow.h b/engine/builtin_fx/VocalThrow.h index 308bda56c..0b0aaaee8 100644 --- a/engine/builtin_fx/VocalThrow.h +++ b/engine/builtin_fx/VocalThrow.h @@ -95,6 +95,12 @@ class VocalThrow final { edit.silenceSamples==0)return false; settings_=edit;return true; } + // AUDIO: incoming transport interval is already computed on CONTROL. + // A zero interval explicitly falls back to accepted song/TAP BPM. Each + // frozen tail keeps its interval when a backing track changes tempo. + void setMusicIntervalSamples(std::uint32_t samples) noexcept { + musicIntervalSamples_=samples; + } // AUDIO: triggers the most recent word/phrase, preferring the latest // vocal end if the singer stopped within the last 700 ms. bool throwNow() noexcept { @@ -231,6 +237,8 @@ class VocalThrow final { slot->sourceIndex=static_cast((end-count)%historyL_.size()); slot->edgeSamples=static_cast(rate_*.004); slot->active=settings_; + if(musicIntervalSamples_) + slot->active.intervalSamples=musicIntervalSamples_; slot->copying=true; ++throwCount_; return true; @@ -292,6 +300,7 @@ class VocalThrow final { float envelope_=0.f,envAttack_=0.f,envRelease_=0.f,duckCoeff_=0.f; float duck_=1.f,wetSmoothed_=.42f; double rate_=0.; + std::uint32_t musicIntervalSamples_=0; unsigned throwCount_=0; bool armed_=false,manualInCurrentPhrase_=false,ready_=false; }; From 014c83ab851819c7206209bd7f124811ba1805bd Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:55:35 +0700 Subject: [PATCH 043/124] feat(vocal-throw): consume precomputed native music BPM interval with manual fallback --- engine/builtin_fx/VocalThrowProcessor.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index 42f2b4af1..c1a7ee1a6 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -48,11 +48,17 @@ class VocalThrowProcessor final : public juce::AudioProcessor, ready_=core_.prepare(sampleRate)&&core_.resetUnpublished(accepted_); if(ready_)rate_=sampleRate; } - void releaseResources() override{ready_=false;} + void releaseResources() override{ + ready_=false;musicInterval_.store(0,std::memory_order_release); + } void processBlock(juce::AudioBuffer& pcm,juce::MidiBuffer&) override { juce::ScopedNoDenormals noDenormals; if(!ready_||pcm.getNumChannels()<2||pcm.getNumSamples()<=0)return; consumeRealtimeEdits(); + // Transport is published by CONTROL as an already prepared sample + // interval; AUDIO performs only one atomic read at the block edge. + core_.setMusicIntervalSamples( + musicInterval_.load(std::memory_order_acquire)); core_.processStereo(pcm.getWritePointer(0),pcm.getWritePointer(1), static_cast(pcm.getNumSamples())); observedThrows_.store(core_.throwCount(),std::memory_order_relaxed); @@ -66,6 +72,18 @@ class VocalThrowProcessor final : public juce::AudioProcessor, core_.applyPrepared(e.prepared):core_.throwNow(); (void)done_.push({e.id,e.prepared.settings,e.kind,applied}); } + // CONTROL-thread song/auto BPM, deliberately independent of accepted + // serialized preset BPM. No queue ACK storm or GUI state overwrite. + void publishMusicBpm(float bpm) noexcept { + if(!ready_||!std::isfinite(bpm)||bpm<60.f||bpm>200.f) { + musicInterval_.store(0,std::memory_order_release);return; + } + auto settings=accepted_;settings.bpm=bpm; + VocalThrow::PreparedEdit packet{}; + const auto valid=VocalThrow::prepareEdit(settings,rate_,packet); + musicInterval_.store(valid?packet.intervalSamples:0, + std::memory_order_release); + } 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; @@ -144,6 +162,7 @@ class VocalThrowProcessor final : public juce::AudioProcessor, FxSpsc done_{}; VocalThrowSettings accepted_{}; std::atomic observedThrows_{0}; + std::atomic musicInterval_{0}; std::atomic observedTail_{false}; double rate_=0.; bool ready_=false,published_=false; From 91bfdca7d1c03364361b5b4f226443a672ec5f4a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:56:33 +0700 Subject: [PATCH 044/124] feat(vocal-throw): native music-source selector, tempo polling and DSP fanout --- src/Main.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 6d65d072e..9033e4752 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -399,6 +399,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr } pendingNativeThrow_; juce::String lastNativeThrowRequest_,lastNativeThrowInstance_; juce::String lastNativeThrowEpoch_,lastNativeThrowRevision_; + armix::mixer::NativeMusicTempoMonitor::State lastMusicTempo_{}; std::unique_ptr editorWindow_; std::unique_ptr audioSetupWindow_; juce::String startupError_, lastAudioXml_; @@ -1882,6 +1883,17 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr reply->setProperty("status",processor?"ACCEPTED":"REJECTED"); if(processor) { reply->setProperty("sampleRate",processor->acceptedSampleRate()); + // Accepted native source and analyzer readback; never invent an + // AUTO lock from the manual BPM text field. + reply->setProperty("musicSourceChannelId", + juce::String(std::to_string(lastMusicTempo_.source.value))); + reply->setProperty("musicSourceActive",lastMusicTempo_.active); + reply->setProperty("musicLocked",lastMusicTempo_.active&& + lastMusicTempo_.tempo.locked); + reply->setProperty("musicBpm",lastMusicTempo_.tempo.bpm); + reply->setProperty("musicConfidence",lastMusicTempo_.tempo.confidence); + reply->setProperty("musicDroppedFrames", + static_cast(lastMusicTempo_.dropped)); juce::Array bands; for(const auto& band:processor->acceptedBands()){ auto item=std::make_unique(); @@ -2017,6 +2029,21 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr "arMixBuiltinCompAck",juce::var(ack.release())); } + // CONTROL ONLY: drain at most 512 ten-ms music summary frames per 12Hz + // host tick. The actual music audio was tapped inside the existing PCM + // graph; BPM/onset analysis never touches the ASIO callback. All live + // 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]( + armix::mixer::ChannelId,juce::AudioProcessor* p) { + if(auto* vocal=dynamic_cast(p)) + vocal->publishMusicBpm(bpm); + }); + } + // Native Vocal Throw settings, manual cue and auto-trigger readback. // Settings and triggers are not accepted until the AUDIO-owned SPSC // completion is drained on JUCE's message thread. @@ -2364,7 +2391,8 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr action == "routingNativeFxInsertBypass" || action == "routingFxRackBypass" || action == "nativeEqSetBand" || action == "nativeCompSet" || - action == "nativeThrowSet" || action == "nativeThrowTrigger")) + action == "nativeThrowSet" || action == "nativeThrowTrigger" || + action == "nativeThrowTempoSource")) { const auto reason=juce::String( "Studio backup in progress. Finish backup before editing saved FX or VST library."); @@ -2597,7 +2625,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // ArSon Vocal Throw: all UI commands reference one exact installed // ChannelId + device epoch + graph revision + insert instance. if(action=="nativeThrowSnapshot"||action=="nativeThrowSet"|| - action=="nativeThrowTrigger") { + action=="nativeThrowTrigger"||action=="nativeThrowTempoSource") { const auto rawChannel=args.getProperty("channelId",{}); const auto rawEpoch=args.getProperty("deviceEpoch",{}); const auto rawRevision=args.getProperty("graphRevision",{}); @@ -2623,6 +2651,29 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr rawInstance.toString(),processor); return; } + if(action=="nativeThrowTempoSource") { + // A single shared song clock is selected by stable ChannelId; + // the source cannot be this vocal channel, MAIN or MONITOR. + const auto rawSource=args.getProperty("sourceChannelId",{}); + const auto sourceText=rawSource.toString(); + std::uint64_t source=0; + const bool parsed=sourceText=="0" || + armix::console::approvedNativeId(rawSource,source); + const bool chosen=processor && parsed && (!source||source!=ch) && + !nativeShowBusy_&&!studioBackupBusy_ && + engine_.selectNativeMusicTempoSource( + ep,rev,armix::mixer::ChannelId{source}); + if(chosen)serviceNativeMusicTempo(); + auto reply=std::make_unique(); + reply->setProperty("requestId",request); + reply->setProperty("status",chosen?"APPLIED":"REJECTED"); + reply->setProperty("sourceChannelId",sourceText); + reply->setProperty("errorCode",chosen?"NONE": + "INVALID_OR_STALE_MUSIC_CHANNEL"); + if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( + "arMixBuiltinThrowTempoAck",juce::var(reply.release())); + return; + } const auto wire=request.startsWith("throw-")? request.substring(6).toStdString():std::string(); std::uint64_t numeric=0; @@ -4573,6 +4624,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr guiPerf_.prevTickMs = tickStart; } ++timerTicks_; + serviceNativeMusicTempo(); servicePendingNativeEq(); servicePendingNativeComp(); servicePendingNativeThrow(); From f11b0b59ef3933c9c836de7aedaac31fc5351053 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:58:12 +0700 Subject: [PATCH 045/124] ui(vocal-throw): compact native music source and lock status controls --- .../assets/mixer-native-vocal-throw.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index f24859635..3551cb9e8 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -37,6 +37,7 @@ panel.innerHTML=[ '
', '
', '
', + '
Manual BPM fallback
', '
', '
Native DSP · waiting for accepted channel
', '
Phrase & echo shaping
', @@ -54,6 +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"; 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]; @@ -62,6 +64,31 @@ const context=()=>{ deviceEpoch:state.device.epoch,graphRevision:state.graph.revision}; }; const hint=text=>{$("vtHint").textContent=text;}; +function refreshMusicChannels(){ + const state=snapshot(),ctx=context(),selector=$("vtMusicSource"); + const selected=tempoPending?.source||musicSource; + const candidates=(state?.graph?.channels||[]).filter(ch=> + ch&&ch.id&&String(ch.id)!==String(ctx?.channelId)&& + ["INPUT","GROUP","FX_RETURN","FXRETURN"].includes( + String(ch.role||"").toUpperCase().replaceAll("-","_"))); + selector.replaceChildren(new Option("Manual / TAP","0")); + for(const ch of candidates)selector.add(new Option( + String(ch.name||ch.id).slice(0,45),String(ch.id))); + if([...selector.options].some(x=>x.value===String(selected))) + selector.value=String(selected); + else selector.value="0"; + 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 · "+confidence+"% confidence"; +} 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]; From 1339cb66092a1f984c92d94e6c51cb06b61e60f6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:58:31 +0700 Subject: [PATCH 046/124] ui(vocal-throw): verified backing-source selection, ACK and real BPM status --- .../assets/mixer-native-vocal-throw.js | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 3551cb9e8..46bb46cfe 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -145,6 +145,15 @@ for(const key of Object.keys(fields)){ }); input.addEventListener("change",()=>send("nativeThrowSet")); } +$("vtMusicSource").addEventListener("change",()=>{ + const ctx=context(),source=String($("vtMusicSource").value); + if(!ctx||!native()||tempoPending){refreshMusicChannels();return;} + const requestId="tempo-"+Date.now()+"-"+(++seq); + tempoPending={requestId,source,created:Date.now()}; + backend().emitEvent("arMixAction",{ + action:"nativeThrowTempoSource",requestId,sourceChannelId:source,...ctx}); + renderMusicStatus();refreshMusicChannels(); +}); $("vtPreset").addEventListener("change",()=>{ const p=presets[$("vtPreset").value];if(!p)return; draft={...p};paint();send("nativeThrowSet"); @@ -166,7 +175,7 @@ $("vtPower").addEventListener("click",()=>{ if(current&&context())window.__ARMIX_NATIVE_M2__?.consumeAction?.( current.track,"slotPower",{dataset:{slot:String(current.slot)}}); }); -$("vtClose").addEventListener("click",()=>{panel.hidden=true;pending=null;readId="";}); +$("vtClose").addEventListener("click",()=>{panel.hidden=true;pending=null;tempoPending=null;readId="";}); window.addEventListener("keydown",e=>{ if(e.key==="Escape"&&!panel.hidden){panel.hidden=true;pending=null;readId="";} }); @@ -187,7 +196,7 @@ window.ArSonMixNativeVocalThrow=Object.freeze({ id:ID, insert(target){return Boolean(window.__ARMIX_NATIVE_M2__?.insertPlugin?.(ID,target));}, open(track,slot){ - current={track,slot,instanceId:null};pending=null;readId=""; + current={track,slot,instanceId:null};pending=null;tempoPending=null;musicSource="0";readId=""; const state=snapshot(),id=window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(track); const insert=state?.graph?.channels?.find(ch=>ch.id===id)?.inserts?.[slot]; if(native()&&state?.admitted&&insert?.catalogId===ID&&insert.id){ @@ -197,10 +206,19 @@ window.ArSonMixNativeVocalThrow=Object.freeze({ hint("Browser preview only · no PCM");} else hint("Native FX instance unavailable"); $("vtChannel").textContent=track.name||"CH"; - panel.hidden=false;paint();requestSnapshot(true); + panel.hidden=false;paint();refreshMusicChannels();requestSnapshot(true); }, close(){panel.hidden=true;} }); +backend()?.addEventListener?.("arMixBuiltinThrowTempoAck",reply=>{ + if(!tempoPending||reply?.requestId!==tempoPending.requestId)return; + if(reply.status==="APPLIED"){ + musicSource=tempoPending.source; + hint("Music tempo source accepted by native PCM graph"); + }else hint("Tempo source rejected · "+(reply.errorCode||"STALE")); + tempoPending=null;refreshMusicChannels();renderMusicStatus(); + requestSnapshot(true); +}); backend()?.addEventListener?.("arMixBuiltinThrowQueue",reply=>{ if(!pending||reply?.requestId!==pending.requestId)return; if(reply.status==="REJECTED"){hint("DSP rejected · "+(reply.errorCode||"STALE")); @@ -222,6 +240,10 @@ backend()?.addEventListener?.("arMixBuiltinThrowSnapshot",reply=>{ reply.instanceId!==ctx.instanceId||reply.deviceEpoch!==ctx.deviceEpoch|| reply.graphRevision!==ctx.graphRevision||!valid(reply.settings)|| reply.addedLatencySamples!==0){hint("Stale FX graph · reopen editor");return;} + if(reply.musicSourceChannelId!==undefined) { + musicSource=String(reply.musicSourceChannelId||"0"); + refreshMusicChannels();renderMusicStatus(reply); + } $("vtCount").textContent=String(reply.throwCount||0)+" throws"; $("vtDot").classList.toggle("active",reply.tailActive===true); $("vtStatus").textContent=reply.tailActive?"ECHO TAIL":"NATIVE DSP"; @@ -234,12 +256,18 @@ backend()?.addEventListener?.("arMixBuiltinThrowSnapshot",reply=>{ }); backend()?.addEventListener?.("arMixConsoleSnapshot",()=>{ if(panel.hidden)return; - if(native()&&!context()){pending=null;hint("FX graph changed · reopen");} - syncPower(); + if(native()&&!context()){ + pending=null;tempoPending=null; + hint("FX graph changed · reopen"); + } + refreshMusicChannels();syncPower(); }); window.setInterval(()=>{ if(panel.hidden)return; if(pending&&Date.now()-pending.created>3500){hint("DSP ACK timeout");pending=null;} + if(tempoPending&&Date.now()-tempoPending.created>3500){ + hint("Tempo source ACK timeout");tempoPending=null;refreshMusicChannels(); + } if(native())requestSnapshot(); syncPower(); },250); From 00a16e2ea655236101c21e5aa604d17aa00f428b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:58:41 +0700 Subject: [PATCH 047/124] style(vocal-throw): compact source and auto BPM state in approved FX editor --- site/preview-v2/assets/mixer-fx-rack.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index 998e29db4..a8b968fe9 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -411,6 +411,10 @@ .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 .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} From 920d9498958008b2f0daca55868f36c709230273 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:59:46 +0700 Subject: [PATCH 048/124] test(music-tempo): real PCM tap, BPM rhythm, holdover and stale-graph no-heap --- tests/native_music_tempo_test.cpp | 92 +++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 tests/native_music_tempo_test.cpp diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp new file mode 100644 index 000000000..8253673ed --- /dev/null +++ b/tests/native_music_tempo_test.cpp @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#include "../engine/core/NativeMusicTempoMonitor.h" +#include +#include +#include +#include +#include +#include +#include +#define check(x) do {if(!(x)){std::fprintf(stderr,"FAIL:%s:%d %s\n",__FILE__,__LINE__,#x);std::abort();}}while(false) +static std::atomic noHeap{false}; +void* operator new(std::size_t n) { + if(noHeap.load(std::memory_order_relaxed))std::abort(); + if(void* p=std::malloc(n?n:1))return p; + throw std::bad_alloc(); +} +void* operator new[](std::size_t n) { + if(noHeap.load(std::memory_order_relaxed))std::abort(); + if(void* p=std::malloc(n?n:1))return p; + throw std::bad_alloc(); +} +void operator delete(void* p) noexcept {std::free(p);} +void operator delete[](void* p) noexcept {std::free(p);} +void operator delete(void* p,std::size_t) noexcept {std::free(p);} +void operator delete[](void* p,std::size_t) noexcept {std::free(p);} +using armix::mixer::ChannelId; +using armix::mixer::NativeMusicTempoMonitor; +static void renderWindow(NativeMusicTempoMonitor& tap,int index,int period, + float beat=.7f,bool weakOffbeats=false, + std::uint64_t epoch=7,std::uint64_t revision=13) { + std::array l{},r{}; + const int pos=index%period; + const float level=pos==0?beat: + weakOffbeats&&pos==period/2?.07f:0.f; + 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); + tap.capture(ChannelId{301},l.data(),r.data(),64,epoch,revision); + 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 +} +static void lockTempo(int bpm,bool hats=false) { + NativeMusicTempoMonitor tap; + check(!tap.select(ChannelId{301},7,13,0)); + check(tap.select(ChannelId{301},7,13,10000)); + auto state=tap.poll(7,13); + check(state.active&&state.source.value==301&&!state.tempo.locked); + const int period=static_cast(std::lround(6000.0/bpm)); + for(int n=0;n<1100;++n)renderWindow(tap,n,period,.75f,hats); + state=tap.poll(7,13); + check(state.tempo.locked); + check(std::abs(state.tempo.bpm-bpm)<=3.1f); + check(state.tempo.confidence>=.28f); + check(state.tempo.beatAnchorTick>0); + 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); + state=tap.poll(7,13); + check(state.tempo.locked); + // The user must see manual/TAP fallback after >3.2s of silence. + for(int n=1200;n<1580;++n)renderWindow(tap,n,6000); + state=tap.poll(7,13); + check(!state.tempo.locked); +} +static void failClosed() { + NativeMusicTempoMonitor tap; + check(tap.select(ChannelId{301},7,13,48000)); + std::array pcm{};pcm.fill(.8f); + noHeap.store(true); + for(int i=0;i<240;++i) { + // Wrong channel and wrong graph revision must not populate the FIFO. + tap.capture(ChannelId{302},pcm.data(),pcm.data(),128,7,13); + tap.capture(ChannelId{301},pcm.data(),pcm.data(),128,7,14); + } + noHeap.store(false); + auto stale=tap.poll(7,14); + check(!stale.active&&!stale.tempo.locked); + auto active=tap.poll(7,13); + check(active.active&&!active.tempo.locked); + check(tap.select(ChannelId{},7,13,0)); + check(!tap.poll(7,13).active); +} +int main() { + lockTempo(72); + lockTempo(95); + lockTempo(120); + lockTempo(160); + lockTempo(120,true); + failClosed(); + std::puts("PASS: native music-channel BPM 72/95/120/160, silence holdover, stale graph, no RT heap"); +} From 2254afc0e71f89788aa3aed31aaab3060fbadcf8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 22:59:56 +0700 Subject: [PATCH 049/124] build(music-tempo): register deterministic native CTest in existing Windows lane --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c1702fae..af792fd07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -384,6 +384,12 @@ if(BUILD_TESTING) target_compile_features(ARMixNativeVocalThrowTests PRIVATE cxx_std_20) add_test(NAME NativeVocalThrowPhraseCaptureManualAutoAndNoHeap COMMAND ARMixNativeVocalThrowTests) add_dependencies(ARMixMixerRoutingTests ARMixNativeVocalThrowTests) + add_executable(ARMixNativeMusicTempoTests tests/native_music_tempo_test.cpp + engine/core/NativeMusicTempoMonitor.h) + target_compile_features(ARMixNativeMusicTempoTests PRIVATE cxx_std_20) + add_test(NAME NativeMusicTempoSourceOnsetsAndFallback COMMAND ARMixNativeMusicTempoTests) + add_dependencies(ARMixMixerRoutingTests ARMixNativeMusicTempoTests) + add_executable(ARMixNativeMasterLoudnessTests tests/native_master_loudness_test.cpp engine/dsp/NativeMasterLoudness.h) target_compile_features(ARMixNativeMasterLoudnessTests PRIVATE cxx_std_20) From 699a0e03971b35ba33040b1013ab446c9d49225a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:00:25 +0700 Subject: [PATCH 050/124] fix(music-tempo): rebind valid source safely across native graph revisions --- engine/core/NativeMusicTempoMonitor.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engine/core/NativeMusicTempoMonitor.h b/engine/core/NativeMusicTempoMonitor.h index e84e9d270..81560fa3d 100644 --- a/engine/core/NativeMusicTempoMonitor.h +++ b/engine/core/NativeMusicTempoMonitor.h @@ -144,6 +144,23 @@ class NativeMusicTempoMonitor final { config_.fetch_add(1,std::memory_order_release); return true; } + // CONTROL: harmless structural WIRE/FX commits should preserve a valid + // music source. If the selected channel disappears, fall back to manual + // immediately rather than capturing stale processor/graph PCM. + ChannelId selectedSource() const noexcept { + return ChannelId{source_.load(std::memory_order_relaxed)}; + } + void onGraphCommitted(std::uint64_t epoch,std::uint64_t previousRevision, + std::uint64_t revision,bool retained) noexcept { + if(!selectedSource().value)return; + if(!retained || epoch_.load(std::memory_order_relaxed)!=epoch || + revision_.load(std::memory_order_relaxed)!=previousRevision) { + (void)select(ChannelId{},epoch,revision,0); + return; + } + revision_.store(revision,std::memory_order_relaxed); + config_.fetch_add(1,std::memory_order_release); + } // 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, From ad599a8a27f36dece0ed736a5b47a972d4026bab Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:00:37 +0700 Subject: [PATCH 051/124] fix(music-tempo): preserve validated music ChannelId across WIRE/FX commits --- engine/core/DynamicNativeSessionPublisher.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index 24c519140..a2246c308 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -125,8 +125,23 @@ class DynamicNativeSessionPublisher final { const auto status=publisher_.publish(std::move(next), expectedRevision,activeDeviceEpoch); switch(status) { - case Publisher::Result::applied: + case Publisher::Result::applied: { + const auto source=musicTempo_.selectedSource(); + if(source.value) { + const auto* published=publisher_.controlPrepared( + proposedDeviceEpoch,expectedRevision+1); + const auto* channel=published? + published->routing.find(source):nullptr; + const bool retained=published&&channel&& + (channel->role==ChannelRole::input|| + channel->role==ChannelRole::group|| + channel->role==ChannelRole::fxReturn)&& + published->graph.channelScheduled(source); + musicTempo_.onGraphCommitted(proposedDeviceEpoch, + expectedRevision,expectedRevision+1,retained); + } report.revision=expectedRevision+1;return report; + } case Publisher::Result::staleDevice: report.fault=Fault::staleDevice;break; case Publisher::Result::staleRevision: From 7e80f00d71e80bd992c8b3c455c1dcd7eeaeb249 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:01:24 +0700 Subject: [PATCH 052/124] test(vocal-throw-ui): native music-source ACK and live BPM readback desktop/mobile --- tests/approved_native_vocal_throw_smoke.py | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 2e9006266..8ac628731 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -6,7 +6,7 @@ from pathlib import Path import tempfile from playwright.sync_api import sync_playwright -from approved_native_wire_gain_smoke import snapshot, emit, ack, SOURCE +from approved_native_wire_gain_smoke import snapshot, emit, ack, SOURCE, RECEIVER ROOT=Path(__file__).resolve().parents[1] ID="armix.builtin.vocal-throw.v1" @@ -20,13 +20,18 @@ def last(page,action): assert records, "No "+action+" event" return records[-1] -def reply_snapshot(page,state,settings,applied=None,count=0,tail=False): +def reply_snapshot(page,state,settings,applied=None,count=0,tail=False,music=None): act=last(page,"nativeThrowSnapshot") data={"requestId":act["requestId"],"channelId":SOURCE,"slot":0, "instanceId":INSTANCE,"status":"ACCEPTED","schemaVersion":1, "deviceEpoch":state["device"]["epoch"], "graphRevision":state["graph"]["revision"],"sampleRate":48000, "addedLatencySamples":0,"throwCount":count,"tailActive":tail, + "musicSourceChannelId":music["source"] if music else "0", + "musicSourceActive":bool(music), + "musicLocked":bool(music), + "musicBpm":music["bpm"] if music else 0, + "musicConfidence":music["confidence"] if music else 0, "settings":copy.deepcopy(settings)} if applied:data["appliedRequestId"]=applied emit(page,"arMixBuiltinThrowSnapshot",data) @@ -125,6 +130,21 @@ def main(): channels=copy.deepcopy(state["graph"]["channels"])) emit(page,"arMixConsoleSnapshot",state) page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) + # Real native tempo-source command (not a browser-only BPM guess). + source_menu=editor.locator("#vtMusicSource") + assert source_menu.locator('option[value="'+RECEIVER+'"]').count()==1 + source_menu.select_option(RECEIVER) + request=last(page,"nativeThrowTempoSource") + assert request["sourceChannelId"]==RECEIVER and request["channelId"]==SOURCE + assert editor.locator("#vtMusicStatus").inner_text().startswith("Validating") + emit(page,"arMixBuiltinThrowTempoAck",{ + "requestId":request["requestId"],"status":"APPLIED", + "sourceChannelId":RECEIVER}) + 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}) + assert "AUTO 120 BPM" in editor.locator("#vtMusicStatus").inner_text() editor.locator("#vtClose").click() assert editor.is_hidden(),"standard close must dismiss editor" assert not errors,(width,errors) From d6daf5df4ef1b29fe7c43eb6da09edcdae1eb341 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:01:42 +0700 Subject: [PATCH 053/124] test(vocal-throw): verify tempo ACK before exercising stale FX instance --- tests/approved_native_vocal_throw_smoke.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 8ac628731..19783aa9a 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -123,13 +123,6 @@ def main(): reply_snapshot(page,state,{**DEFAULTS,"mode":0},count=1,tail=True) assert editor.locator("#vtCount").inner_text()=="1 throws" assert editor.locator("#vtStatus").inner_text()=="ECHO TAIL" - # The next changed graph invalidates the old editor instance. - state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" - state["graph"].update(revision="4",rosterRevision="4") - state["mixerSession"].update(routeRevision="4",rosterRevision="4", - channels=copy.deepcopy(state["graph"]["channels"])) - emit(page,"arMixConsoleSnapshot",state) - page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) # Real native tempo-source command (not a browser-only BPM guess). source_menu=editor.locator("#vtMusicSource") assert source_menu.locator('option[value="'+RECEIVER+'"]').count()==1 @@ -145,6 +138,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() + if width==1366: + # The next changed graph invalidates the old editor instance. + state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" + state["graph"].update(revision="4",rosterRevision="4") + state["mixerSession"].update(routeRevision="4",rosterRevision="4", + channels=copy.deepcopy(state["graph"]["channels"])) + emit(page,"arMixConsoleSnapshot",state) + page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) editor.locator("#vtClose").click() assert editor.is_hidden(),"standard close must dismiss editor" assert not errors,(width,errors) From 9906d9a6781c4ec26477a1466f755ce254f405ee Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:02:02 +0700 Subject: [PATCH 054/124] style(test): normalize native music tempo smoke fixture indent --- tests/approved_native_vocal_throw_smoke.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 19783aa9a..b4a799984 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -139,13 +139,13 @@ def main(): music={"source":RECEIVER,"bpm":120,"confidence":.85}) assert "AUTO 120 BPM" 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" - state["graph"].update(revision="4",rosterRevision="4") - state["mixerSession"].update(routeRevision="4",rosterRevision="4", - channels=copy.deepcopy(state["graph"]["channels"])) - emit(page,"arMixConsoleSnapshot",state) - page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) + # The next changed graph invalidates the old editor instance. + state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" + state["graph"].update(revision="4",rosterRevision="4") + state["mixerSession"].update(routeRevision="4",rosterRevision="4", + channels=copy.deepcopy(state["graph"]["channels"])) + emit(page,"arMixConsoleSnapshot",state) + page.wait_for_function("""()=>document.querySelector('#vtThrow')?.disabled""",timeout=2000) editor.locator("#vtClose").click() assert editor.is_hidden(),"standard close must dismiss editor" assert not errors,(width,errors) From 1576c2327bbcc27b7267b3ac6898a6756341c9c7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:02:19 +0700 Subject: [PATCH 055/124] perf(music-tempo): deduplicate control BPM packets and avoid repeated parameter math --- engine/builtin_fx/VocalThrowProcessor.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index c1a7ee1a6..fb041709b 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -76,11 +76,21 @@ class VocalThrowProcessor final : public juce::AudioProcessor, // serialized preset BPM. No queue ACK storm or GUI state overwrite. void publishMusicBpm(float bpm) noexcept { if(!ready_||!std::isfinite(bpm)||bpm<60.f||bpm>200.f) { - musicInterval_.store(0,std::memory_order_release);return; + if(lastTempoBpm_!=0.f) { + lastTempoBpm_=0.f;lastTempoDivision_=-1; + musicInterval_.store(0,std::memory_order_release); + } + return; } + // The 12Hz message timer may deliver the same accepted tempo many + // times. Never recompute power/division or publish redundant atomics. + if(lastTempoBpm_==bpm && lastTempoDivision_==accepted_.division) + return; auto settings=accepted_;settings.bpm=bpm; VocalThrow::PreparedEdit packet{}; const auto valid=VocalThrow::prepareEdit(settings,rate_,packet); + lastTempoBpm_=valid?bpm:0.f; + lastTempoDivision_=valid?accepted_.division:-1; musicInterval_.store(valid?packet.intervalSamples:0, std::memory_order_release); } @@ -165,6 +175,8 @@ class VocalThrowProcessor final : public juce::AudioProcessor, std::atomic musicInterval_{0}; std::atomic observedTail_{false}; double rate_=0.; + float lastTempoBpm_=0.f; // CONTROL only + int lastTempoDivision_=-1; // CONTROL only bool ready_=false,published_=false; }; } // namespace armix::builtin_fx From 9662de5bf6001624a04e121ccb2536dbda6ab1d1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:03:53 +0700 Subject: [PATCH 056/124] ci(vocal-throw): run focused Chromium FAT for native and music tempo milestones --- .github/workflows/ui-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 822b894fe..2d30113e8 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -130,7 +130,7 @@ jobs: vocal-throw-preview: name: Vocal Throw native editor desktop/mobile Chromium FAT needs: quick - if: ${{ github.event_name == 'pull_request' && github.head_ref == 'feature/arson-vocal-throw-native-20261108' }} + if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'feature/arson-vocal-throw-') }} runs-on: ubuntu-latest timeout-minutes: 15 steps: From cce63231da52f69e6789873ecc406adba69aa1cb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:05:19 +0700 Subject: [PATCH 057/124] test(music-tempo): prove actual accepted graph PCM tap and revision fencing --- tests/native_music_tempo_test.cpp | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/native_music_tempo_test.cpp b/tests/native_music_tempo_test.cpp index 8253673ed..558d61c72 100644 --- a/tests/native_music_tempo_test.cpp +++ b/tests/native_music_tempo_test.cpp @@ -1,5 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-only #include "../engine/core/NativeMusicTempoMonitor.h" +#include "../engine/core/DynamicNativeSessionPublisher.h" #include #include #include @@ -81,6 +82,59 @@ static void failClosed() { check(tap.select(ChannelId{},7,13,0)); check(!tap.poll(7,13).active); } +static void actualGraphSourcePcm() { + using namespace armix::mixer; + DynamicChannelRoster roster; + ChannelEdit source,main; + source.kind=ChannelEdit::Kind::add;source.position=0; + source.role=ChannelRole::input;source.text="BACKING"; + main.kind=ChannelEdit::Kind::add;main.position=1; + main.role=ChannelRole::main;main.text="MAIN"; + main.format=ProcessingFormat::stereo; + const std::array adds{source,main}; + const auto created=roster.edit(0,adds); + check(created.ok()&&created.createdIds.size()==2); + const auto music=created.createdIds[0],master=created.createdIds[1]; + ChannelEdit output; + output.kind=ChannelEdit::Kind::setPrimaryOutput; + output.id=music;output.target=master; + const std::array links{output}; + check(roster.edit(1,links).ok()); + DynamicGraphRequest request; + request.physicalInputs=1;request.maxFrames=128; + request.sources={{music,0,-1,false}}; + DynamicNativeSessionPublisher graph; + constexpr std::uint64_t epoch=7; + const auto applied=graph.commit(roster,request,0,epoch,epoch,true); + check(applied.ok()&&applied.revision==1); + check(!graph.setMusicTempoSource(epoch,1,master,10000)); // MAIN forbidden + check(!graph.setMusicTempoSource(epoch-1,1,music,10000)); + 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 {}; + 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); + const bool rendered=graph.render(epoch,physical,1, + outL.data(),outR.data(),100,false,dryFx); + noHeap.store(false,std::memory_order_release); + check(rendered); + if(tick%8==0)(void)graph.pollMusicTempo(epoch,1); + } + 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); + // 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); + check(newer.ok()&&newer.revision==2); + state=graph.pollMusicTempo(epoch,2); + check(state.active&&state.source==music); + check(!graph.pollMusicTempo(epoch,1).active); + graph.unpublish(); + graph.pollRetirement(); +} int main() { lockTempo(72); lockTempo(95); @@ -88,5 +142,6 @@ int main() { lockTempo(160); lockTempo(120,true); failClosed(); + actualGraphSourcePcm(); std::puts("PASS: native music-channel BPM 72/95/120/160, silence holdover, stale graph, no RT heap"); } From 237634557b9c7583c3951e43bfc34877291d632b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:22:07 +0700 Subject: [PATCH 058/124] fix(vocal-throw): read music tempo before same-block throw and reset on device reprepare --- engine/builtin_fx/VocalThrowProcessor.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/engine/builtin_fx/VocalThrowProcessor.h b/engine/builtin_fx/VocalThrowProcessor.h index fb041709b..a7573b0a1 100644 --- a/engine/builtin_fx/VocalThrowProcessor.h +++ b/engine/builtin_fx/VocalThrowProcessor.h @@ -45,6 +45,10 @@ class VocalThrowProcessor final : public juce::AudioProcessor, layout.getMainOutputChannelSet()==juce::AudioChannelSet::stereo(); } void prepareToPlay(double sampleRate,int) override { + // Each device epoch gets a new frame clock. A previously accepted + // auto BPM interval is invalid if the hardware sample rate changed. + lastTempoBpm_=0.f;lastTempoDivision_=-1; + musicInterval_.store(0,std::memory_order_release); ready_=core_.prepare(sampleRate)&&core_.resetUnpublished(accepted_); if(ready_)rate_=sampleRate; } @@ -54,11 +58,9 @@ class VocalThrowProcessor final : public juce::AudioProcessor, void processBlock(juce::AudioBuffer& pcm,juce::MidiBuffer&) override { juce::ScopedNoDenormals noDenormals; if(!ready_||pcm.getNumChannels()<2||pcm.getNumSamples()<=0)return; + // consumeRealtimeEdits() snapshots the accepted tempo BEFORE any + // manual cue in the same block; bypassed inserts use the same path. consumeRealtimeEdits(); - // Transport is published by CONTROL as an already prepared sample - // interval; AUDIO performs only one atomic read at the block edge. - core_.setMusicIntervalSamples( - musicInterval_.load(std::memory_order_acquire)); core_.processStereo(pcm.getWritePointer(0),pcm.getWritePointer(1), static_cast(pcm.getNumSamples())); observedThrows_.store(core_.throwCount(),std::memory_order_relaxed); @@ -66,8 +68,13 @@ 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)); Edit e{}; - if(!ready_||!done_.canPush()||!commands_.pop(e))return; + if(!done_.canPush()||!commands_.pop(e))return; const bool applied=e.kind==CommandKind::settings? core_.applyPrepared(e.prepared):core_.throwNow(); (void)done_.push({e.id,e.prepared.settings,e.kind,applied}); From 88af4f4344afc62f2368952f403756b1db6945fe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:22:48 +0700 Subject: [PATCH 059/124] test(vocal-throw): auto music BPM freeze, no tail retime, Manual/TAP fallback --- tests/builtin_vocal_throw_test.cpp | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 28d6ea9b2..35d1b5d30 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -248,6 +248,42 @@ static void manualOverrideSuppressesAuto() { run(fx,0.f,0.f,5000,l,r); check(fx.throwCount()==2); // new phrase, after full release + gate } +// Accepted music BPM affects only new frozen tails, never retimes a tail +// already singing. An unlocked source must use persisted Manual/TAP BPM. +static void musicTempoChangesOnlyFutureTail() { + VocalThrow music,manual; + check(music.prepare(48000)&&manual.prepare(48000)); + auto s=music.settingsForTests(); + s.mode=0;s.bpm=120.f;s.division=0;s.repeats=1; + s.captureMs=120.f;s.wet=1.f;s.ducking=0.f; + check(music.resetUnpublished(s)&&manual.resetUnpublished(s)); + float a=0.f,b=0.f; + run(music,.6f,.4f,12000,a,b); + run(manual,.6f,.4f,12000,a,b); + run(music,0.f,0.f,2880,a,b); + run(manual,0.f,0.f,2880,a,b); + noHeap.store(true); + music.setMusicIntervalSamples(12000); // 1/4 at 240 BPM equivalent + const bool firedMusic=music.throwNow(); + const bool firedManual=manual.throwNow(); + // The selected backing bus can disappear immediately after the cue. + // Its already frozen tail must retain the accepted .25s repeat interval. + music.setMusicIntervalSamples(0); + noHeap.store(false); + check(firedMusic&&firedManual); + a=b=0.f; + run(music,0.f,0.f,8640,a,b); // 180 ms after cue + check(a==0.f&&b==0.f); + a=b=0.f; + run(music,0.f,0.f,6720,a,b); // repeat around 190-310 ms + check(a>.01f&&b>.01f); + a=b=0.f; + run(manual,0.f,0.f,15360,a,b); // manual .5s must still be silent + check(a==0.f&&b==0.f); + a=b=0.f; + run(manual,0.f,0.f,11520,a,b); + check(a>.01f&&b>.01f); +} int main() { validation(); manualAndDry(8000); @@ -262,5 +298,6 @@ int main() { manualOverrideSuppressesAuto(); autoThenManualMustNotDoubleEcho(); denseRepeatsStayBounded(); + musicTempoChangesOnlyFutureTail(); std::puts("PASS: vocal-throw native dry/rolling capture/phrase/echo/tempo/no-heap"); } From 632cb473debc0ff0f892d6b563468a63ed1e64ed Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:23:19 +0700 Subject: [PATCH 060/124] test(music-tempo): use valid 180 BPM interval vs 120 BPM fallback --- tests/builtin_vocal_throw_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/builtin_vocal_throw_test.cpp b/tests/builtin_vocal_throw_test.cpp index 35d1b5d30..11ed08ab3 100644 --- a/tests/builtin_vocal_throw_test.cpp +++ b/tests/builtin_vocal_throw_test.cpp @@ -263,7 +263,7 @@ static void musicTempoChangesOnlyFutureTail() { run(music,0.f,0.f,2880,a,b); run(manual,0.f,0.f,2880,a,b); noHeap.store(true); - music.setMusicIntervalSamples(12000); // 1/4 at 240 BPM equivalent + music.setMusicIntervalSamples(16000); // quarter-note at 180 BPM const bool firedMusic=music.throwNow(); const bool firedManual=manual.throwNow(); // The selected backing bus can disappear immediately after the cue. @@ -272,16 +272,16 @@ static void musicTempoChangesOnlyFutureTail() { noHeap.store(false); check(firedMusic&&firedManual); a=b=0.f; - run(music,0.f,0.f,8640,a,b); // 180 ms after cue + run(music,0.f,0.f,12960,a,b); // 270 ms after cue check(a==0.f&&b==0.f); a=b=0.f; - run(music,0.f,0.f,6720,a,b); // repeat around 190-310 ms + run(music,0.f,0.f,8160,a,b); // repeat around 290-410 ms check(a>.01f&&b>.01f); a=b=0.f; - run(manual,0.f,0.f,15360,a,b); // manual .5s must still be silent + run(manual,0.f,0.f,17760,a,b); // manual .5s must still be silent check(a==0.f&&b==0.f); a=b=0.f; - run(manual,0.f,0.f,11520,a,b); + run(manual,0.f,0.f,7680,a,b); check(a>.01f&&b>.01f); } int main() { From 39ba9a48de8fe87270f9ed0cf9cac49fb004dfed Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 8 Nov 2026 23:23:56 +0700 Subject: [PATCH 061/124] docs(music-tempo): architecture, evidence and explicit live-qualification boundary --- ...SON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/ARSON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md diff --git a/docs/ARSON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md b/docs/ARSON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md new file mode 100644 index 000000000..088665a93 --- /dev/null +++ b/docs/ARSON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md @@ -0,0 +1,45 @@ +# ArSon Vocal Throw M2 — Native Music Channel Tempo Detection + +**Status:** implementation and qualification draft, stacked on Vocal Throw M1 PR #469. M1 green head `4db384851e6f6378cca4fd037b744c98bd1f0ba3`; M2 is PR #474 and tracks issue #473. + +## Signal authority + +``` +Authoritative ChannelId native PCM graph, single JUCE / ASIO callback + MUSIC ChannelId selected explicitly by singer/operator + -> PRE-FX non-mutating read-only music tap + -> 10ms stereo absolute-energy summary, bounded SPSC + -> existing 12Hz JUCE control timer: onset search + BPM confidence + -> accepted tempo precomputed into sample intervals, CONTROL only + -> per-VocalThrow atomic pending interval + -> next dry/vocal PCM callback copies interval BEFORE any THROW + -> new frozen vocal echo gets music interval, old tails keep prior schedule + VOICE ChannelId -> VocalThrow (no added dry PCM delay) -> WIRE/BUS/MAIN +``` + +**AUDIO callback contract:** no memory allocations, FFT, file I/O, logging, locks, networking, JS DSP, or new audio threads. Only the explicitly selected source channel's input stereo samples are summarized; every other channel skips the per-sample music tap. Existing JUCE callback remains the only audio authority. Core audio buffers and retained FX leases remain with the native graph. + +**CONTROL contract:** only an accepted `ChannelId` with input / GROUP / FX_RETURN role and an actually scheduled PCM lane is a permissible tempo source. The native FX editor validates both its own vocal insert instance and source identity, device epoch and graph revision. Monitor/MAIN and the vocal channel itself are not accepted. On a valid structural graph recompile, an existing source ID is rebound with a new analysis generation; if absent or stale, the music clock is disabled, and Vocal Throw falls back to its saved BPM or TAP tempo. + +## Detector + +- A 10ms energy onset, 80ms transient refractory and adaptive floor reject a simple repeated rise from a sustained note. +- Bounded pairwise onset-period candidate scoring (60–180 BPM), with penalty for octave half/double candidates, three consistent estimates and confidence threshold. +- Native readback distinguishes **AUTO BPM locked**, **Listening**, and **Manual/TAP fallback**. A silence period exceeding 3.2s resets lock. +- UI conveys confidence as measured by estimator; this number is not field-certified reliability. + +**Explicit limitations:** Music/onset BPM estimation does not provide sample-perfect beat-phase grid alignment. A recent transient anchor is retained for diagnostics only; it is not used as a globally compensated sample clock. Syncopated and heavily compressed music, live mic bleed, time-signature changes, half/double-time ambiguity and device-specific ASIO timing remain hardware field gates. Tempo selection is ephemeral song-wide, not yet persisted per Show. The fallback path always remains audible on the singer's dry stream. + +## Qualification evidence + +- Prior M1 Windows MSVC/JUCE: 63/63 CTest on exact SHA `4db384851e6f6378cca4fd037b744c98bd1f0ba3`. +- M2 Windows MSVC/JUCE: 64/64 CTest, including `NativeMusicTempoSourceOnsetsAndFallback`, on exact SHA `cce63231da52f69e6789873ecc406adba69aa1cb`. See [Actions run 42498186748](https://github.com/masarray/arsonmix/actions/runs/42498186748). +- Chromium FAT M2 native Vocal Throw picker, music source ACK, BPM readback and stale instance handling passed on same SHA. +- Later hardening: inbound tempo sampled before same-callback THROW and reset on plugin audio reprepare; corresponding regression checks for manual fallback and active tail interval stability. Qualification on the later SHA must be checked independently. +- Deterministic PCM: 72, 95, 120, 160 BPM; non-vocal source, stale revision, source change, dropout, default fallback. The CTest calls the *actual* native publisher to verify a music signal traverses the accepted graph, not only the isolated estimator. + +**Not qualified:** physical ASIO 64/128 frame load at 44.1/48/96 kHz; prolonged simultaneous singer/backing test; live beat-grid sync / stereo echo hearing test; WASAPI secondary stream callback load; long-run xrun/restart and voice-music bleed reliability. Green CI is necessary but not sufficient for release. + +## Next DSP/UX milestone + +Prove stable beat phase with a source-specific latency-compensated anchor; handle half/double-time ambiguity with confidence floor and long-window hysteresis; permit song/Show fallback preference; add footswitch mapping and live capture metrics without callback work. Until then label UI as estimated **AUTO BPM** rather than **sample-accurate beat quantization**. From 3a06a0e3a8735f2b8e72327140de2b20fb2f93c2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 04:05:18 +0700 Subject: [PATCH 062/124] 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 063/124] 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 064/124] 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 065/124] 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 066/124] 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 067/124] 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 068/124] 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 069/124] 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 070/124] 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 071/124] 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 072/124] 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 073/124] 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 074/124] 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 075/124] 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 076/124] 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 077/124] 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 078/124] 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 079/124] 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 080/124] 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 081/124] 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 082/124] 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 083/124] 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 084/124] 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 085/124] 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 086/124] 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 087/124] 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 088/124] 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 089/124] 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 090/124] 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 091/124] 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 092/124] 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 093/124] 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 From 414f9fc8b54c5c912f830005617d5d6f26eaaaf3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:46:47 +0700 Subject: [PATCH 094/124] design(vocal-throw): extract supplied Illustrator kit rotary language into lightweight gradient SVG --- .../assets/arson-vocal-hardware-rotor.svg | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 site/preview-v2/assets/arson-vocal-hardware-rotor.svg diff --git a/site/preview-v2/assets/arson-vocal-hardware-rotor.svg b/site/preview-v2/assets/arson-vocal-hardware-rotor.svg new file mode 100644 index 000000000..e8c72a55e --- /dev/null +++ b/site/preview-v2/assets/arson-vocal-hardware-rotor.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ef1efbf82a795cbac3aba7bd490b173ddc46a4af Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:47:14 +0700 Subject: [PATCH 095/124] design(vocal-throw): compact hardware controls based on supplied vector kit --- site/preview-v2/assets/arson-vocal-hardware-encoder.svg | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 site/preview-v2/assets/arson-vocal-hardware-encoder.svg diff --git a/site/preview-v2/assets/arson-vocal-hardware-encoder.svg b/site/preview-v2/assets/arson-vocal-hardware-encoder.svg new file mode 100644 index 000000000..2cb7d175f --- /dev/null +++ b/site/preview-v2/assets/arson-vocal-hardware-encoder.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From c46fced2ffad0ae71a7c8317014636d5557a4e3a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:47:16 +0700 Subject: [PATCH 096/124] design(vocal-throw): compact hardware controls based on supplied vector kit --- site/preview-v2/assets/arson-vocal-hardware-push.svg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 site/preview-v2/assets/arson-vocal-hardware-push.svg diff --git a/site/preview-v2/assets/arson-vocal-hardware-push.svg b/site/preview-v2/assets/arson-vocal-hardware-push.svg new file mode 100644 index 000000000..1b9970a96 --- /dev/null +++ b/site/preview-v2/assets/arson-vocal-hardware-push.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file From f7c231923ab1efe055a70f4b3e43baf7bc063e13 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:47:18 +0700 Subject: [PATCH 097/124] design(vocal-throw): compact hardware controls based on supplied vector kit --- site/preview-v2/assets/arson-vocal-hardware-toggle.svg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 site/preview-v2/assets/arson-vocal-hardware-toggle.svg diff --git a/site/preview-v2/assets/arson-vocal-hardware-toggle.svg b/site/preview-v2/assets/arson-vocal-hardware-toggle.svg new file mode 100644 index 000000000..d3aad9aa7 --- /dev/null +++ b/site/preview-v2/assets/arson-vocal-hardware-toggle.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 4c2ea32aa2cb0e88e0b9e2fe6e0abf2490e239e7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:49:00 +0700 Subject: [PATCH 098/124] feat(vocal-throw-ui): replace web-form layout with real hardware rotary and performance face --- .../assets/mixer-native-vocal-throw.js | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 93ec25c91..89f4cd327 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -30,28 +30,40 @@ 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=[ - '
ARSONVOCAL THROW', - '', + '
ARSONVOCAL THROWPHRASE DELAY
', + '', '
', - '
ARSON / PHRASE ENGINEMANUAL CLOCK
120BPM1/4 · HYBRID
TRIGGER MODE
', - '
', - '
', - '
', - '
Manual BPM fallback
', - '
', - '
Native DSP · waiting for accepted channel
', - '
Phrase & echo shaping
', - '
FX READY0 throws
' + '
', + '
SMART PHRASE / LIVE ENGINEAS·VT 01 ZERO DRY LATENCY
', + '
', + '
ECHO RETURN LEVEL
', + '
', + '
', + '
TRIGGER
', + '
', + '
TEMPO CLOCK
120BPMMANUAL CLOCK
', + '
DELAY DIVISION
1/4 · HYBRID
', + '
Manual BPM / TAP
', + '
NATIVE DSPNative DSP · waiting for accepted channel0 throws
' ].join(""); document.body.append(panel); const $=id=>panel.querySelector("#"+id); -for(const [key,[title,unit,step]] of Object.entries(fields)){ - const label=document.createElement("label");label.className="range";label.dataset.key=key; - label.innerHTML=''+title+''; - const input=label.querySelector("input"),bounds=ranges[key]; - input.min=String(bounds[0]);input.max=String(bounds[1]);input.step=String(step); - input.setAttribute("aria-label",title);label.querySelector("output").dataset.unit=unit; - $("vtRanges").append(label); +const encoderMeta={ + captureMs:["CAPTURE","ms",5,"vtEncodersLeft"], + silenceMs:["PHRASE END","ms",10,"vtEncodersLeft"], + thresholdDb:["VOICE GATE","dB",1,"vtEncodersLeft"], + decay:["FEEDBACK","%",.01,"vtEncodersRight"], + ducking:["VOCAL DUCK","%",.01,"vtEncodersRight"], + repeats:["REPEATS","x",1,"vtEncodersRight"] +}; +for(const [key,[title,unit,,bank]] of Object.entries(encoderMeta)){ + const node=document.createElement("div"); + node.className="vt-encoder";node.dataset.key=key; + node.innerHTML=''+title+''+ + ''+ + ''; + node.querySelector("output").dataset.unit=unit; + $(bank).append(node); } let current=null,accepted=defaults(),draft=defaults(),pending=null, readId="",readSent=0,seq=1,taps=[],windowDrag=null; From c8d1f632c585c681924fba639afcbd1cb701dccf Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:49:49 +0700 Subject: [PATCH 099/124] feat(vocal-throw-ui): accessible physical rotary drag/wheel/keyboard wired to native DSP ACK --- .../assets/mixer-native-vocal-throw.js | 90 ++++++++++++++++--- 1 file changed, 79 insertions(+), 11 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 89f4cd327..6c3b4cbec 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -130,17 +130,34 @@ function syncPower(){ function paint(){ $("vtMode").value=String(draft.mode);$("vtBpm").value=String(draft.bpm); $("vtDivision").value=String(draft.division);$("vtRepeats").value=String(draft.repeats); - for(const [key,[,unit]] of Object.entries(fields)){ - const label=$("vtRanges").querySelector('[data-key="'+key+'"]'); - label.querySelector("input").value=String(draft[key]); - label.querySelector("output").textContent= + for(const [key,[,unit]] of Object.entries(encoderMeta)){ + const node=panel.querySelector('.vt-encoder[data-key="'+key+'"]'); + const min=ranges[key][0],max=ranges[key][1]; + const pct=(draft[key]-min)/(max-min); + const turn=-130+260*pct; + node.style.setProperty("--turn",turn.toFixed(2)+"deg"); + node.querySelector(".vt-encoder-value").textContent= (unit==="%"?Math.round(draft[key]*100):Math.round(draft[key]))+unit; + const dial=node.querySelector(".vt-encoder-face"); + dial.setAttribute("aria-valuemin",String(min)); + dial.setAttribute("aria-valuemax",String(max)); + dial.setAttribute("aria-valuenow",String(draft[key])); + dial.setAttribute("aria-valuetext",node.querySelector(".vt-encoder-value").textContent); } + const wetPct=Math.round(draft.wet*100); + $("vtWetValue").textContent=wetPct+"%"; + $("vtWetDial").style.setProperty("--turn",(-130+260*draft.wet).toFixed(2)+"deg"); + $("vtWetDial").setAttribute("aria-valuenow",String(wetPct)); + $("vtWetDial").setAttribute("aria-valuetext",wetPct+" percent"); + for(const b of panel.querySelectorAll(".vt-mode-buttons button")) + b.setAttribute("aria-pressed",String(Number(b.dataset.mode)===draft.mode)); + for(const b of panel.querySelectorAll(".vt-division-buttons button")) + b.setAttribute("aria-pressed",String(Number(b.dataset.division)===draft.division)); $("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()) + for(const [index,led] of [...$("vtBeatRail").querySelectorAll("i")].entries()) led.dataset.on=String(index{ - const value=Number(input.value),bounds=ranges[key]; - draft={...draft,[key]:clamp(value,bounds[0],bounds[1])};paint(); +// Physical rotary control: vertical pointer drag, mouse wheel and keyboard. +// Update visual locally during movement; issue exactly ONE accepted native +// settings intent at drag release. No DOM/audio DSP loops are introduced. +function bindRotary(face,key,step){ + const [min,max]=ranges[key]; + const quantize=v=>clamp(Math.round(v/step)*step,min,max); + let gesture=null; + const update=v=>{if(pending)return;draft={...draft,[key]:quantize(v)};paint();}; + face.addEventListener("pointerdown",e=>{ + if(e.button!==0||pending)return; + gesture={id:e.pointerId,y:e.clientY,initial:draft[key],changed:false}; + face.setPointerCapture(e.pointerId);e.preventDefault(); + }); + face.addEventListener("pointermove",e=>{ + if(!gesture||gesture.id!==e.pointerId)return; + const next=quantize(gesture.initial+(gesture.y-e.clientY)*(max-min)/168); + if(next!==draft[key]){gesture.changed=true;update(next);} + e.preventDefault(); + }); + const finish=e=>{ + if(!gesture||e.pointerId!==gesture.id)return; + const changed=gesture.changed;gesture=null; + if(face.hasPointerCapture?.(e.pointerId))face.releasePointerCapture(e.pointerId); + if(changed)send("nativeThrowSet"); + }; + face.addEventListener("pointerup",finish); + face.addEventListener("pointercancel",()=>{gesture=null;paint();}); + face.addEventListener("wheel",e=>{ + if(pending)return; + e.preventDefault();update(draft[key]+(e.deltaY<0?step:-step)); + send("nativeThrowSet"); + },{passive:false}); + face.addEventListener("keydown",e=>{ + const delta={ArrowUp:1,ArrowRight:1,ArrowDown:-1,ArrowLeft:-1,PageUp:5,PageDown:-5}[e.key]; + if(delta===undefined&&e.key!=="Home"&&e.key!=="End")return; + e.preventDefault(); + update(e.key==="Home"?min:e.key==="End"?max:draft[key]+delta*step); + send("nativeThrowSet"); + }); + face.addEventListener("dblclick",()=>{ + if(pending)return; + update(defaults()[key]);send("nativeThrowSet"); + }); +} +for(const [key,[,,step]] of Object.entries(encoderMeta)) + bindRotary(panel.querySelector('.vt-encoder[data-key="'+key+'"] .vt-encoder-face'),key,step); +bindRotary($("vtWetDial"),"wet",.01); +for(const button of panel.querySelectorAll(".vt-mode-buttons button")){ + button.addEventListener("click",()=>{ + $("vtMode").value=button.dataset.mode; + $("vtMode").dispatchEvent(new Event("change",{bubbles:true})); + }); +} +for(const button of panel.querySelectorAll(".vt-division-buttons button")){ + button.addEventListener("click",()=>{ + $("vtDivision").value=button.dataset.division; + $("vtDivision").dispatchEvent(new Event("change",{bubbles:true})); }); - input.addEventListener("change",()=>send("nativeThrowSet")); } $("vtMusicSource").addEventListener("change",()=>{ const ctx=context(),source=String($("vtMusicSource").value); From 8f7435441a6991118dff79904261cfd3bbb35817 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:51:50 +0700 Subject: [PATCH 100/124] style(vocal-throw): full hardware VST chassis using supplied rotary/push/toggle vector language --- site/preview-v2/assets/mixer-fx-rack.css | 307 +++++++++++++++-------- 1 file changed, 205 insertions(+), 102 deletions(-) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index f1e6baf2b..c032e44da 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -398,107 +398,210 @@ .mx-comp{top:4px;max-height:calc(100dvh - 8px)} } -/* 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;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{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){ +/* ArSon Vocal Throw M4: hardware face from the user's Illustrator control + kit. Static vector knobs/buttons, no canvas animation, no browser DSP. + Shared Close and Power geometry/state owner: mixer-contextual-buttons.css. */ +.mx-vthrow{position:fixed;z-index:15001;top:clamp(7px,7vh,66px);left:clamp(7px,9vw,175px); + width:min(778px,calc(100vw - 14px));max-height:calc(100dvh - 14px); + display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box; + border:1px solid #51545f;border-radius:8px;color:#d4dce3; + background:linear-gradient(145deg,#333740,#22272e 35%,#242830 75%,#1d222a); + box-shadow:inset 0 1px 0 #ffffff33,inset 0 -1px 0 #090c1199, + 0 1px 0 #070910,0 17px 48px #000c; + font:400 11px/1.32 Inter,'Segoe UI',sans-serif} +.mx-vthrow[hidden]{display:none} +.mx-vthrow *{box-sizing:border-box} +.mx-vthrow button{font:inherit;cursor:pointer} +.mx-vthrow :is(button,select,input):focus-visible{outline:2px solid #cf99ee;outline-offset:2px} +.mx-vthrow .vt-face-header{height:43px;flex:0 0 43px;display:flex;align-items:center;gap:9px; + min-width:0;padding:0 10px 0 15px;cursor:move;touch-action:none;user-select:none; + background:linear-gradient(#414750,#2b313a);border-bottom:1px solid #151a22; + box-shadow:inset 0 1px #ffffff2b,inset 0 -1px #ffffff0a} +.mx-vthrow .brand{display:flex;align-items:baseline;gap:8px;white-space:nowrap;flex:0 0 auto} +.mx-vthrow .brand-mark{font-size:9px;font-weight:700;color:#bf80dc;letter-spacing:.12em} +.mx-vthrow .brand-name{font-size:12px;font-weight:620;color:#edf0f4;letter-spacing:.075em} +.mx-vthrow .brand-type{font-size:9px;color:#979fab;letter-spacing:.1em} +.mx-vthrow .channel{min-width:0;max-width:105px;flex:1;overflow:hidden;text-overflow:ellipsis; + white-space:nowrap;font-size:9px;color:#b6a0c2} +.mx-vthrow .vt-preset{display:flex;align-items:center;gap:7px;margin-left:auto; + font-size:9px;letter-spacing:.09em;color:#9ca4af} +.mx-vthrow .vt-preset select{width:110px;height:25px;min-width:0;max-width:110px; + padding:0 6px;border:1px solid #555f6b;border-radius:4px; + background:linear-gradient(#272d35,#1c222b);color:#dce1e9;font:500 10px Inter,'Segoe UI',sans-serif} +.mx-vthrow option{color:#e8eaf1;background:#272b34} +.mx-vthrow .vt-hardware{overflow:auto;overscroll-behavior:contain;min-height:0;display:grid;gap:0; + padding:0;scrollbar-width:thin;scrollbar-color:#565563 #22272e} +.mx-vthrow .vt-console{padding:13px 18px 13px; + background:linear-gradient(135deg,#30343b,#242932 66%,#2c3038); + border-bottom:1px solid #4b4c55;box-shadow:inset 0 1px #ffffff10} +.mx-vthrow .vt-console-eyebrow{display:flex;justify-content:space-between;align-items:center; + gap:8px;margin:0 0 3px;font-size:9px;letter-spacing:.16em;color:#c49bd9} +.mx-vthrow .vt-unit-id{color:#7f8c98;letter-spacing:.06em;white-space:nowrap} +.mx-vthrow .vt-unit-id i{display:inline-block;width:5px;height:5px;border-radius:50%; + background:#ac75ce;margin:0 6px 1px} +.mx-vthrow .vt-instrument{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 244px minmax(0,1fr); + align-items:center;gap:5px} +.mx-vthrow .vt-encoder-bank{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-width:0} +.mx-vthrow .vt-encoder{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0; + padding:7px 1px 3px} +.mx-vthrow .vt-encoder-name{height:12px;line-height:12px;color:#a4acb7; + font-size:8px;font-weight:540;letter-spacing:.07em;white-space:nowrap} +.mx-vthrow .vt-encoder-face{position:relative;display:block;flex:0 0 auto;width:66px;height:66px; + padding:0;border:0;background:transparent url("arson-vocal-hardware-encoder.svg") center/contain no-repeat; + border-radius:50%;touch-action:none;cursor:ns-resize;filter:drop-shadow(0 4px 5px #060a10bb)} +.mx-vthrow .vt-encoder-needle{position:absolute;inset:0;transform:rotate(var(--turn,-130deg));pointer-events:none} +.mx-vthrow .vt-encoder-needle::after{content:"";position:absolute;left:calc(50% - 1.2px);top:17%; + width:2.4px;height:12px;border-radius:3px;background:#c989e4; + box-shadow:0 0 4px #b468ddaa} +.mx-vthrow .vt-encoder-value{font:500 11px/14px Inter,'Segoe UI',sans-serif; + color:#e6dfec;font-variant-numeric:tabular-nums;white-space:nowrap} +.mx-vthrow .vt-center{display:flex;flex-direction:column;align-items:center;gap:0;min-width:0} +.mx-vthrow .vt-hero-plate{width:230px;height:230px;position:relative;display:grid;place-items:center; + background:radial-gradient(circle at center,#11161d80,transparent 70%)} +.mx-vthrow .vt-hero-knob{position:relative;display:grid;place-items:center;width:224px;height:224px; + border:0;padding:0;border-radius:50%;outline-offset:-8px!important;cursor:ns-resize;touch-action:none; + background:transparent url("arson-vocal-hardware-rotor.svg") center/contain no-repeat; + filter:drop-shadow(0 9px 9px #0c111a9c)} +.mx-vthrow .vt-hero-pointer{position:absolute;inset:0;transform:rotate(var(--turn,-130deg)); + pointer-events:none} +.mx-vthrow .vt-hero-pointer::after{content:"";position:absolute;top:22%;left:calc(50% - 3px); + width:6px;height:15px;clip-path:polygon(50% 100%,0 0,100% 0); + background:#e29aff;filter:drop-shadow(0 0 3px #a44dd4)} +.mx-vthrow .vt-hero-readout{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px; + pointer-events:none;margin-top:9px;text-shadow:0 1px #000a} +.mx-vthrow .vt-hero-readout small{font-size:10px;letter-spacing:.15em;color:#aab3c0} +.mx-vthrow .vt-hero-readout output{font:500 30px/1.15 'Segoe UI',Inter,sans-serif; + color:#f1e5f9;font-variant-numeric:tabular-nums;letter-spacing:-.02em} +.mx-vthrow .vt-dial-note{margin-top:-8px;color:#8f99a5;font-size:9px;letter-spacing:.1em} +.mx-vthrow .vt-performance{display:grid;grid-template-columns:146px minmax(0,1fr) 104px; + align-items:stretch;gap:12px;margin-top:2px} +.mx-vthrow .vt-throw-button{display:flex;flex-direction:column;justify-content:center;align-items:center; + gap:2px;height:60px;border:0;border-radius:15px;color:#241629; + background:transparent url("arson-vocal-hardware-push.svg") center/100% 100% no-repeat; + filter:drop-shadow(0 3px 5px #0008);text-shadow:0 1px #e7b6f154} +.mx-vthrow .vt-throw-main{font-size:17px;font-weight:700;letter-spacing:.18em;color:#24152c} +.mx-vthrow .vt-throw-button small{font-size:8px;letter-spacing:.11em;color:#452b52} +.mx-vthrow .vt-throw-button:active:not(:disabled){filter:brightness(.78) drop-shadow(0 1px 2px #000a)} +.mx-vthrow .vt-throw-button:disabled{opacity:.46;filter:grayscale(.7)} +.mx-vthrow .vt-trigger{display:flex;flex-direction:column;justify-content:center;gap:6px;align-items:center;min-width:0} +.mx-vthrow .vt-small-label{font-size:9px;font-weight:560;letter-spacing:.13em;color:#9ba5b1;white-space:nowrap} +.mx-vthrow .vt-mode-buttons,.mx-vthrow .vt-division-buttons{display:flex;align-items:center; + gap:2px;padding:3px;border:1px solid #171c23;border-radius:7px; + background:linear-gradient(#131820,#242a32);box-shadow:inset 0 2px 4px #060b11b8,0 1px #56606a3d} +.mx-vthrow :is(.vt-mode-buttons,.vt-division-buttons) button{ + flex:1;min-width:0;min-height:29px;padding:3px 7px;border:1px solid transparent;border-radius:4px; + background:linear-gradient(#3b424b,#2d343d);box-shadow:inset 0 1px #ffffff15; + color:#a6b0bc;font-size:10px;font-weight:580;letter-spacing:.03em} +.mx-vthrow :is(.vt-mode-buttons,.vt-division-buttons) button[aria-pressed=true]{ + color:#f5e4ff;border-color:#784f8b;background:linear-gradient(#6a4c78,#3f344a); + box-shadow:inset 0 1px #efbaff2b,0 0 7px #b66bd327} +.mx-vthrow .vt-tap-button{height:60px;display:flex;flex-direction:column;align-items:center; + justify-content:center;gap:1px;color:#c8d0d9;background:linear-gradient(#414852,#262c35); + border:1px solid #4c5661;border-radius:12px;box-shadow:inset 0 1px #ffffff21,0 3px 6px #0008} +.mx-vthrow .vt-tap-button span{font-size:14px;font-weight:640;letter-spacing:.12em} +.mx-vthrow .vt-tap-button small{font-size:9px;letter-spacing:.12em;color:#a5b0bc} +.mx-vthrow .vt-tap-button:active{background:linear-gradient(#242931,#353b45);box-shadow:inset 0 2px 5px #000a} +.mx-vthrow .vt-virtual-input{position:absolute!important;width:1px!important;height:1px!important; + padding:0!important;border:0!important;opacity:0!important;overflow:hidden!important; + pointer-events:none!important} +.mx-vthrow .vt-transport{min-width:0;display:grid;grid-template-columns:195px minmax(0,1fr) minmax(0,1fr); + gap:14px;padding:13px 18px 12px;background:linear-gradient(#222832,#20252d); + border-top:1px solid #0f141b;border-bottom:1px solid #4b525c} +.mx-vthrow .vt-tempo,.mx-vthrow .vt-pulse,.mx-vthrow .vt-music-source{ + min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:6px} +.mx-vthrow .vt-clock-screen{height:43px;display:flex;align-items:baseline;gap:6px; + padding:3px 9px 5px;border:1px solid #344856;border-radius:4px; + background:linear-gradient(145deg,#07171e,#11232b);box-shadow:inset 0 2px 5px #0009} +.mx-vthrow #vtDisplayBpm{font:500 29px/34px 'Segoe UI',sans-serif;color:#c9efdd; + letter-spacing:-.02em;font-variant-numeric:tabular-nums} +.mx-vthrow .vt-clock-screen>span:nth-child(2){font-size:9px;color:#7da99a} +.mx-vthrow #vtClockLabel{margin-left:auto;align-self:center;color:#bb99c9;font-size:9px; + letter-spacing:.06em;text-align:right;max-width:76px} +.mx-vthrow .vt-manual-bpm{display:flex;align-items:center;gap:6px;color:#8794a1; + font-size:8px;letter-spacing:.1em} +.mx-vthrow .vt-manual-bpm input{width:56px;height:23px;padding:0 4px;border:1px solid #46525d; + border-radius:3px;background:#171e26;color:#d8dfea;font:500 11px 'Segoe UI',sans-serif; + text-align:center;font-variant-numeric:tabular-nums} +.mx-vthrow .vt-division-buttons{height:40px} +.mx-vthrow .vt-division-buttons button{height:31px;padding:3px 4px} +.mx-vthrow .vt-repeat-leds{display:flex;align-items:center;gap:5px;white-space:nowrap;height:16px} +.mx-vthrow .vt-repeat-leds i{display:block;width:15px;height:3px;border-radius:2px;background:#3d4550} +.mx-vthrow .vt-repeat-leds i[data-on=true]{background:#b07ace;box-shadow:0 0 4px #bd7ed04d} +.mx-vthrow .vt-repeat-leds[data-playing=true] i[data-on=true]{background:#c99ae0} +.mx-vthrow #vtRhythm{margin-left:auto;color:#8695a1;font-size:8px;letter-spacing:.06em} +.mx-vthrow .vt-music-source select{height:34px;width:100%;min-width:0;padding:0 7px; + border:1px solid #46515e;border-radius:5px;background:linear-gradient(#333a45,#252c36); + color:#d8e0e8;font:500 10px Inter,'Segoe UI',sans-serif} +.mx-vthrow .music-status{height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; + font-size:9px;color:#b69ac8} +.mx-vthrow .vt-status-rail{min-width:0;height:30px;display:flex;align-items:center; + justify-content:space-between;gap:14px;padding:0 17px;border-top:1px solid #090d13; + background:linear-gradient(#272d36,#232831);font-size:9px;letter-spacing:.045em;color:#929eaa} +.mx-vthrow .vt-device{flex:0 0 auto;white-space:nowrap} +.mx-vthrow .dot{display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%; + background:#6f7781;box-shadow:0 0 0 1px #10141a} +.mx-vthrow .dot.active{background:#b886d5;box-shadow:0 0 5px #b886d55c} +.mx-vthrow .vt-hint{min-width:0;flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.mx-vthrow #vtCount{flex:0 0 auto;white-space:nowrap} +@media(max-width:770px){ + .mx-vthrow{left:7px;top:7px} + .mx-vthrow .brand-type{display:none} + .mx-vthrow .vt-console{padding:10px 10px 12px} + .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 200px minmax(0,1fr)} + .mx-vthrow .vt-hero-plate{width:196px;height:196px} + .mx-vthrow .vt-hero-knob{width:193px;height:193px} + .mx-vthrow .vt-encoder-face{width:51px;height:51px} + .mx-vthrow .vt-encoder-name{font-size:7px} + .mx-vthrow .vt-transport{grid-template-columns:160px minmax(0,1fr) minmax(0,1fr);gap:9px;padding:10px} +} +@media(max-width:600px){ + .mx-vthrow{width:calc(100vw - 10px);max-height:calc(100dvh - 10px);left:5px;top:5px} + .mx-vthrow .vt-face-header{height:39px;flex-basis:39px;gap:5px;padding:0 7px} + .mx-vthrow .brand{gap:5px}.mx-vthrow .brand-mark{font-size:8px} + .mx-vthrow .brand-name{font-size:10px} + .mx-vthrow .channel{max-width:42px;font-size:8px} + .mx-vthrow .vt-preset{gap:3px;font-size:0} + .mx-vthrow .vt-preset select{width:82px;max-width:82px;font-size:9px} + .mx-vthrow .vt-console-eyebrow{font-size:8px;letter-spacing:.08em} + .mx-vthrow .vt-unit-id{font-size:7px} + .mx-vthrow .vt-instrument{display:flex;flex-direction:column;gap:0} + .mx-vthrow .vt-center{order:0} + .mx-vthrow #vtEncodersLeft{order:1} + .mx-vthrow #vtEncodersRight{order:2} + .mx-vthrow .vt-hero-plate{width:176px;height:176px} + .mx-vthrow .vt-hero-knob{width:174px;height:174px} + .mx-vthrow .vt-hero-readout output{font-size:25px} + .mx-vthrow .vt-dial-note{font-size:8px} + .mx-vthrow .vt-encoder-bank{width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:0} + .mx-vthrow .vt-encoder{gap:3px;padding:3px 0 2px} + .mx-vthrow .vt-encoder-face{width:53px;height:53px} + .mx-vthrow .vt-encoder-name{font-size:8px} + .mx-vthrow .vt-encoder-value{font-size:10px} + .mx-vthrow .vt-performance{grid-template-columns:96px minmax(0,1fr) 65px;gap:5px;margin-top:8px} + .mx-vthrow .vt-throw-button,.mx-vthrow .vt-tap-button{height:51px} + .mx-vthrow .vt-throw-main{font-size:13px;letter-spacing:.1em} + .mx-vthrow .vt-trigger{gap:4px} + .mx-vthrow .vt-mode-buttons button{font-size:8px;min-height:24px;padding:1px 3px} + .mx-vthrow .vt-tap-button span{font-size:11px} + .mx-vthrow .vt-transport{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px} + .mx-vthrow .vt-music-source{grid-column:1/-1} + .mx-vthrow .vt-clock-screen{height:37px} + .mx-vthrow #vtDisplayBpm{font-size:24px} + .mx-vthrow .vt-division-buttons{height:34px} + .mx-vthrow .vt-division-buttons button{font-size:8px;height:26px} + .mx-vthrow .vt-music-source select{height:29px} + .mx-vthrow .vt-status-rail{gap:7px;padding:0 9px} +} +@media(max-width:350px){ + .mx-vthrow .channel{display:none} + .mx-vthrow .brand-name{font-size:9px} + .mx-vthrow .vt-preset select{width:72px} + .mx-vthrow .vt-unit-id{display:none} +} +@media(max-height:590px) and (min-width:601px){ .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} + .mx-vthrow .vt-console{padding-top:5px;padding-bottom:6px} + .mx-vthrow .vt-hero-plate{height:178px;width:178px} + .mx-vthrow .vt-hero-knob{height:176px;width:176px} + .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr)} } From f21578ae087933472071f408a73e2fa70558dd1c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:52:26 +0700 Subject: [PATCH 101/124] test(vocal-throw): hardware rotary interactive native ACK and responsive vector face Chromium FAT --- tests/approved_native_vocal_throw_smoke.py | 36 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 4d760efc9..12b1e3aa1 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -116,17 +116,30 @@ 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"]<=438 and box["width"]<=width and \ + assert box and box["width"]<=778 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"),\ "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 + assert editor.locator(".vt-encoder-face").count()==6 + assert editor.locator("#vtWetDial[role='slider']").count()==1 + assert editor.locator(".vt-throw-button").count()==1 + assert editor.locator(".vt-mode-buttons button").count()==3 + assert editor.locator(".vt-division-buttons button").count()==4 + # No browser form hiding of basic parameters: real accessible + # hardware rotary controls are displayed at desktop AND mobile. + assert editor.locator("#vtWetDial").is_visible() + assert editor.locator('.vt-encoder[data-key="captureMs"] button').is_visible() + for component in ["rotor","encoder","push"]: + assert page.evaluate("""name=>fetch('assets/arson-vocal-hardware-'+name+'.svg') + .then(r=>r.ok&&r.headers.get('content-type')?.includes('svg'))""", + component) page.screenshot(path="arsonmix-vocal-throw-"+str(width)+".png") editor.screenshot(path="arsonmix-vocal-throw-editor-"+str(width)+".png") if width==1366: - editor.locator("#vtMode").select_option("0") + editor.locator('.vt-mode-buttons button[data-mode="0"]').click() edit=last(page,"nativeThrowSet") assert edit["settings"]["mode"]==0 and edit["instanceId"]==INSTANCE assert edit["channelId"]==SOURCE @@ -134,13 +147,26 @@ def main(): emit(page,"arMixBuiltinThrowAck",{"requestId":edit["requestId"],"status":"APPLIED"}) reply_snapshot(page,state,{**DEFAULTS,"mode":0},applied=edit["requestId"]) assert editor.locator("#vtMode").input_value()=="0" + assert editor.locator('.vt-mode-buttons button[data-mode="0"]').get_attribute("aria-pressed")=="true" + # Rotary wheel edits actually send settings through the native + # request/ACK/readback contract, not a CSS-only animation. + dial=editor.locator("#vtWetDial") + dial.hover() + page.mouse.wheel(0,-120) + rotary=last(page,"nativeThrowSet") + assert rotary["settings"]["wet"]>.42 and rotary["settings"]["wet"]<=.44 + emit(page,"arMixBuiltinThrowQueue",{"requestId":rotary["requestId"],"status":"QUEUED"}) + emit(page,"arMixBuiltinThrowAck",{"requestId":rotary["requestId"],"status":"APPLIED"}) + updated={**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]} + reply_snapshot(page,state,updated,applied=rotary["requestId"]) + assert "%" in editor.locator("#vtWetValue").inner_text() editor.locator("#vtThrow").click() cue=last(page,"nativeThrowTrigger") assert cue["instanceId"]==INSTANCE and cue["channelId"]==SOURCE assert cue["slot"]==0 emit(page,"arMixBuiltinThrowQueue",{"requestId":cue["requestId"],"status":"QUEUED"}) emit(page,"arMixBuiltinThrowAck",{"requestId":cue["requestId"],"status":"APPLIED"}) - reply_snapshot(page,state,{**DEFAULTS,"mode":0},count=1,tail=True) + reply_snapshot(page,state,{**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]},count=1,tail=True) assert editor.locator("#vtCount").inner_text()=="1 throws" assert editor.locator("#vtStatus").inner_text()=="ECHO TAIL" # Real native tempo-source command (not a browser-only BPM guess). @@ -154,7 +180,7 @@ def main(): "requestId":request["requestId"],"status":"APPLIED", "sourceChannelId":RECEIVER}) reply_snapshot(page,state, - {**DEFAULTS,"mode":0} if width==1366 else DEFAULTS, + {**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]} if width==1366 else DEFAULTS, 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() @@ -170,7 +196,7 @@ def main(): # 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, + {**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]} 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() From 747fe4798fc20f3ddd46908de49329d93b1c1938 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:53:11 +0700 Subject: [PATCH 102/124] test(vocal-throw): assert authoritative hardware SVG styles without blocked file:// fetch --- tests/approved_native_vocal_throw_smoke.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 12b1e3aa1..887535013 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -132,10 +132,14 @@ def main(): # hardware rotary controls are displayed at desktop AND mobile. assert editor.locator("#vtWetDial").is_visible() assert editor.locator('.vt-encoder[data-key="captureMs"] button').is_visible() - for component in ["rotor","encoder","push"]: - assert page.evaluate("""name=>fetch('assets/arson-vocal-hardware-'+name+'.svg') - .then(r=>r.ok&&r.headers.get('content-type')?.includes('svg'))""", - component) + # Inspect the rendered CSS backgrounds: the real WebView and + # local file:// Chromium source cannot use fetch() for SVG URLs. + for selector,name in [("#vtWetDial","rotor"), + ('.vt-encoder-face',"encoder"), + ("#vtThrow","push")]: + bg=editor.locator(selector).first.evaluate( + "(el)=>getComputedStyle(el).backgroundImage") + assert "arson-vocal-hardware-"+name+".svg" in bg,(selector,bg) page.screenshot(path="arsonmix-vocal-throw-"+str(width)+".png") editor.screenshot(path="arsonmix-vocal-throw-editor-"+str(width)+".png") if width==1366: From 42e3b7d2010aa2e59b2989ecf9f727799ea6785a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:57:01 +0700 Subject: [PATCH 103/124] polish(vocal-throw): remove crowded dial microcopy and mirror native DSP bypass state on chassis --- 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 6c3b4cbec..c2ed91ad6 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -36,7 +36,7 @@ panel.innerHTML=[ '
', '
SMART PHRASE / LIVE ENGINEAS·VT 01 ZERO DRY LATENCY
', '
', - '
ECHO RETURN LEVEL
', + '
', '
', '
', '
TRIGGER
', @@ -119,6 +119,7 @@ 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"; + panel.dataset.fxState=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": From ab6170d7526fe719bd4f05868938b5cd9a2b1966 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 06:57:16 +0700 Subject: [PATCH 104/124] style(vocal-throw): native-readback bypass dimming and mobile rotary breathing space --- site/preview-v2/assets/mixer-fx-rack.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index c032e44da..0b240d2e5 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -605,3 +605,12 @@ .mx-vthrow .vt-hero-knob{height:176px;width:176px} .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr)} } + +/* FX power material follows accepted native graph readback, not CSS toggles. + Bypassed hardware remains editable but LEDs and controls recede visually. */ +.mx-vthrow[data-fx-state="off"] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button), +.mx-vthrow[data-fx-state="rack-off"] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button){ + opacity:.55;filter:grayscale(.55) brightness(.77)} +.mx-vthrow[data-fx-state="off"] .vt-console-eyebrow, +.mx-vthrow[data-fx-state="rack-off"] .vt-console-eyebrow{color:#96939e} +@media(max-width:600px){.mx-vthrow .vt-center{margin-bottom:8px}} From 530fc8fc50e61c4a006319b3f1c14a1c39d029ac Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:15:28 +0700 Subject: [PATCH 105/124] design(vocal-throw): source-faithful dark play trigger with neon icon and recessed round hardware --- .../assets/arson-vocal-throw-performance.svg | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 site/preview-v2/assets/arson-vocal-throw-performance.svg diff --git a/site/preview-v2/assets/arson-vocal-throw-performance.svg b/site/preview-v2/assets/arson-vocal-throw-performance.svg new file mode 100644 index 000000000..28c775278 --- /dev/null +++ b/site/preview-v2/assets/arson-vocal-throw-performance.svg @@ -0,0 +1,23 @@ + \ No newline at end of file From a7de77383364386ef5a021effe007297b0ec46ed Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:16:47 +0700 Subject: [PATCH 106/124] design(vocal-throw): center singer THROW performance switch, demote WET dial and strip nonessential copy --- .../assets/mixer-native-vocal-throw.js | 27 +++++++++---------- 1 file changed, 13 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 c2ed91ad6..98a1a626c 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -30,30 +30,29 @@ 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=[ - '
ARSONVOCAL THROWPHRASE DELAY
', - '', + '
ARSONVOCAL THROW
', + '', '
', '
', - '
SMART PHRASE / LIVE ENGINEAS·VT 01 ZERO DRY LATENCY
', '
', - '
', + '
', '
', - '
', - '
TRIGGER
', + '
', + '
', '
', - '
TEMPO CLOCK
120BPMMANUAL CLOCK
', - '
DELAY DIVISION
1/4 · HYBRID
', - '
Manual BPM / TAP
', - '
NATIVE DSPNative DSP · waiting for accepted channel0 throws
' + '
BPM
120BPMMAN
', + '
RHYTHM
1/4 · HYBRID
', + '
TAP
', + '
LIVE0
' ].join(""); document.body.append(panel); const $=id=>panel.querySelector("#"+id); const encoderMeta={ captureMs:["CAPTURE","ms",5,"vtEncodersLeft"], - silenceMs:["PHRASE END","ms",10,"vtEncodersLeft"], - thresholdDb:["VOICE GATE","dB",1,"vtEncodersLeft"], - decay:["FEEDBACK","%",.01,"vtEncodersRight"], - ducking:["VOCAL DUCK","%",.01,"vtEncodersRight"], + silenceMs:["END","ms",10,"vtEncodersLeft"], + thresholdDb:["GATE","dB",1,"vtEncodersLeft"], + decay:["DECAY","%",.01,"vtEncodersRight"], + ducking:["DUCK","%",.01,"vtEncodersRight"], repeats:["REPEATS","x",1,"vtEncodersRight"] }; for(const [key,[title,unit,,bank]] of Object.entries(encoderMeta)){ From 482c91595de14e8a4781679fb560a6cbee5dcfc9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:17:17 +0700 Subject: [PATCH 107/124] ux(vocal-throw): silent-ready performance controls, terse factual clock labels and native-tail illumination --- .../assets/mixer-native-vocal-throw.js | 44 ++++++++----------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 98a1a626c..1a9bf026b 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -92,27 +92,19 @@ function refreshMusicChannels(){ } function renderMusicStatus(tempo){ 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 label=$("vtMusicStatus"),clock=$("vtClockLabel"),number=$("vtDisplayBpm"); + const fallback=()=>{number.textContent=String(Math.round(accepted.bpm));clock.textContent="MAN";}; + if(tempoPending){label.textContent="CONNECT";label.title="Validating music channel";clock.textContent="CHECK";return;} + if(musicSource==="0"){label.textContent="TAP";label.title="Manual BPM / TAP";fallback();return;} + if(!musicReadback?.musicSourceActive){label.textContent="NO SIGNAL";label.title="Music source unavailable · manual BPM fallback";fallback();return;} + if(!musicReadback.musicLocked){label.textContent="LISTEN";label.title="Listening for beat · manual BPM fallback";fallback();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))); + const bpm=Math.round(Number(musicReadback.musicBpm)); + label.textContent=beatGrid?bpm+" · GRID":bpm+" · BPM"; + label.title="Auto tempo "+bpm+" BPM · "+confidence+"% confidence · "+(beatGrid?"beat grid":"BPM only"); + clock.textContent=beatGrid?"LOCK":"AUTO"; + number.textContent=String(bpm); } function syncPower(){ const state=snapshot(),id=current&&window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(current.track); @@ -302,7 +294,7 @@ window.ArSonMixNativeVocalThrow=Object.freeze({ const insert=state?.graph?.channels?.find(ch=>ch.id===id)?.inserts?.[slot]; if(native()&&state?.admitted&&insert?.catalogId===ID&&insert.id){ current.instanceId=insert.id;draft=defaults();accepted=defaults(); - hint("Reading accepted DSP settings"); + hint(""); }else if(!native()){draft=defaults();accepted=defaults(); hint("Browser preview only · no PCM");} else hint("Native FX instance unavailable"); @@ -315,7 +307,7 @@ backend()?.addEventListener?.("arMixBuiltinThrowTempoAck",reply=>{ if(!tempoPending||reply?.requestId!==tempoPending.requestId)return; if(reply.status==="APPLIED"){ musicSource=tempoPending.source; - hint("Music tempo source accepted by native PCM graph"); + hint(""); }else hint("Tempo source rejected · "+(reply.errorCode||"STALE")); tempoPending=null;refreshMusicChannels();renderMusicStatus(); requestSnapshot(true); @@ -329,7 +321,7 @@ backend()?.addEventListener?.("arMixBuiltinThrowAck",reply=>{ if(!pending||reply?.requestId!==pending.requestId)return; if(reply.status!=="APPLIED"){hint("DSP rejected · "+(reply.errorCode||"UNKNOWN")); pending=null;requestSnapshot(true);syncPower();return;} - if(pending.command==="nativeThrowTrigger"){hint("THROW executed by audio callback"); + if(pending.command==="nativeThrowTrigger"){hint(""); pending=null;requestSnapshot(true);syncPower();} else{pending.ack=true;requestSnapshot(true);} }); @@ -345,14 +337,16 @@ backend()?.addEventListener?.("arMixBuiltinThrowSnapshot",reply=>{ musicSource=String(reply.musicSourceChannelId||"0"); refreshMusicChannels();renderMusicStatus(reply); } - $("vtCount").textContent=String(reply.throwCount||0)+" throws"; + $("vtCount").textContent=String(reply.throwCount||0); + $("vtCount").setAttribute("aria-label",String(reply.throwCount||0)+" completed throws"); $("vtDot").classList.toggle("active",reply.tailActive===true); $("vtBeatRail").dataset.playing=String(reply.tailActive===true); - $("vtStatus").textContent=reply.tailActive?"ECHO TAIL":"NATIVE DSP"; + $("vtThrow").dataset.tail=String(reply.tailActive===true); + $("vtStatus").textContent=reply.tailActive?"TAIL":"LIVE"; if(pending){ if(!pending.ack||reply.appliedRequestId!==pending.requestId)return; accepted={...reply.settings};draft={...accepted};pending=null; - hint("Native DSP settings accepted"); + hint(""); }else{accepted={...reply.settings};draft={...accepted};} paint(); }); From aeb50935257179c6827c8442b37cf88012e94734 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:18:53 +0700 Subject: [PATCH 108/124] style(vocal-throw): source-inspired centerpiece neon play trigger, secondary wet and quiet concise faceplate --- site/preview-v2/assets/mixer-fx-rack.css | 363 ++++++++++++++--------- 1 file changed, 215 insertions(+), 148 deletions(-) diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index 0b240d2e5..68a48c4da 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -398,188 +398,264 @@ .mx-comp{top:4px;max-height:calc(100dvh - 8px)} } -/* ArSon Vocal Throw M4: hardware face from the user's Illustrator control - kit. Static vector knobs/buttons, no canvas animation, no browser DSP. - Shared Close and Power geometry/state owner: mixer-contextual-buttons.css. */ -.mx-vthrow{position:fixed;z-index:15001;top:clamp(7px,7vh,66px);left:clamp(7px,9vw,175px); +/* ArSon Vocal Throw M4 performance faceplate. + Hardware play trigger is derived from the user's Illustrator circular + illuminated control, not a text button. DSP Power/Close remain owned by + mixer-contextual-buttons.css together with EQ/Compressor. */ +.mx-vthrow{ + position:fixed;z-index:15001;top:clamp(7px,7vh,66px);left:clamp(7px,9vw,175px); width:min(778px,calc(100vw - 14px));max-height:calc(100dvh - 14px); display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box; - border:1px solid #51545f;border-radius:8px;color:#d4dce3; - background:linear-gradient(145deg,#333740,#22272e 35%,#242830 75%,#1d222a); - box-shadow:inset 0 1px 0 #ffffff33,inset 0 -1px 0 #090c1199, - 0 1px 0 #070910,0 17px 48px #000c; - font:400 11px/1.32 Inter,'Segoe UI',sans-serif} + color:#d5dce5;border:1px solid #505763;border-radius:9px; + background:linear-gradient(155deg,#323740,#242931 60%,#20252d); + box-shadow:inset 0 1px #ffffff21,inset 0 -1px #090c1199,0 18px 50px #000c; + font:400 11px/1.35 Inter,'Segoe UI',sans-serif; +} .mx-vthrow[hidden]{display:none} .mx-vthrow *{box-sizing:border-box} .mx-vthrow button{font:inherit;cursor:pointer} -.mx-vthrow :is(button,select,input):focus-visible{outline:2px solid #cf99ee;outline-offset:2px} -.mx-vthrow .vt-face-header{height:43px;flex:0 0 43px;display:flex;align-items:center;gap:9px; - min-width:0;padding:0 10px 0 15px;cursor:move;touch-action:none;user-select:none; - background:linear-gradient(#414750,#2b313a);border-bottom:1px solid #151a22; - box-shadow:inset 0 1px #ffffff2b,inset 0 -1px #ffffff0a} -.mx-vthrow .brand{display:flex;align-items:baseline;gap:8px;white-space:nowrap;flex:0 0 auto} -.mx-vthrow .brand-mark{font-size:9px;font-weight:700;color:#bf80dc;letter-spacing:.12em} -.mx-vthrow .brand-name{font-size:12px;font-weight:620;color:#edf0f4;letter-spacing:.075em} -.mx-vthrow .brand-type{font-size:9px;color:#979fab;letter-spacing:.1em} -.mx-vthrow .channel{min-width:0;max-width:105px;flex:1;overflow:hidden;text-overflow:ellipsis; - white-space:nowrap;font-size:9px;color:#b6a0c2} -.mx-vthrow .vt-preset{display:flex;align-items:center;gap:7px;margin-left:auto; - font-size:9px;letter-spacing:.09em;color:#9ca4af} -.mx-vthrow .vt-preset select{width:110px;height:25px;min-width:0;max-width:110px; - padding:0 6px;border:1px solid #555f6b;border-radius:4px; - background:linear-gradient(#272d35,#1c222b);color:#dce1e9;font:500 10px Inter,'Segoe UI',sans-serif} +.mx-vthrow :is(button,select,input):focus-visible{outline:2px solid #d88eff;outline-offset:3px} +.mx-vthrow .vt-face-header{ + height:42px;flex:0 0 42px;display:flex;align-items:center;gap:8px;min-width:0; + padding:0 10px 0 16px;cursor:move;touch-action:none;user-select:none; + background:linear-gradient(#3d444e,#292f38);border-bottom:1px solid #141922; + box-shadow:inset 0 1px #ffffff29,inset 0 -1px #ffffff09 +} +.mx-vthrow .brand{display:flex;align-items:baseline;gap:7px;white-space:nowrap;flex:0 0 auto} +.mx-vthrow .brand-mark{font-size:9px;font-weight:660;color:#c885e7;letter-spacing:.12em} +.mx-vthrow .brand-name{font-size:12px;font-weight:580;color:#f0eef4;letter-spacing:.055em} +.mx-vthrow .channel{min-width:0;max-width:120px;flex:1;overflow:hidden;text-overflow:ellipsis; + white-space:nowrap;font-size:9px;color:#aeb1ba} +.mx-vthrow .vt-preset{display:flex;align-items:center;gap:4px;margin-left:auto;min-width:0} +.mx-vthrow .vt-preset select{width:112px;height:25px;min-width:0;max-width:112px;padding:0 7px; + border:1px solid #525c68;border-radius:4px; + background:linear-gradient(#2a3039,#1f252e);color:#dce1e9;font:500 10px Inter,'Segoe UI',sans-serif} .mx-vthrow option{color:#e8eaf1;background:#272b34} -.mx-vthrow .vt-hardware{overflow:auto;overscroll-behavior:contain;min-height:0;display:grid;gap:0; +.mx-vthrow .vt-hardware{min-height:0;overflow:auto;overscroll-behavior:contain;display:grid; padding:0;scrollbar-width:thin;scrollbar-color:#565563 #22272e} -.mx-vthrow .vt-console{padding:13px 18px 13px; - background:linear-gradient(135deg,#30343b,#242932 66%,#2c3038); - border-bottom:1px solid #4b4c55;box-shadow:inset 0 1px #ffffff10} -.mx-vthrow .vt-console-eyebrow{display:flex;justify-content:space-between;align-items:center; - gap:8px;margin:0 0 3px;font-size:9px;letter-spacing:.16em;color:#c49bd9} -.mx-vthrow .vt-unit-id{color:#7f8c98;letter-spacing:.06em;white-space:nowrap} -.mx-vthrow .vt-unit-id i{display:inline-block;width:5px;height:5px;border-radius:50%; - background:#ac75ce;margin:0 6px 1px} -.mx-vthrow .vt-instrument{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 244px minmax(0,1fr); - align-items:center;gap:5px} -.mx-vthrow .vt-encoder-bank{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;min-width:0} -.mx-vthrow .vt-encoder{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0; - padding:7px 1px 3px} -.mx-vthrow .vt-encoder-name{height:12px;line-height:12px;color:#a4acb7; - font-size:8px;font-weight:540;letter-spacing:.07em;white-space:nowrap} -.mx-vthrow .vt-encoder-face{position:relative;display:block;flex:0 0 auto;width:66px;height:66px; - padding:0;border:0;background:transparent url("arson-vocal-hardware-encoder.svg") center/contain no-repeat; - border-radius:50%;touch-action:none;cursor:ns-resize;filter:drop-shadow(0 4px 5px #060a10bb)} +.mx-vthrow .vt-console{ + padding:13px 17px 14px;background:linear-gradient(135deg,#31363e,#262b34 65%,#2b2f38); + border-bottom:1px solid #515660;box-shadow:inset 0 1px #ffffff13 +} +.mx-vthrow .vt-instrument{ + display:grid;grid-template-columns:minmax(0,1fr) 226px minmax(0,1fr); + min-width:0;align-items:center;gap:8px +} +.mx-vthrow .vt-encoder-bank{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)); + min-width:0;gap:3px} +.mx-vthrow .vt-encoder{ + display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0; + padding:7px 0 4px +} +.mx-vthrow .vt-encoder-name{ + height:12px;line-height:12px;color:#a5acb8;font-size:8px;font-weight:530; + letter-spacing:.055em;white-space:nowrap +} +.mx-vthrow .vt-encoder-face{ + position:relative;display:block;flex:0 0 auto;width:66px;height:66px; + padding:0;border:0;border-radius:50%;touch-action:none;cursor:ns-resize; + background:transparent url("arson-vocal-hardware-encoder.svg") center/contain no-repeat; + filter:drop-shadow(0 4px 5px #060a10a8) +} .mx-vthrow .vt-encoder-needle{position:absolute;inset:0;transform:rotate(var(--turn,-130deg));pointer-events:none} -.mx-vthrow .vt-encoder-needle::after{content:"";position:absolute;left:calc(50% - 1.2px);top:17%; - width:2.4px;height:12px;border-radius:3px;background:#c989e4; - box-shadow:0 0 4px #b468ddaa} -.mx-vthrow .vt-encoder-value{font:500 11px/14px Inter,'Segoe UI',sans-serif; - color:#e6dfec;font-variant-numeric:tabular-nums;white-space:nowrap} -.mx-vthrow .vt-center{display:flex;flex-direction:column;align-items:center;gap:0;min-width:0} -.mx-vthrow .vt-hero-plate{width:230px;height:230px;position:relative;display:grid;place-items:center; - background:radial-gradient(circle at center,#11161d80,transparent 70%)} -.mx-vthrow .vt-hero-knob{position:relative;display:grid;place-items:center;width:224px;height:224px; - border:0;padding:0;border-radius:50%;outline-offset:-8px!important;cursor:ns-resize;touch-action:none; +.mx-vthrow .vt-encoder-needle::after{ + content:"";position:absolute;left:calc(50% - 1.2px);top:17%;width:2.4px;height:12px; + border-radius:3px;background:#c989e4;box-shadow:0 0 4px #b468ddaa +} +.mx-vthrow .vt-encoder-value{ + font:500 11px/14px Inter,'Segoe UI',sans-serif; + color:#e0dce6;font-variant-numeric:tabular-nums;white-space:nowrap +} +.mx-vthrow .vt-center{min-width:0;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:0} +.mx-vthrow .vt-throw-button{ + position:relative;display:block;width:212px;height:212px;flex:0 0 auto; + border:0;padding:0;border-radius:50%;overflow:visible; + background:transparent url("arson-vocal-throw-performance.svg") center/contain no-repeat; + filter:drop-shadow(0 8px 9px #090d15af); + transform:translateZ(0);transition:filter 150ms ease,transform 100ms ease; + touch-action:manipulation;cursor:pointer +} +.mx-vthrow .vt-throw-aura{ + position:absolute;inset:10%;border-radius:50%;pointer-events:none; + box-shadow:inset 0 0 0 1px #b267c821,0 0 0 1px #11141b; + transition:box-shadow 150ms ease; +} +.mx-vthrow .vt-throw-button:hover:not(:disabled){ + filter:brightness(1.19) drop-shadow(0 8px 10px #080c13ca) +} +.mx-vthrow .vt-throw-button:hover:not(:disabled) .vt-throw-aura{ + box-shadow:0 0 22px #bc36df3b,inset 0 0 0 1px #c17fdd3a +} +.mx-vthrow .vt-throw-button:active:not(:disabled){ + transform:scale(.958) translateY(2px); + filter:brightness(1.32) drop-shadow(0 1px 2px #000b) +} +.mx-vthrow .vt-throw-button[data-tail=true]:not(:disabled) .vt-throw-aura{ + box-shadow:0 0 29px #bb29e73f,inset 0 0 0 1px #e7a7f783 +} +.mx-vthrow .vt-throw-button:disabled{ + opacity:.53;filter:grayscale(.72) brightness(.8) +} +.mx-vthrow .vt-throw-engraving{ + margin-top:-2px;color:#a995b4;font-size:9px;letter-spacing:.24em;font-weight:560; + user-select:none +} +.mx-vthrow .vt-performance{ + display:grid;grid-template-columns:118px minmax(0,1fr) 104px; + align-items:center;column-gap:13px;min-height:91px;margin-top:-4px +} +.mx-vthrow .vt-wet-module{display:flex;justify-content:center;align-items:center} +.mx-vthrow .vt-hero-knob{ + position:relative;display:grid;place-items:center;width:86px;height:86px; + padding:0;border:0;border-radius:50%;cursor:ns-resize;touch-action:none; background:transparent url("arson-vocal-hardware-rotor.svg") center/contain no-repeat; - filter:drop-shadow(0 9px 9px #0c111a9c)} -.mx-vthrow .vt-hero-pointer{position:absolute;inset:0;transform:rotate(var(--turn,-130deg)); - pointer-events:none} -.mx-vthrow .vt-hero-pointer::after{content:"";position:absolute;top:22%;left:calc(50% - 3px); - width:6px;height:15px;clip-path:polygon(50% 100%,0 0,100% 0); - background:#e29aff;filter:drop-shadow(0 0 3px #a44dd4)} -.mx-vthrow .vt-hero-readout{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px; - pointer-events:none;margin-top:9px;text-shadow:0 1px #000a} -.mx-vthrow .vt-hero-readout small{font-size:10px;letter-spacing:.15em;color:#aab3c0} -.mx-vthrow .vt-hero-readout output{font:500 30px/1.15 'Segoe UI',Inter,sans-serif; - color:#f1e5f9;font-variant-numeric:tabular-nums;letter-spacing:-.02em} -.mx-vthrow .vt-dial-note{margin-top:-8px;color:#8f99a5;font-size:9px;letter-spacing:.1em} -.mx-vthrow .vt-performance{display:grid;grid-template-columns:146px minmax(0,1fr) 104px; - align-items:stretch;gap:12px;margin-top:2px} -.mx-vthrow .vt-throw-button{display:flex;flex-direction:column;justify-content:center;align-items:center; - gap:2px;height:60px;border:0;border-radius:15px;color:#241629; - background:transparent url("arson-vocal-hardware-push.svg") center/100% 100% no-repeat; - filter:drop-shadow(0 3px 5px #0008);text-shadow:0 1px #e7b6f154} -.mx-vthrow .vt-throw-main{font-size:17px;font-weight:700;letter-spacing:.18em;color:#24152c} -.mx-vthrow .vt-throw-button small{font-size:8px;letter-spacing:.11em;color:#452b52} -.mx-vthrow .vt-throw-button:active:not(:disabled){filter:brightness(.78) drop-shadow(0 1px 2px #000a)} -.mx-vthrow .vt-throw-button:disabled{opacity:.46;filter:grayscale(.7)} -.mx-vthrow .vt-trigger{display:flex;flex-direction:column;justify-content:center;gap:6px;align-items:center;min-width:0} -.mx-vthrow .vt-small-label{font-size:9px;font-weight:560;letter-spacing:.13em;color:#9ba5b1;white-space:nowrap} -.mx-vthrow .vt-mode-buttons,.mx-vthrow .vt-division-buttons{display:flex;align-items:center; - gap:2px;padding:3px;border:1px solid #171c23;border-radius:7px; - background:linear-gradient(#131820,#242a32);box-shadow:inset 0 2px 4px #060b11b8,0 1px #56606a3d} + filter:drop-shadow(0 3px 5px #080c13bd) +} +.mx-vthrow .vt-hero-pointer{position:absolute;inset:0;pointer-events:none;transform:rotate(var(--turn,-130deg))} +.mx-vthrow .vt-hero-pointer::after{ + content:"";position:absolute;top:22%;left:calc(50% - 2px); + width:4px;height:7px;clip-path:polygon(50% 100%,0 0,100% 0); + background:#e8aeff;filter:drop-shadow(0 0 2px #ad53d8) +} +.mx-vthrow .vt-hero-readout{ + pointer-events:none;display:flex;flex-direction:column;gap:1px; + align-items:center;text-shadow:0 1px #000c;margin-top:2px +} +.mx-vthrow .vt-hero-readout small{font-size:8px;letter-spacing:.12em;color:#abb0ba} +.mx-vthrow .vt-hero-readout output{font:500 15px/1.1 'Segoe UI',sans-serif; + color:#eedcf7;font-variant-numeric:tabular-nums} +.mx-vthrow .vt-trigger{min-width:0;display:flex;align-items:center;justify-content:center} +.mx-vthrow .vt-small-label{font-size:9px;font-weight:550;letter-spacing:.11em; + color:#a7acb6;white-space:nowrap} +.mx-vthrow .vt-mode-buttons,.mx-vthrow .vt-division-buttons{ + display:flex;align-items:center;gap:2px;padding:3px;border:1px solid #171c23; + border-radius:7px;background:linear-gradient(#131820,#242a32); + box-shadow:inset 0 2px 4px #060b11b8,0 1px #56606a3d +} .mx-vthrow :is(.vt-mode-buttons,.vt-division-buttons) button{ - flex:1;min-width:0;min-height:29px;padding:3px 7px;border:1px solid transparent;border-radius:4px; + flex:1;min-width:0;min-height:29px;padding:3px 7px; + border:1px solid transparent;border-radius:4px; background:linear-gradient(#3b424b,#2d343d);box-shadow:inset 0 1px #ffffff15; - color:#a6b0bc;font-size:10px;font-weight:580;letter-spacing:.03em} + color:#a6b0bc;font-size:10px;font-weight:580;letter-spacing:.03em +} .mx-vthrow :is(.vt-mode-buttons,.vt-division-buttons) button[aria-pressed=true]{ color:#f5e4ff;border-color:#784f8b;background:linear-gradient(#6a4c78,#3f344a); - box-shadow:inset 0 1px #efbaff2b,0 0 7px #b66bd327} -.mx-vthrow .vt-tap-button{height:60px;display:flex;flex-direction:column;align-items:center; - justify-content:center;gap:1px;color:#c8d0d9;background:linear-gradient(#414852,#262c35); - border:1px solid #4c5661;border-radius:12px;box-shadow:inset 0 1px #ffffff21,0 3px 6px #0008} + box-shadow:inset 0 1px #efbaff2b,0 0 7px #b66bd327 +} +.mx-vthrow .vt-tap-button{ + height:60px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px; + color:#c8d0d9;background:linear-gradient(#414852,#262c35); + border:1px solid #4c5661;border-radius:12px; + box-shadow:inset 0 1px #ffffff21,0 3px 6px #0008 +} .mx-vthrow .vt-tap-button span{font-size:14px;font-weight:640;letter-spacing:.12em} .mx-vthrow .vt-tap-button small{font-size:9px;letter-spacing:.12em;color:#a5b0bc} -.mx-vthrow .vt-tap-button:active{background:linear-gradient(#242931,#353b45);box-shadow:inset 0 2px 5px #000a} -.mx-vthrow .vt-virtual-input{position:absolute!important;width:1px!important;height:1px!important; +.mx-vthrow .vt-tap-button:active{background:linear-gradient(#242931,#353b45); + box-shadow:inset 0 2px 5px #000a} +.mx-vthrow .vt-virtual-input,.mx-vthrow .vt-screen-reader{ + position:absolute!important;width:1px!important;height:1px!important; padding:0!important;border:0!important;opacity:0!important;overflow:hidden!important; - pointer-events:none!important} -.mx-vthrow .vt-transport{min-width:0;display:grid;grid-template-columns:195px minmax(0,1fr) minmax(0,1fr); - gap:14px;padding:13px 18px 12px;background:linear-gradient(#222832,#20252d); - border-top:1px solid #0f141b;border-bottom:1px solid #4b525c} + pointer-events:none!important +} +.mx-vthrow .vt-transport{ + min-width:0;display:grid;grid-template-columns:187px minmax(0,1fr) minmax(0,1fr); + gap:14px;padding:12px 18px;background:linear-gradient(#232a33,#20252d); + border-top:1px solid #0f141b;border-bottom:1px solid #4b525c +} .mx-vthrow .vt-tempo,.mx-vthrow .vt-pulse,.mx-vthrow .vt-music-source{ - min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:6px} -.mx-vthrow .vt-clock-screen{height:43px;display:flex;align-items:baseline;gap:6px; - padding:3px 9px 5px;border:1px solid #344856;border-radius:4px; - background:linear-gradient(145deg,#07171e,#11232b);box-shadow:inset 0 2px 5px #0009} -.mx-vthrow #vtDisplayBpm{font:500 29px/34px 'Segoe UI',sans-serif;color:#c9efdd; - letter-spacing:-.02em;font-variant-numeric:tabular-nums} + min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:6px +} +.mx-vthrow .vt-clock-screen{ + height:41px;display:flex;align-items:baseline;gap:6px;padding:2px 9px 4px; + border:1px solid #344856;border-radius:4px; + background:linear-gradient(145deg,#07171e,#11232b);box-shadow:inset 0 2px 5px #0009 +} +.mx-vthrow #vtDisplayBpm{ + font:500 27px/33px 'Segoe UI',sans-serif;color:#c9efdd; + letter-spacing:-.02em;font-variant-numeric:tabular-nums +} .mx-vthrow .vt-clock-screen>span:nth-child(2){font-size:9px;color:#7da99a} -.mx-vthrow #vtClockLabel{margin-left:auto;align-self:center;color:#bb99c9;font-size:9px; - letter-spacing:.06em;text-align:right;max-width:76px} -.mx-vthrow .vt-manual-bpm{display:flex;align-items:center;gap:6px;color:#8794a1; - font-size:8px;letter-spacing:.1em} -.mx-vthrow .vt-manual-bpm input{width:56px;height:23px;padding:0 4px;border:1px solid #46525d; - border-radius:3px;background:#171e26;color:#d8dfea;font:500 11px 'Segoe UI',sans-serif; - text-align:center;font-variant-numeric:tabular-nums} +.mx-vthrow #vtClockLabel{ + margin-left:auto;align-self:center;color:#bb99c9;font-size:9px; + letter-spacing:.06em;text-align:right +} +.mx-vthrow .vt-manual-bpm{display:flex;align-items:center;gap:6px} +.mx-vthrow .vt-manual-bpm input{ + width:58px;height:22px;padding:0 4px;border:1px solid #46525d;border-radius:3px; + background:#171e26;color:#d8dfea;font:500 11px 'Segoe UI',sans-serif; + text-align:center;font-variant-numeric:tabular-nums +} .mx-vthrow .vt-division-buttons{height:40px} .mx-vthrow .vt-division-buttons button{height:31px;padding:3px 4px} .mx-vthrow .vt-repeat-leds{display:flex;align-items:center;gap:5px;white-space:nowrap;height:16px} .mx-vthrow .vt-repeat-leds i{display:block;width:15px;height:3px;border-radius:2px;background:#3d4550} .mx-vthrow .vt-repeat-leds i[data-on=true]{background:#b07ace;box-shadow:0 0 4px #bd7ed04d} .mx-vthrow .vt-repeat-leds[data-playing=true] i[data-on=true]{background:#c99ae0} -.mx-vthrow #vtRhythm{margin-left:auto;color:#8695a1;font-size:8px;letter-spacing:.06em} -.mx-vthrow .vt-music-source select{height:34px;width:100%;min-width:0;padding:0 7px; - border:1px solid #46515e;border-radius:5px;background:linear-gradient(#333a45,#252c36); - color:#d8e0e8;font:500 10px Inter,'Segoe UI',sans-serif} -.mx-vthrow .music-status{height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; - font-size:9px;color:#b69ac8} -.mx-vthrow .vt-status-rail{min-width:0;height:30px;display:flex;align-items:center; - justify-content:space-between;gap:14px;padding:0 17px;border-top:1px solid #090d13; - background:linear-gradient(#272d36,#232831);font-size:9px;letter-spacing:.045em;color:#929eaa} +.mx-vthrow .vt-music-source select{ + height:34px;width:100%;min-width:0;padding:0 7px; + border:1px solid #46515e;border-radius:5px; + background:linear-gradient(#333a45,#252c36); + color:#d8e0e8;font:500 10px Inter,'Segoe UI',sans-serif +} +.mx-vthrow .music-status{ + height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; + font-size:9px;color:#b69ac8 +} +.mx-vthrow .vt-status-rail{ + min-width:0;height:29px;display:flex;align-items:center; + justify-content:space-between;gap:14px;padding:0 17px; + border-top:1px solid #090d13;background:linear-gradient(#272d36,#232831); + font-size:9px;letter-spacing:.035em;color:#929eaa +} .mx-vthrow .vt-device{flex:0 0 auto;white-space:nowrap} -.mx-vthrow .dot{display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%; - background:#6f7781;box-shadow:0 0 0 1px #10141a} +.mx-vthrow .dot{ + display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%; + background:#6f7781;box-shadow:0 0 0 1px #10141a +} .mx-vthrow .dot.active{background:#b886d5;box-shadow:0 0 5px #b886d55c} -.mx-vthrow .vt-hint{min-width:0;flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.mx-vthrow .vt-hint{min-width:0;flex:1;text-align:center;overflow:hidden; + text-overflow:ellipsis;white-space:nowrap} .mx-vthrow #vtCount{flex:0 0 auto;white-space:nowrap} +.mx-vthrow[data-fx-state=off] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button), +.mx-vthrow[data-fx-state=rack-off] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button){ + opacity:.55;filter:grayscale(.55) brightness(.77) +} @media(max-width:770px){ .mx-vthrow{left:7px;top:7px} - .mx-vthrow .brand-type{display:none} .mx-vthrow .vt-console{padding:10px 10px 12px} - .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 200px minmax(0,1fr)} - .mx-vthrow .vt-hero-plate{width:196px;height:196px} - .mx-vthrow .vt-hero-knob{width:193px;height:193px} + .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 202px minmax(0,1fr);gap:3px} + .mx-vthrow .vt-throw-button{height:191px;width:191px} .mx-vthrow .vt-encoder-face{width:51px;height:51px} .mx-vthrow .vt-encoder-name{font-size:7px} - .mx-vthrow .vt-transport{grid-template-columns:160px minmax(0,1fr) minmax(0,1fr);gap:9px;padding:10px} + .mx-vthrow .vt-performance{grid-template-columns:106px minmax(0,1fr) 90px} + .mx-vthrow .vt-transport{grid-template-columns:160px minmax(0,1fr) minmax(0,1fr); + gap:9px;padding:10px} } @media(max-width:600px){ .mx-vthrow{width:calc(100vw - 10px);max-height:calc(100dvh - 10px);left:5px;top:5px} .mx-vthrow .vt-face-header{height:39px;flex-basis:39px;gap:5px;padding:0 7px} - .mx-vthrow .brand{gap:5px}.mx-vthrow .brand-mark{font-size:8px} + .mx-vthrow .brand{gap:5px} + .mx-vthrow .brand-mark{font-size:8px} .mx-vthrow .brand-name{font-size:10px} .mx-vthrow .channel{max-width:42px;font-size:8px} - .mx-vthrow .vt-preset{gap:3px;font-size:0} .mx-vthrow .vt-preset select{width:82px;max-width:82px;font-size:9px} - .mx-vthrow .vt-console-eyebrow{font-size:8px;letter-spacing:.08em} - .mx-vthrow .vt-unit-id{font-size:7px} .mx-vthrow .vt-instrument{display:flex;flex-direction:column;gap:0} - .mx-vthrow .vt-center{order:0} + .mx-vthrow .vt-center{order:0;margin-bottom:8px} .mx-vthrow #vtEncodersLeft{order:1} .mx-vthrow #vtEncodersRight{order:2} - .mx-vthrow .vt-hero-plate{width:176px;height:176px} - .mx-vthrow .vt-hero-knob{width:174px;height:174px} - .mx-vthrow .vt-hero-readout output{font-size:25px} - .mx-vthrow .vt-dial-note{font-size:8px} + .mx-vthrow .vt-throw-button{width:164px;height:164px} + .mx-vthrow .vt-throw-engraving{font-size:9px;margin-top:-4px} .mx-vthrow .vt-encoder-bank{width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:0} .mx-vthrow .vt-encoder{gap:3px;padding:3px 0 2px} .mx-vthrow .vt-encoder-face{width:53px;height:53px} .mx-vthrow .vt-encoder-name{font-size:8px} .mx-vthrow .vt-encoder-value{font-size:10px} - .mx-vthrow .vt-performance{grid-template-columns:96px minmax(0,1fr) 65px;gap:5px;margin-top:8px} - .mx-vthrow .vt-throw-button,.mx-vthrow .vt-tap-button{height:51px} - .mx-vthrow .vt-throw-main{font-size:13px;letter-spacing:.1em} + .mx-vthrow .vt-performance{grid-template-columns:82px minmax(0,1fr) 65px; + gap:5px;min-height:64px;margin-top:3px} + .mx-vthrow .vt-hero-knob{width:66px;height:66px} + .mx-vthrow .vt-hero-readout small{font-size:7px} + .mx-vthrow .vt-hero-readout output{font-size:12px} + .mx-vthrow .vt-tap-button{height:51px} .mx-vthrow .vt-trigger{gap:4px} .mx-vthrow .vt-mode-buttons button{font-size:8px;min-height:24px;padding:1px 3px} .mx-vthrow .vt-tap-button span{font-size:11px} @@ -596,21 +672,12 @@ .mx-vthrow .channel{display:none} .mx-vthrow .brand-name{font-size:9px} .mx-vthrow .vt-preset select{width:72px} - .mx-vthrow .vt-unit-id{display:none} } @media(max-height:590px) and (min-width:601px){ .mx-vthrow{top:4px;max-height:calc(100dvh - 8px)} .mx-vthrow .vt-console{padding-top:5px;padding-bottom:6px} - .mx-vthrow .vt-hero-plate{height:178px;width:178px} - .mx-vthrow .vt-hero-knob{height:176px;width:176px} - .mx-vthrow .vt-instrument{grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr)} + .mx-vthrow .vt-throw-button{height:174px;width:174px} +} +@media(prefers-reduced-motion:reduce){ + .mx-vthrow .vt-throw-button,.mx-vthrow .vt-throw-aura{transition:none} } - -/* FX power material follows accepted native graph readback, not CSS toggles. - Bypassed hardware remains editable but LEDs and controls recede visually. */ -.mx-vthrow[data-fx-state="off"] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button), -.mx-vthrow[data-fx-state="rack-off"] :is(.vt-hero-knob,.vt-encoder-face,.vt-throw-button){ - opacity:.55;filter:grayscale(.55) brightness(.77)} -.mx-vthrow[data-fx-state="off"] .vt-console-eyebrow, -.mx-vthrow[data-fx-state="rack-off"] .vt-console-eyebrow{color:#96939e} -@media(max-width:600px){.mx-vthrow .vt-center{margin-bottom:8px}} From 5afebbfc3aa61066a164c6760785c4b54e11d125 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:19:25 +0700 Subject: [PATCH 109/124] test(vocal-throw): icon-only singer trigger 160px+ CTA, quiet face and native audio ACK --- tests/approved_native_vocal_throw_smoke.py | 37 ++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 887535013..4c6b3aad1 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -113,19 +113,30 @@ def main(): assert last(page,"nativeThrowSnapshot")["requestId"]==initial["requestId"],\ "snapshot polling overwrote outstanding request too early" reply_snapshot(page,state,DEFAULTS) - assert editor.locator("#vtStatus").inner_text()=="NATIVE DSP" - assert editor.locator("#vtCount").inner_text()=="0 throws" + assert editor.locator("#vtStatus").inner_text()=="LIVE" + assert editor.locator("#vtCount").inner_text()=="0" box=editor.bounding_box() assert box and box["width"]<=778 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"),\ "premium FX editor overflows horizontal viewport" assert editor.locator("#vtDisplayBpm").inner_text()=="120" - assert editor.locator("#vtClockLabel").inner_text()=="MANUAL CLOCK" + assert editor.locator("#vtClockLabel").inner_text()=="MAN" assert editor.locator("#vtBeatRail i[data-on='true']").count()==3 assert editor.locator(".vt-encoder-face").count()==6 assert editor.locator("#vtWetDial[role='slider']").count()==1 assert editor.locator(".vt-throw-button").count()==1 + trigger=editor.locator("#vtThrow") + assert trigger.get_attribute("aria-label")=="Throw captured vocal phrase" + assert trigger.inner_text().strip()=="","Singer cue has no noisy visible words" + tb=trigger.bounding_box() + assert tb and tb["width"]>=160 and tb["height"]>=160 + assert editor.locator(".vt-throw-engraving").inner_text()=="THROW" + assert editor.locator("#vtTap").is_visible() + assert editor.locator("#vtMusicStatus").inner_text()=="TAP" + assert "FIRE PHRASE" not in editor.inner_text() + assert "SMART PHRASE / LIVE ENGINE" not in editor.inner_text() + assert "ZERO DRY LATENCY" not in editor.inner_text() assert editor.locator(".vt-mode-buttons button").count()==3 assert editor.locator(".vt-division-buttons button").count()==4 # No browser form hiding of basic parameters: real accessible @@ -136,10 +147,11 @@ def main(): # local file:// Chromium source cannot use fetch() for SVG URLs. for selector,name in [("#vtWetDial","rotor"), ('.vt-encoder-face',"encoder"), - ("#vtThrow","push")]: + ("#vtThrow","performance")]: bg=editor.locator(selector).first.evaluate( "(el)=>getComputedStyle(el).backgroundImage") - assert "arson-vocal-hardware-"+name+".svg" in bg,(selector,bg) + assert ("arson-vocal-throw-performance.svg" if name=="performance" + else "arson-vocal-hardware-"+name+".svg") in bg,(selector,bg) page.screenshot(path="arsonmix-vocal-throw-"+str(width)+".png") editor.screenshot(path="arsonmix-vocal-throw-editor-"+str(width)+".png") if width==1366: @@ -171,15 +183,15 @@ def main(): emit(page,"arMixBuiltinThrowQueue",{"requestId":cue["requestId"],"status":"QUEUED"}) emit(page,"arMixBuiltinThrowAck",{"requestId":cue["requestId"],"status":"APPLIED"}) reply_snapshot(page,state,{**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]},count=1,tail=True) - assert editor.locator("#vtCount").inner_text()=="1 throws" - assert editor.locator("#vtStatus").inner_text()=="ECHO TAIL" + assert editor.locator("#vtCount").inner_text()=="1" + assert editor.locator("#vtStatus").inner_text()=="TAIL" # Real native tempo-source command (not a browser-only BPM guess). source_menu=editor.locator("#vtMusicSource") assert source_menu.locator('option[value="'+RECEIVER+'"]').count()==1 source_menu.select_option(RECEIVER) request=last(page,"nativeThrowTempoSource") assert request["sourceChannelId"]==RECEIVER and request["channelId"]==SOURCE - assert editor.locator("#vtMusicStatus").inner_text().startswith("Validating") + assert editor.locator("#vtMusicStatus").inner_text()=="CONNECT" emit(page,"arMixBuiltinThrowTempoAck",{ "requestId":request["requestId"],"status":"APPLIED", "sourceChannelId":RECEIVER}) @@ -187,9 +199,8 @@ def main(): {**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]} if width==1366 else DEFAULTS, 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() - assert editor.locator("#vtClockLabel").inner_text()=="AUTO BPM" + assert editor.locator("#vtMusicStatus").inner_text()=="120 · BPM" + assert editor.locator("#vtClockLabel").inner_text()=="AUTO" # 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. @@ -203,8 +214,8 @@ def main(): {**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]} 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() - assert editor.locator("#vtClockLabel").inner_text()=="GRID LOCK" + assert editor.locator("#vtMusicStatus").inner_text()=="120 · GRID" + assert editor.locator("#vtClockLabel").inner_text()=="LOCK" if width==1366: # The next changed graph invalidates the old editor instance. state["graph"]["channels"][0]["inserts"][0]["id"]="replaced-instance" From 226218bf4e5c0414faaee90ec21950420a9a29da Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:20:18 +0700 Subject: [PATCH 110/124] design(vocal-throw): embed exact illuminated play artwork cropped from user Illustrator kit inside scalable SVG --- .../assets/arson-vocal-throw-performance.svg | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/site/preview-v2/assets/arson-vocal-throw-performance.svg b/site/preview-v2/assets/arson-vocal-throw-performance.svg index 28c775278..62712748f 100644 --- a/site/preview-v2/assets/arson-vocal-throw-performance.svg +++ b/site/preview-v2/assets/arson-vocal-throw-performance.svg @@ -16,8 +16,11 @@ - - - - + + + \ No newline at end of file From cb8187b8eb08d885a3590f648f14a22e0b55eae9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:20:59 +0700 Subject: [PATCH 111/124] fix(vocal-throw): face status follows actual native bypass, rack off and tail rather than decorative LIVE --- site/preview-v2/assets/mixer-native-vocal-throw.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-vocal-throw.js b/site/preview-v2/assets/mixer-native-vocal-throw.js index 1a9bf026b..5f68fc3d0 100644 --- a/site/preview-v2/assets/mixer-native-vocal-throw.js +++ b/site/preview-v2/assets/mixer-native-vocal-throw.js @@ -13,9 +13,6 @@ const presets={ }; const ranges={bpm:[60,200],repeats:[1,6],captureMs:[80,1500],silenceMs:[80,900], thresholdDb:[-65,-15],wet:[0,1],decay:[.15,.9],ducking:[0,1]}; -const fields={captureMs:["Capture","ms",5],silenceMs:["End pause","ms",10], - thresholdDb:["Voice gate","dB",1],wet:["Echo mix","%",.01], - decay:["Decay","%",.01],ducking:["Vocal duck","%",.01]}; const valid=s=>s&&[0,1,2].includes(s.mode)&&[0,1,2,3].includes(s.division)&& Object.entries(ranges).every(([k,[min,max]])=> Number.isFinite(s[k])&&s[k]>=min&&s[k]<=max); @@ -118,6 +115,9 @@ function syncPower(){ btn.setAttribute("aria-pressed",String(value==="on")); btn.setAttribute("aria-label",btn.title); $("vtThrow").disabled=value!=="on"||!!pending; + $("vtStatus").textContent=value==="on"? + ($("vtThrow").dataset.tail==="true"?"TAIL":"LIVE"): + value==="off"?"BYPASS":value==="rack-off"?"RACK OFF":"OFFLINE"; } function paint(){ $("vtMode").value=String(draft.mode);$("vtBpm").value=String(draft.bpm); From 6e6477ddd5da8c3e6df6e18911ee3f293eaa3f64 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:23:47 +0700 Subject: [PATCH 112/124] polish(vocal-throw): enlarge original Illustrator neon icon within singer performance button --- site/preview-v2/assets/arson-vocal-throw-performance.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/preview-v2/assets/arson-vocal-throw-performance.svg b/site/preview-v2/assets/arson-vocal-throw-performance.svg index 62712748f..84fdcf260 100644 --- a/site/preview-v2/assets/arson-vocal-throw-performance.svg +++ b/site/preview-v2/assets/arson-vocal-throw-performance.svg @@ -20,7 +20,7 @@ 4974954.ai Illustrator PDF at PDF rect x=53..77, y=100..124. The PDF has rasterized masks; keep its original lighting in this tiny embedded image, with editable vector hardware housing around it. --> - - + \ No newline at end of file From e719967d1ba6cbecd55a6ad6c9a43768fdb9855a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 07:24:09 +0700 Subject: [PATCH 113/124] test(vocal-throw): verify user Illustrator artwork embedded and native-ACK-gated singer trigger/tail glow --- tests/approved_native_vocal_throw_smoke.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/approved_native_vocal_throw_smoke.py b/tests/approved_native_vocal_throw_smoke.py index 4c6b3aad1..2421fea0b 100644 --- a/tests/approved_native_vocal_throw_smoke.py +++ b/tests/approved_native_vocal_throw_smoke.py @@ -42,6 +42,9 @@ def main(): spec=importlib.util.spec_from_file_location( "bundle",ROOT/"scripts/build_approved_native_gui.py") bundle=importlib.util.module_from_spec(spec);spec.loader.exec_module(bundle) + source_svg=(ROOT/"site/preview-v2/assets/arson-vocal-throw-performance.svg").read_text() + assert "data:image/webp;base64," in source_svg, "original user Illustrator icon must be embedded" + assert 'clip-path="url(#aiLens)"' in source_svg with tempfile.TemporaryDirectory(prefix="armix-throw-") as directory,sync_playwright() as pw: out=Path(directory);bundle.stage(out) browser=pw.chromium.launch(headless=True) @@ -177,6 +180,7 @@ def main(): reply_snapshot(page,state,updated,applied=rotary["requestId"]) assert "%" in editor.locator("#vtWetValue").inner_text() editor.locator("#vtThrow").click() + assert editor.locator("#vtThrow").is_disabled(), "no repeated stage cue until native ACK" cue=last(page,"nativeThrowTrigger") assert cue["instanceId"]==INSTANCE and cue["channelId"]==SOURCE assert cue["slot"]==0 @@ -185,6 +189,8 @@ def main(): reply_snapshot(page,state,{**DEFAULTS,"mode":0,"wet":rotary["settings"]["wet"]},count=1,tail=True) assert editor.locator("#vtCount").inner_text()=="1" assert editor.locator("#vtStatus").inner_text()=="TAIL" + assert editor.locator("#vtThrow").get_attribute("data-tail")=="true" + assert not editor.locator("#vtThrow").is_disabled() # Real native tempo-source command (not a browser-only BPM guess). source_menu=editor.locator("#vtMusicSource") assert source_menu.locator('option[value="'+RECEIVER+'"]').count()==1 From 86ec17b0e7d9e5ca93b5578a371168c9ae8673a8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 9 Nov 2026 08:47:48 +0700 Subject: [PATCH 114/124] design(vocal-throw): remove four directional markers; clean round singer THROW key --- site/preview-v2/assets/arson-vocal-throw-performance.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/preview-v2/assets/arson-vocal-throw-performance.svg b/site/preview-v2/assets/arson-vocal-throw-performance.svg index 84fdcf260..c3622667a 100644 --- a/site/preview-v2/assets/arson-vocal-throw-performance.svg +++ b/site/preview-v2/assets/arson-vocal-throw-performance.svg @@ -8,12 +8,12 @@ - +