From 224357cf61c8ea351446374f48b5d8f0648e9855 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:31:28 +0700 Subject: [PATCH 01/43] feat(geq31): add fixed ISO 31-band realtime stereo EQ core --- engine/builtin_fx/GraphicEq31Core.h | 127 ++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 engine/builtin_fx/GraphicEq31Core.h diff --git a/engine/builtin_fx/GraphicEq31Core.h b/engine/builtin_fx/GraphicEq31Core.h new file mode 100644 index 000000000..5233940ad --- /dev/null +++ b/engine/builtin_fx/GraphicEq31Core.h @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include +#include +#include + +namespace armix::builtin_fx { + +// IEC/ISO one-third-octave nominal centres, as used on dbx 31-band consoles. +// Fixed frequencies are an immutable DSP contract, independent of GUI labels. +inline constexpr std::array graphicEq31Hz {{ + 20.,25.,31.5,40.,50.,63.,80.,100.,125.,160.,200.,250., + 315.,400.,500.,630.,800.,1000.,1250.,1600.,2000.,2500., + 3150.,4000.,5000.,6300.,8000.,10000.,12500.,16000.,20000. +}}; +inline constexpr std::array graphicEq31Labels {{ + "20","25","31.5","40","50","63","80","100","125","160","200", + "250","315","400","500","630","800","1k","1.25k","1.6k", + "2k","2.5k","3.15k","4k","5k","6.3k","8k","10k", + "12.5k","16k","20k" +}}; + +class GraphicEq31Core final { +public: + static constexpr std::size_t bandCount=graphicEq31Hz.size(); + static constexpr double maximumDb=12.; + static constexpr double nominalQ=4.318473; // one-third-octave bandwidth + + bool prepare(double rate) noexcept { + ready_=std::isfinite(rate)&&rate>=8000.&&rate<=384000.; + if(!ready_)return false; + rate_=rate; + rampFrames_=std::max(32,static_cast(std::round(rate_*0.005))); + for(std::size_t i=0;i=bandCount||!std::isfinite(db)||db < -maximumDb||db>maximumDb) + return false; + auto& b=bands_[i]; + if(std::abs(b.db-db)<1e-5)return true; + b.db=db; + if(!ready_)return true; + b.target=coefficients(i,db,rate_); + const double inv=1./static_cast(rampFrames_); + b.step={ + (b.target.b0-b.current.b0)*inv, + (b.target.b1-b.current.b1)*inv, + (b.target.b2-b.current.b2)*inv, + (b.target.a1-b.current.a1)*inv, + (b.target.a2-b.current.a2)*inv + }; + b.frames=rampFrames_; + return true; + } + // In-place, stereo, no heap, locks or control-side work on the callback. + // Each band uses a bounded 5ms coefficient ramp to avoid gain-step clicks. + void processStereo(float* left,float* right,std::size_t frames) noexcept { + if(!ready_||!left||!right)return; + for(std::size_t n=0;n0) { + b.current.b0+=b.step.b0;b.current.b1+=b.step.b1; + b.current.b2+=b.step.b2;b.current.a1+=b.step.a1; + b.current.a2+=b.step.a2; + if(--b.frames==0)b.current=b.target; + } + const auto& c=b.current; + const double yl=c.b0*l+b.l1; + b.l1=c.b1*l-c.a1*yl+b.l2; + b.l2=c.b2*l-c.a2*yl; + const double yr=c.b0*r+b.r1; + b.r1=c.b1*r-c.a1*yr+b.r2; + b.r2=c.b2*r-c.a2*yr; + l=yl;r=yr; + } + left[n]=static_cast(l); + right[n]=static_cast(r); + } + } + void reset() noexcept { + for(auto& b:bands_)b.l1=b.l2=b.r1=b.r2=0.; + } +private: + struct Coeff { + double b0=1.,b1=0.,b2=0.,a1=0.,a2=0.; + }; + struct Band { + double db=0.; + Coeff current{},target{},step{}; + int frames=0; + double l1=0.,l2=0.,r1=0.,r2=0.; + }; + static Coeff coefficients(std::size_t i,double db,double rate) noexcept { + // Bands over the physical Nyquist guard are transparent at low sample + // rates. Preserve the operator's saved dB setting for a future rate. + const double hz=graphicEq31Hz[i]; + if(std::abs(db)<1e-5 || hz>=rate*0.45)return {}; + constexpr double pi=3.1415926535897932384626433832795; + const double omega=2.*pi*hz/rate; + const double cs=std::cos(omega); + const double alpha=std::sin(omega)/(2.*nominalQ); + const double a=std::pow(10.,db/40.); + const double norm=1./(1.+alpha/a); + return {(1.+alpha*a)*norm,(-2.*cs)*norm, + (1.-alpha*a)*norm,(-2.*cs)*norm, + (1.-alpha/a)*norm}; + } + std::array bands_{}; + double rate_=0.; + int rampFrames_=240; + bool ready_=false; +}; +} // namespace armix::builtin_fx From d36b833aa3fbb41afb34b27f806659e239bb2f71 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:33:36 +0700 Subject: [PATCH 02/43] feat(geq31): add JUCE built-in processor and 31 hardware-style native faders --- engine/builtin_fx/GraphicEq31Processor.h | 314 +++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 engine/builtin_fx/GraphicEq31Processor.h diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h new file mode 100644 index 000000000..2ba8330e2 --- /dev/null +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "GraphicEq31Core.h" +#include "../core/RealtimeNativeFxControl.h" +#include +#include +#include +#include +#include +#include +#include + +namespace armix::builtin_fx { + +class GraphicEq31Processor final : public juce::AudioProcessor, + public armix::mixer::RealtimeNativeFxControl { +public: + static constexpr const char* catalogIdentity="armix.builtin.graphic-eq31.v1"; + static constexpr int stateMagic=0x47455131; // GEQ1, independent of PEQ + GraphicEq31Processor() + : juce::AudioProcessor(BusesProperties() + .withInput("Input",juce::AudioChannelSet::stereo(),true) + .withOutput("Output",juce::AudioChannelSet::stereo(),true)), + params_(*this,nullptr,"GEQ31",makeParameters()) { + for(std::size_t i=0;i(bandValues_[i]->load(std::memory_order_relaxed))); + inputSmooth_.reset(sampleRate,.006); + outputSmooth_.reset(sampleRate,.006); + inputSmooth_.setCurrentAndTargetValue(dbToGain(inputValue_->load())); + outputSmooth_.setCurrentAndTargetValue(dbToGain(outputValue_->load())); + peak_.store(0.f,std::memory_order_relaxed); + } + void releaseResources() override {ready_=false;} + bool isReady() const noexcept {return ready_;} + void consumeRealtimeEdits() noexcept override { + // Parameters are JUCE atomic floats. Coefficients are computed at + // most once per changed band per block; no allocation or mutex. + if(!ready_)return; + for(std::size_t i=0;iload(std::memory_order_relaxed)); + } + void sealForRealtime() noexcept override {published_=true;} + // No pending control mailbox: JUCE publishes each target atomically. + bool stateSnapshotQuiescent() const noexcept override {return true;} + void processBlock(juce::AudioBuffer& pcm,juce::MidiBuffer&) override { + juce::ScopedNoDenormals noDenormals; + if(!ready_||pcm.getNumChannels()<2||pcm.getNumSamples()<=0)return; + consumeRealtimeEdits(); + const auto count=pcm.getNumSamples(); + auto* l=pcm.getWritePointer(0); + auto* r=pcm.getWritePointer(1); + inputSmooth_.setTargetValue(dbToGain(inputValue_->load(std::memory_order_relaxed))); + outputSmooth_.setTargetValue(dbToGain(outputValue_->load(std::memory_order_relaxed))); + for(int n=0;n(inputSmooth_.getNextValue()); + l[n]*=g;r[n]*=g; + } + core_.processStereo(l,r,static_cast(count)); + float peak=0.f; + for(int n=0;n(outputSmooth_.getNextValue()); + l[n]*=g;r[n]*=g; + peak=std::max(peak,std::max(std::abs(l[n]),std::abs(r[n]))); + } + peak_.store(peak,std::memory_order_relaxed); + } + void processBlock(juce::AudioBuffer&,juce::MidiBuffer&) override {} + void getStateInformation(juce::MemoryBlock& destination) override { + // CONTROL thread. Only one fixed-size, versioned state per insert. + juce::MemoryOutputStream out(destination,false); + out.writeInt(stateMagic);out.writeInt(1); + for(auto* p:bandValues_)out.writeFloat(p->load(std::memory_order_acquire)); + out.writeFloat(inputValue_->load(std::memory_order_acquire)); + out.writeFloat(outputValue_->load(std::memory_order_acquire)); + } + bool restoreUnpublishedState(const void* bytes,int length) { + constexpr int stateBytes=8+static_cast(GraphicEq31Core::bandCount+2)*4; + if(published_||!bytes||length!=stateBytes)return false; + juce::MemoryInputStream input(bytes,static_cast(length),false); + if(input.readInt()!=stateMagic||input.readInt()!=1)return false; + std::array data{}; + for(auto& v:data) { + v=input.readFloat(); + if(!std::isfinite(v)||v < -12.f||v>12.f)return false; + } + if(!input.isExhausted())return false; + for(std::size_t i=0;i=-12.f&&db<=12.f) + setParameter(paramId(index),db); + } + void setFlatFromUi() { + for(std::size_t i=0;i(i)); + } + static juce::AudioProcessorValueTreeState::ParameterLayout makeParameters() { + juce::AudioProcessorValueTreeState::ParameterLayout result; + for(std::size_t i=0;i( + juce::ParameterID{paramId(i),1}, + juce::String(graphicEq31Labels[i])+" Hz", + juce::NormalisableRange(-12.f,12.f,.1f),0.f)); + for(const auto& id:{"inputDb","outputDb"}) + result.add(std::make_unique( + juce::ParameterID{id,1},juce::String(id), + juce::NormalisableRange(-12.f,12.f,.1f),0.f)); + return result; + } + void setParameter(const juce::String& id,float db) { + if(auto* p=dynamic_cast(params_.getParameter(id))) { + p->beginChangeGesture(); + p->setValueNotifyingHost(p->convertTo0to1(db)); + p->endChangeGesture(); + } + } + static double dbToGain(float db) noexcept {return std::pow(10.,static_cast(db)/20.);} + juce::AudioProcessorValueTreeState params_; + GraphicEq31Core core_; + std::array*,GraphicEq31Core::bandCount> bandValues_{}; + std::atomic* inputValue_=nullptr; + std::atomic* outputValue_=nullptr; + juce::SmoothedValue inputSmooth_,outputSmooth_; + std::atomic peak_{0.f}; + bool published_=false,ready_=false; +}; + +class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce::Timer { +public: + explicit GraphicEq31Editor(GraphicEq31Processor& processor) + : juce::AudioProcessorEditor(processor),processor_(processor) { + setLookAndFeel(&skin_); + for(std::size_t i=0;i( + processor_.parameters(), "band"+juce::String(static_cast(i)),slider)); + } + for(auto* knob:{&input_,&output_}) { + knob->setSliderStyle(juce::Slider::RotaryHorizontalVerticalDrag); + knob->setTextBoxStyle(juce::Slider::TextBoxBelow,false,68,19); + knob->setDoubleClickReturnValue(true,0.); + addAndMakeVisible(*knob); + } + inputAttachment_=std::make_unique(processor_.parameters(),"inputDb",input_); + outputAttachment_=std::make_unique(processor_.parameters(),"outputDb",output_); + flat_.setButtonText("FLAT"); + flat_.onClick=[this]{processor_.setFlatFromUi();}; + addAndMakeVisible(flat_); + smile_.setButtonText("SMILE"); + smile_.onClick=[this] { + for(std::size_t i=0;i4500?2.5f:-1.f)); + } + }; + addAndMakeVisible(smile_); + peakLabel_.setJustificationType(juce::Justification::centred); + peakLabel_.setColour(juce::Label::textColourId,juce::Colours::black); + addAndMakeVisible(peakLabel_); + setSize(1500,328); + startTimerHz(20); + } + ~GraphicEq31Editor() override {stopTimer();setLookAndFeel(nullptr);} + void paint(juce::Graphics& g) override { + auto b=getLocalBounds().toFloat(); + g.setGradientFill(juce::ColourGradient( + juce::Colour::fromRGB(241,242,242),b.getTopLeft(), + juce::Colour::fromRGB(202,207,211),b.getBottomLeft(),false)); + g.fillRoundedRectangle(b.reduced(2.f),11.f); + g.setColour(juce::Colour::fromRGB(72,78,82)); + g.drawRoundedRectangle(b.reduced(3.f),11.f,2.f); + g.setColour(juce::Colours::black); + g.setFont(juce::Font(20.f,juce::Font::plain)); + g.drawText("GRAPHIC EQ 31",juce::Rectangle(20,12,250,31), + juce::Justification::centredLeft); + g.setFont(juce::Font(11.f,juce::Font::plain)); + g.drawText("ARSONMIX | 1/3 OCTAVE",juce::Rectangle(23,44,190,22), + juce::Justification::centredLeft); + g.drawText("INPUT",juce::Rectangle(18,78,72,20),juce::Justification::centred); + g.drawText("OUTPUT",juce::Rectangle(92,78,72,20),juce::Justification::centred); + g.drawText("+12",juce::Rectangle(169,81,34,22),juce::Justification::centred); + g.drawText("0",juce::Rectangle(169,170,34,22),juce::Justification::centred); + g.drawText("-12",juce::Rectangle(169,259,34,22),juce::Justification::centred); + g.setColour(juce::Colour::fromRGB(70,75,78)); + g.drawLine(202.f,65.f,202.f,291.f,1.f); + g.setFont(juce::Font(11.f,juce::Font::plain)); + g.drawText("31 FIXED FREQUENCY BANDS \xC2\xB1 12 dB", + juce::Rectangle(220,294,getWidth()-235,20), + juce::Justification::centred); + } + void resized() override { + input_.setBounds(19,102,69,83); + output_.setBounds(92,102,69,83); + flat_.setBounds(19,205,68,27); + smile_.setBounds(93,205,68,27); + peakLabel_.setBounds(16,253,150,26); + constexpr int x0=211,step=41; + for(std::size_t i=0;i(i)*step; + labels_[i].setBounds(x,61,40,19); + sliders_[i].setBounds(x+3,83,34,203); + } + } +private: + class EqSkin final : public juce::LookAndFeel_V4 { + public: + void drawLinearSlider(juce::Graphics& g,int x,int y,int width,int height, + float sliderPos,float /*minPos*/,float /*maxPos*/, + juce::Slider::SliderStyle,juce::Slider&) override { + const float cx=x+width*.5f; + g.setColour(juce::Colour::fromRGB(175,180,184)); + for(int t=0;t<=12;++t) { + const float yy=y+11.f+(height-22.f)*t/12.f; + const float length=t==6?12.f:6.f; + g.drawLine(cx-11.f,yy,cx-11.f+length,yy,.9f); + g.drawLine(cx+11.f-length,yy,cx+11.f,yy,.9f); + } + g.setColour(juce::Colour::fromRGB(19,27,31)); + g.fillRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f); + g.setColour(juce::Colour::fromRGB(61,67,70)); + g.drawRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f,1.f); + const auto py=juce::jlimit(static_cast(y+11), + static_cast(y+height-11),sliderPos); + g.setColour(juce::Colour::fromRGB(94,98,103).withAlpha(.35f)); + g.fillRoundedRectangle(cx-17.f,py-13.f,34.f,27.f,7.f); + g.setGradientFill(juce::ColourGradient( + juce::Colours::white,cx,py-10.f, + juce::Colour::fromRGB(187,191,195),cx,py+10.f,false)); + g.fillRoundedRectangle(cx-13.f,py-11.f,26.f,22.f,7.f); + g.setColour(juce::Colour::fromRGB(131,137,141)); + g.drawRoundedRectangle(cx-13.f,py-11.f,26.f,22.f,7.f,1.f); + g.setColour(juce::Colour::fromRGB(225,228,230)); + g.drawLine(cx-8.f,py,cx+8.f,py,1.2f); + } + }; + void timerCallback() override { + const auto p=processor_.observedPeak(); + const bool clip=p>=.999f; + peakLabel_.setText(clip?"CLIP":"OUTPUT LEVEL", + juce::dontSendNotification); + peakLabel_.setColour(juce::Label::backgroundColourId, + clip?juce::Colour::fromRGB(233,76,55): + juce::Colour::fromRGB(173,192,177)); + } + using Attachment=juce::AudioProcessorValueTreeState::SliderAttachment; + GraphicEq31Processor& processor_; + EqSkin skin_; + std::array sliders_; + std::array labels_; + std::vector> attachments_; + juce::Slider input_,output_; + std::unique_ptr inputAttachment_,outputAttachment_; + juce::TextButton flat_,smile_; + juce::Label peakLabel_; +}; +inline juce::AudioProcessorEditor* GraphicEq31Processor::createEditor() { + return new GraphicEq31Editor(*this); +} +} // namespace armix::builtin_fx From cbda60c47b60245495a3609bb9797353665d8e39 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:33:55 +0700 Subject: [PATCH 03/43] feat(geq31): register Graphic EQ 31 as first-class native FX --- src/NativeBuiltInFx.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NativeBuiltInFx.h b/src/NativeBuiltInFx.h index b03a5ac4b..fd5429807 100644 --- a/src/NativeBuiltInFx.h +++ b/src/NativeBuiltInFx.h @@ -3,6 +3,7 @@ #include "../engine/builtin_fx/ChannelEqProcessor.h" #include "../engine/builtin_fx/ChannelCompressorProcessor.h" +#include "../engine/builtin_fx/GraphicEq31Processor.h" #include "../engine/builtin_fx/ChannelHarmonyProcessor.h" #include "../engine/builtin_fx/VocalThrowProcessor.h" #include "../engine/builtin_fx/GuitarRigEditor.h" @@ -66,6 +67,11 @@ inline constexpr std::array nativeBuiltInFx{ "NATIVE_EQ_UNSUPPORTED_AUDIO_FORMAT","NATIVE_EQ_PREPARE_REJECTED", "NATIVE_EQ_PREPARE_EXCEPTION","Saved native EQ state rejected; graph unchanged", prepareNativeBuiltInFx}, + NativeBuiltInFx{GraphicEq31Processor::catalogIdentity,"Graphic EQ 31","EQ",true,8000.,384000., + "NATIVE_GEQ31_HOST_UNAVAILABLE","NATIVE_GEQ31_DEVICE_CHANGED", + "NATIVE_GEQ31_UNSUPPORTED_AUDIO_FORMAT","NATIVE_GEQ31_PREPARE_REJECTED", + "NATIVE_GEQ31_PREPARE_EXCEPTION","Saved Graphic EQ 31 state rejected; graph unchanged", + prepareNativeBuiltInFx}, NativeBuiltInFx{ChannelCompressorProcessor::catalogIdentity,"Compressor","Dynamics",true,8000.,384000., "NATIVE_COMP_HOST_UNAVAILABLE","NATIVE_COMP_DEVICE_CHANGED", "NATIVE_COMP_UNSUPPORTED_AUDIO_FORMAT","NATIVE_COMP_PREPARE_REJECTED", From 7ee7ba2d676773ffca705b555e34d4df8f046153 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:34:49 +0700 Subject: [PATCH 04/43] test(geq31): verify standard centres, PCM response and realtime stability --- tests/graphic_eq31_core_test.cpp | 85 ++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 tests/graphic_eq31_core_test.cpp diff --git a/tests/graphic_eq31_core_test.cpp b/tests/graphic_eq31_core_test.cpp new file mode 100644 index 000000000..19d7f7108 --- /dev/null +++ b/tests/graphic_eq31_core_test.cpp @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#include "../engine/builtin_fx/GraphicEq31Core.h" +#include +#include +#include +#include +#include +#include +#include + +using armix::builtin_fx::GraphicEq31Core; +using armix::builtin_fx::graphicEq31Hz; + +static double rms(const std::vector& x,std::size_t from) { + double energy=0.; + for(std::size_t i=from;i(x[i])*x[i]; + return std::sqrt(energy/static_cast(x.size()-from)); +} +static double responseDb(std::size_t band,double gain,double toneHz,int rate) { + GraphicEq31Core eq; + assert(eq.prepare(rate)); + assert(eq.setGain(band,gain)); + constexpr std::size_t count=96000; + std::vector left(count),right(count); + for(std::size_t i=0;i(std::sin( + 6.2831853071795864769*toneHz*i/static_cast(rate))); + left[i]=right[i]=sample; + } + const double dry=rms(left,count/2); + for(std::size_t i=0;i(97,count-i)); + const double wet=rms(left,count/2); + return 20.*std::log10(wet/dry); +} +int main() { + static_assert(GraphicEq31Core::bandCount==31); + for(std::size_t i=1;igraphicEq31Hz[i-1]); + assert(graphicEq31Hz.front()==20.); + assert(graphicEq31Hz.back()==20000.); + GraphicEq31Core eq; + assert(!eq.prepare(std::numeric_limits::quiet_NaN())); + assert(!eq.prepare(7999.)); + assert(!eq.prepare(384001.)); + assert(eq.prepare(48000.)); + assert(!eq.setGain(31,3.)); + assert(!eq.setGain(1,13.)); + assert(!eq.setGain(1,-13.)); + assert(!eq.setGain(1,std::numeric_limits::infinity())); + assert(eq.setGain(17,6.)); + assert(std::fabs(eq.gainDb(17)-6.)<1e-8); + assert(responseDb(17,6.,1000.,48000)>5.4); + assert(responseDb(17,-6.,1000.,48000)<-5.4); + assert(std::fabs(responseDb(17,6.,200.,48000))<.6); + // Stereo isolation: a silent right channel must remain silent. + std::array l{},r{}; + l[0]=.5f; + for(int i=0;i<100;++i) { + eq.processStereo(l.data(),r.data(),l.size()); + for(auto s:r)assert(s==0.f); + for(auto s:l)assert(std::isfinite(s)); + l.fill(0.f); + } + // Low sample rate: out-of-Nyquist bands must be safely transparent. + GraphicEq31Core low; + assert(low.setGain(30,12.)); + assert(low.prepare(8000.)); + std::array ll{},rr{}; + ll[0]=rr[0]=.25f; + low.processStereo(ll.data(),rr.data(),ll.size()); + assert(std::fabs(ll[0]-.25f)<1e-6f); + for(std::size_t i=1;i((iteration%255)+1)); + for(auto s:l)assert(std::isfinite(s)); + for(auto s:r)assert(std::isfinite(s)); + } + std::puts("Graphic EQ 31 core: frequencies, response, stereo isolation, Nyquist, stress PASS"); +} From 67f16e0f3a103586c3f9d5a89c35294d692489e5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:35:04 +0700 Subject: [PATCH 05/43] build(geq31): include deterministic DSP test in native mixer gate --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d3fad01c..f3d2b57db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1611,6 +1611,14 @@ if(BUILD_TESTING) add_test(NAME NativePEQEightBandsRTAndFrequencyResponse COMMAND ARMixNativeChannelEqTests) add_dependencies(ARMixMixerRoutingTests ARMixNativeChannelEqTests) + # Graphic EQ 31: ISO one-third-octave centres, stereo PCM, Nyquist and RT ramps. + add_executable(ARMixGraphicEq31CoreTests tests/graphic_eq31_core_test.cpp + engine/builtin_fx/GraphicEq31Core.h) + target_compile_features(ARMixGraphicEq31CoreTests PRIVATE cxx_std_20) + add_test(NAME GraphicEq31FrequencyResponseAndRealtimeStability + COMMAND ARMixGraphicEq31CoreTests) + add_dependencies(ARMixMixerRoutingTests ARMixGraphicEq31CoreTests) + # Zero-lookahead native compressor DSP: zero PDC, stereo-linked peak, # soft knee, dry/wet, parameter validation and variable sample rates. add_executable(ARMixNativeCompressorTests tests/builtin_channel_compressor_test.cpp From 6d3db7817231420a28d24cbe6d67a13f96bdb489 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:39:36 +0700 Subject: [PATCH 06/43] feat(geq31): expose Graphic EQ 31 in native FX picker fallback --- web/approved-native-bridge.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 109d16152..e97352736 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -1379,6 +1379,8 @@ let nativeBuiltins=Object.freeze([ Object.freeze({id:"armix.builtin.channel-eq.v1",name:"Parametric EQ", vendor:"ArSonMix",category:"EQ",format:"Native",source:"builtin"}), + Object.freeze({id:"armix.builtin.graphic-eq31.v1",name:"Graphic EQ 31", + vendor:"ArSonMix",category:"EQ",format:"Native",source:"builtin"}), Object.freeze({id:"armix.builtin.channel-compressor.v1",name:"Compressor", vendor:"ArSonMix",category:"Dynamics",format:"Native",source:"builtin"}), Object.freeze({id:"armix.builtin.arson-harmony.v1",name:"Harmonice", From 2aec94e8e29f802e07a66a572d762ff830427501 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:40:54 +0700 Subject: [PATCH 07/43] assets(geq31): preserve user-supplied slider vector geometry (thumb raster removed) --- assets/fx/graphic-eq31/slider_eq_vector.svgz | Bin 0 -> 2098 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/fx/graphic-eq31/slider_eq_vector.svgz diff --git a/assets/fx/graphic-eq31/slider_eq_vector.svgz b/assets/fx/graphic-eq31/slider_eq_vector.svgz new file mode 100644 index 0000000000000000000000000000000000000000..cbe7d9fa176804ee5d024cba0f6521fecc037336 GIT binary patch literal 2098 zcmV-22+j8&iwFP!00002|Lt4LZrex}-OpDLYBZ1la;e@A#qPy$F&My&SzshqFAPO8WI*?e^|xLdE61=k^ewj7n=4&%w+}wP+o=um#Evt3A_@g)IwzJok6f#Pq zEZI^+WrVdpnBkdHNw^SF*s(!&+U9y)VNeFuH~P1Wpp~+ZpiOco4C8k4-w)cFp$3NV z`S__1&U`WdU(+r=4MtmZN0S%0t4#V#3zNXxbddFA_dB&Muhw_f&Bfr?WJDMm>4dvf z5ChM6mp_nfp5e^tBkxp5)0IUp=j5h`LuU_ml2K_Xg=193oDBo0#baX?&xgb$lIAS^OCrNO~T z90(UlhEKwD$v|9$MD#rg#6?Ir-IG9Eq$Xm-rHg9NVB!QlEyBnTHFVUqA23B*N6fHdBaKwN}`);$Tt?@nSzLBFhlVeZmd0~?seib!DM zz!I1^lu*FLffX=uC?SA37bJi=7X|b$aUlIm6bi^+t_G677IIKT{SpUKzeJ&c_~j^& z_~j@R(7wchv@cO8AbojMlJq4CC6q5`f|M_3qJZ#a4kUb;Ljm2(97y*vhXS&f>w#o1 z*Fyo-%N$7cGKT`9mpPE=Wex>2FLNNx%NzD5T^Eq_5i|E&WSj*`3Q{dB_UK=s?IP8SJ4$#2B9l5L$Ho0 ziMSOwa!&%NmjIx_8jf%S>PolV(D=L?j4$o%!%x3oPUp>4t6q98zSpxT6yL`4?hla^ z9#{%rcWt49wL4>4#XwJJ(QS}K5J(9rt|M{C z!64{_>Y#+>g5YanbGBGsT~F8F#&Dr~Rb;>?%eNwA(f1HA9)^8SgfMQJ+q~`i5u%zP z#5Iv2cw5mmCPfGn^F~;cb#A3wa^DQGE;f`7;uSEwh!`oX-v?l}iB zvC6|No*|TcUkVns``uKJuqy^`r@VJpmWFurS>+l#?ZzyI_8YSO^==$SX>M%v}$)+=-E;OjfS1Mi~Y$hetg~6HB+Wb%u#oD^N62aj7SUxYC>4>cXaPhG>Cd)GQj%PuDGD z1Z%R(t$eqLgRSRqz*qPBQBHO_n+#zV*4a0FfSP?nm{kn5k{8(5WJne=R5;mj9AI+q zqLX+9ceyp+82k1d4*2Fjo;00zKR9u;t^7vgM#QaAB+}L|cb;xNw+V!|`_&0(Yw4YZ zx!J(7=8TETeE*}9LqnF!8c9cCi#-z=F|1+VgPej`)~Xu)4%4wt(yMyf4=j@Kfr)Xu z`tE|yuLnVByw}*?Kbka_BJ5!FG08kIvT+lHpJU9py=Gw6*PsL8bA*}jHf+*c#73Q% zr&9{ly;FfoP`gfq7-0*Vk8+3tMR}HOKB)AH3WcGm6?m?WNv7VPO^xr0aU1P^sJ09w zf)}7;YRkL@9d%-CPN@q2&Q;-aRrsB%0Ku!0iGNkapR_8%`&9*O2y_G)z=!Rb!VB&6 cUo%Cqnm8ZvM&=yW!=Kufz literal 0 HcmV?d00001 From 1c2dd2c1efec94f5dc74bbaefe4b13ba3334d0a7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:42:55 +0700 Subject: [PATCH 08/43] test(geq31): prove native registry, state restore and PCM lease lifecycle --- tests/native_fx_registry_extension_test.cpp | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/native_fx_registry_extension_test.cpp b/tests/native_fx_registry_extension_test.cpp index 3e3dbde77..945bb2a4e 100644 --- a/tests/native_fx_registry_extension_test.cpp +++ b/tests/native_fx_registry_extension_test.cpp @@ -420,7 +420,46 @@ static void verifyFirstSoundGuitarProcessor() { static_cast(snapshot.getSize()))); } + +static void verifyGraphicEq31Processor() { + const auto* descriptor=armix::builtin_fx::findNativeBuiltInFx( + armix::builtin_fx::GraphicEq31Processor::catalogIdentity); + assert(descriptor && descriptor->showInPicker); + assert(juce::String(descriptor->name)=="Graphic EQ 31"); + auto processor=descriptor->prepare(48000.,128,nullptr,0); + assert(processor && processor->getLatencySamples()==0); + auto* geq=dynamic_cast(processor.get()); + assert(geq && geq->isReady()); + geq->setBandFromUi(17,6.f); + juce::MemoryBlock state; + processor->getStateInformation(state); + assert(state.getSize()==8u+(31u+2u)*4u); + auto restored=descriptor->prepare(44100.,256, + state.getData(),static_cast(state.getSize())); + assert(restored && restored->getName()=="Graphic EQ 31"); + juce::MemoryBlock roundtrip; + restored->getStateInformation(roundtrip); + assert(roundtrip==state); + juce::AudioBuffer pcm(2,256); + pcm.clear();pcm.setSample(0,0,.5f);pcm.setSample(1,0,-.5f); + juce::MidiBuffer midi; + processor->processBlock(pcm,midi); + for(int ch=0;ch<2;++ch) + for(int n=0;nprepare(48000.,128,malformed.getData(), + static_cast(malformed.getSize()))); + assert(!descriptor->prepare(48000.,128,state.getData(), + static_cast(state.getSize()-1))); + geq->sealForRealtime(); + assert(!geq->restoreUnpublishedState(state.getData(), + static_cast(state.getSize()))); +} + int main() { + verifyGraphicEq31Processor(); verifySharedNativeFxControlRequest(); verifyFirstSoundGuitarProcessor(); const auto* found=findNativeBuiltInFxIn(injected,"armix.test.fixture-gain.v1"); From 4d52abb14ef1c8953e3f569cc237d25e5bd8a05b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:48:41 +0700 Subject: [PATCH 09/43] assets(geq31): isolate user's SVG fader track for dynamic thumb --- assets/fx/graphic-eq31/slider_eq_vector.svgz | Bin 2098 -> 1821 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/fx/graphic-eq31/slider_eq_vector.svgz b/assets/fx/graphic-eq31/slider_eq_vector.svgz index cbe7d9fa176804ee5d024cba0f6521fecc037336..3756e0438539aebc9211f799f7781a92ff2b6be9 100644 GIT binary patch literal 1821 zcmV+&2jci2iwFP!00002|Lt1KZrer_-S;a97KLL#8qJIIkSzzO7Tvh$qRl3o!nJ9c zh%5;d{YbyQ_d!aQW7)D|W4ed~hDXEU<++cUIV0-$KtT9Oa9;1k1N&o-LcNQ)sxXrqh0XGcAYZZ8@7?TpXQGtHox^ zvZ?1^%KmlLl=ZZN(@@Ey{N$$${*EVEQ=iS2m-G61lwY4Ub#?#23gzI>_ayvVedrfX zNFAiLJsX42RuzRlZ0&5dC4~&qC`-0fPZ?pY^QPBVDvHAU=r?STow_`4G7L(deWm}q z2wExE5wuZmgke}u{`sJ->1kjH$KlaBIJ5ce-?E+`<%0)w2a^}LtCnYIu3|akZ^t#2ZTumr!+V?i38yz$#7AaE*XfEkO*!~0&x-&g|8 z0&x-&gpG1Oi5)vi~*O5S+gakQQoYO}f#_upBzl=c0?o@DNb@p>1d^9m zOp?6BA%)^)4y1UQLju9e97ymohXi_;Igs9E4vFOMijdbLLL`J4J41T_VX~qSp=aAO zFt(?JP-&@g3!^A9y2DB@bVg}ZUv6qlK|=^0BCRwXLta0rAMx4eBKPkO+Eea z^WUe{tURmLOW%uc^(+X*k8!;FLnMU*mcos@HlM-T9k5?SI+oBlsIDzU^wtQ+s4%B= zM!&+ig@v$L@bnEWx($*D0x2QI<3JqRU=S>X>Y#+>g5Yan)1NQS&a39@5N<496&di! z@}me@^xb=mhhg6%A&i^mHfOtjgs3J6aZR)kyv^ty69a^ac_SQ?b#A3ca^DtWU92cQ zlYhNO{>cxIBaQtakDziLdh3Me+OQO6On|kJAWszx2zYZ#keJ8-y$E6MWji7u_YA>8 zB!|I3Aa@;DfQyFQjh(w1qPX&0pYE89t-04b<^I|2t#|Mc4Pt4`CVmdTe9Pd)eV9N`W7( z=p7EHn}|VCM980pSpc2GZ>3;hddvk}4LlVf8hguk1SEV#{N!>fcmUB#ey3?NvG zkXgP)ZRDaC51bvZLV$OuN5T5eyua>y4q{@JgITpKOy}P6R zfR
^n6CBt%oJPzI)mdMi| zjxWl~<%9MqO~=30XBSmDYqAQ$*)7p|cCYyLH=pkHD2K+cnm$e1TRzRIW;x1lmSz1X z{ygB1*{5Z>zWmoW@3Rez4jB3LR=dL}L<)za1UCIHn8W-GX>FkWJE~2-45A+!|Y(EFk9^yuw!ta@Uk7X-3U%yc(|vG z3^tRtQ#SQGWfRI<7SZu<6j}@t!UX5{$R;cdA;K)MLkjdZ8$clXUW_}~aNBIa3f5B+ zU&iiYCdTb{VoxcEjQWmhc)`d%)nMOiY{R@4B>!Ti!v*XtylcO6H;~(R8r$1Plg3g6 zS)g}G<})K3l?5KVm?^fJfn`oxjmHjV{M)dJZxI`{XP)*c(Bhp6RQCG15IzLZb?sU9 zaQRgZUj-@Qyo#@=P#Bt8f#+(MWa{nN)c67hwQ2EPwPhd?ya4S|Tjnk3s6At|PgS^g zt_s&yh1;kK*siN+!jG!>pH_u`zp8*Of({@9`1Ek504ZPSA2UU=nm8WtM&=lQEPe7H LZu3cLdo2I}J9uV< literal 2098 zcmV-22+j8&iwFP!00002|Lt4LZrex}-OpDLYBZ1la;e@A#qPy$F&My&SzshqFAPO8WI*?e^|xLdE61=k^ewj7n=4&%w+}wP+o=um#Evt3A_@g)IwzJok6f#Pq zEZI^+WrVdpnBkdHNw^SF*s(!&+U9y)VNeFuH~P1Wpp~+ZpiOco4C8k4-w)cFp$3NV z`S__1&U`WdU(+r=4MtmZN0S%0t4#V#3zNXxbddFA_dB&Muhw_f&Bfr?WJDMm>4dvf z5ChM6mp_nfp5e^tBkxp5)0IUp=j5h`LuU_ml2K_Xg=193oDBo0#baX?&xgb$lIAS^OCrNO~T z90(UlhEKwD$v|9$MD#rg#6?Ir-IG9Eq$Xm-rHg9NVB!QlEyBnTHFVUqA23B*N6fHdBaKwN}`);$Tt?@nSzLBFhlVeZmd0~?seib!DM zz!I1^lu*FLffX=uC?SA37bJi=7X|b$aUlIm6bi^+t_G677IIKT{SpUKzeJ&c_~j^& z_~j@R(7wchv@cO8AbojMlJq4CC6q5`f|M_3qJZ#a4kUb;Ljm2(97y*vhXS&f>w#o1 z*Fyo-%N$7cGKT`9mpPE=Wex>2FLNNx%NzD5T^Eq_5i|E&WSj*`3Q{dB_UK=s?IP8SJ4$#2B9l5L$Ho0 ziMSOwa!&%NmjIx_8jf%S>PolV(D=L?j4$o%!%x3oPUp>4t6q98zSpxT6yL`4?hla^ z9#{%rcWt49wL4>4#XwJJ(QS}K5J(9rt|M{C z!64{_>Y#+>g5YanbGBGsT~F8F#&Dr~Rb;>?%eNwA(f1HA9)^8SgfMQJ+q~`i5u%zP z#5Iv2cw5mmCPfGn^F~;cb#A3wa^DQGE;f`7;uSEwh!`oX-v?l}iB zvC6|No*|TcUkVns``uKJuqy^`r@VJpmWFurS>+l#?ZzyI_8YSO^==$SX>M%v}$)+=-E;OjfS1Mi~Y$hetg~6HB+Wb%u#oD^N62aj7SUxYC>4>cXaPhG>Cd)GQj%PuDGD z1Z%R(t$eqLgRSRqz*qPBQBHO_n+#zV*4a0FfSP?nm{kn5k{8(5WJne=R5;mj9AI+q zqLX+9ceyp+82k1d4*2Fjo;00zKR9u;t^7vgM#QaAB+}L|cb;xNw+V!|`_&0(Yw4YZ zx!J(7=8TETeE*}9LqnF!8c9cCi#-z=F|1+VgPej`)~Xu)4%4wt(yMyf4=j@Kfr)Xu z`tE|yuLnVByw}*?Kbka_BJ5!FG08kIvT+lHpJU9py=Gw6*PsL8bA*}jHf+*c#73Q% zr&9{ly;FfoP`gfq7-0*Vk8+3tMR}HOKB)AH3WcGm6?m?WNv7VPO^xr0aU1P^sJ09w zf)}7;YRkL@9d%-CPN@q2&Q;-aRrsB%0Ku!0iGNkapR_8%`&9*O2y_G)z=!Rb!VB&6 cUo%Cqnm8ZvM&=yW!=Kufz From b00f4269030e4a0bec053d169251faced2e061b1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:49:44 +0700 Subject: [PATCH 10/43] feat(geq31): render supplied vector slider track in native JUCE editor --- engine/builtin_fx/GraphicEq31Processor.h | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 2ba8330e2..ba87907b6 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -4,6 +4,9 @@ #include "../core/RealtimeNativeFxControl.h" #include #include +#if defined(ARMIX_GEQ31_VECTOR_ASSET) && ARMIX_GEQ31_VECTOR_ASSET +#include +#endif #include #include #include @@ -259,10 +262,30 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: private: class EqSkin final : public juce::LookAndFeel_V4 { public: + EqSkin() { +#if defined(ARMIX_GEQ31_VECTOR_ASSET) && ARMIX_GEQ31_VECTOR_ASSET + // UI thread only: user's original fader-track SVG, stripped of its + // stationary thumb and baked label, stored as compact gzip. + // The JUCE attachment controls the independent live silver thumb. + juce::GZIPDecompressorInputStream decompressed( + new juce::MemoryInputStream(BinaryData::slider_eq_vector_svgz, + static_cast(BinaryData::slider_eq_vector_svgzSize),false), + true,juce::GZIPDecompressorInputStream::gzipFormat); + if(auto xml=juce::XmlDocument::parse( + decompressed.readEntireStreamAsString())) + vectorTrack_=juce::Drawable::createFromSVG(*xml); +#endif + } void drawLinearSlider(juce::Graphics& g,int x,int y,int width,int height, float sliderPos,float /*minPos*/,float /*maxPos*/, juce::Slider::SliderStyle,juce::Slider&) override { const float cx=x+width*.5f; + if(vectorTrack_) { + vectorTrack_->drawWithin(g,juce::Rectangle( + static_cast(x),static_cast(y), + static_cast(width),static_cast(height)), + juce::RectanglePlacement::stretchToFit,1.f); + }else { g.setColour(juce::Colour::fromRGB(175,180,184)); for(int t=0;t<=12;++t) { const float yy=y+11.f+(height-22.f)*t/12.f; @@ -274,6 +297,7 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: g.fillRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f); g.setColour(juce::Colour::fromRGB(61,67,70)); g.drawRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f,1.f); + } const auto py=juce::jlimit(static_cast(y+11), static_cast(y+height-11),sliderPos); g.setColour(juce::Colour::fromRGB(94,98,103).withAlpha(.35f)); @@ -287,6 +311,8 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: g.setColour(juce::Colour::fromRGB(225,228,230)); g.drawLine(cx-8.f,py,cx+8.f,py,1.2f); } + private: + std::unique_ptr vectorTrack_; }; void timerCallback() override { const auto p=processor_.observedPeak(); From f9ccaba3316b74d68b530009b71217999b6e68f0 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:49:58 +0700 Subject: [PATCH 11/43] build(geq31): embed owner-provided vector fader asset for native FX UI --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3d2b57db..bec6dd9e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,10 +332,14 @@ endforeach() juce_add_binary_data(ARMixAssets SOURCES "${ARMIX_APPROVED_GUI_DIR}/index.html" ${ARMIX_APPROVED_GUI_BINARIES} ${ARMIX_GUITAR_SKIN_PNGS} + "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/slider_eq_vector.svgz" ${ARMIX_LEGAL_RESOURCE_FILES} "${ARMIX_BRAND_DIR}/arsonmix-256.png" ${ARMIX_IMERSIB_SCENE_PNG_SOURCES}) target_include_directories(ARMixConsole PRIVATE "${ARMIX_APPROVED_GUI_DIR}") +# Only the production GUI builds the vectorized EQ31 editor; isolated native +# FX tests use the procedural fallback without depending on BinaryData. +target_compile_definitions(ARMixConsole PRIVATE ARMIX_GEQ31_VECTOR_ASSET=1) target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h engine/builtin_fx/HarmonyDsp.h engine/builtin_fx/HarmonyMusicKey.h engine/builtin_fx/ChannelHarmonyProcessor.h engine/builtin_fx/SonKuSpatialProcessor.h engine/builtin_fx/sonku/SonKuSpatialCore.h engine/builtin_fx/sonku/SonKuMeasuredHrir.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/AuxBusPlan.h engine/core/PreparedMixerBlock.h engine/core/MasterOutputMonoPolicy.h engine/core/LiveChannelFxGraph.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/NativeFxParameterHotkey.h src/NativeHotkeyCommandPlan.h src/FactoryFxRegistry.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.h src/NativeDryShowRecall.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/LiveSecondaryOutputDevice.h engine/device/LiveSecondaryCaptureDevice.h engine/device/SecondaryCaptureClockStream.h engine/core/LiveOutputRouteGate.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h) # Explicit UTF-8 source decoding: native channel icons are Unicode, and From d7e5eaaadf8104f2b8a389e8cebc971f9d95f850 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:51:53 +0700 Subject: [PATCH 12/43] docs(geq31): define native ownership, SVG source, state and acceptance gates --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/fx/GRAPHIC_EQ31_NATIVE.md diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md new file mode 100644 index 000000000..e850ce2d0 --- /dev/null +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -0,0 +1,43 @@ +# Graphic EQ 31 — Native built-in FX integration + +**Implementation branch:** `feat/graphic-eq31-native-fx` +**Native catalog:** `armix.builtin.graphic-eq31.v1` +**Operator name:** **Graphic EQ 31** +**Delivery:** JUCE native insert under the existing ArSonMix FX Rack, **not** a standalone app, external VST3 or FactoryFX. + +## What is owned where + +- `engine/builtin_fx/GraphicEq31Core.h` owns the fixed 31-frequency stereo signal path. 31 matched second-order peaking sections are directly cascaded without adding a callback or allocation. Nominal centres are the ISO/dbx-style 1/3-octave series from 20 Hz to 20 kHz; Q is fixed at 4.318473, so adjacent bands overlap. +- `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus `inputDb` and `outputDb`, are used for the host's existing native plugin-editor parameter bindings. +- `src/NativeBuiltInFx.h` registers one catalog descriptor. Existing `FxInstance`, per-ChannelId ordering, per-insert bypass, lifecycle, `.smix` binary storage, device switching and generic owned editor remain the exclusive authorities. +- `web/approved-native-bridge.js` adds a discovery fallback until native `arMixCatalog` returns the canonical descriptor. **No second GUI or WebAudio processing** is introduced. +- `assets/fx/graphic-eq31/slider_eq_vector.svgz` contains the user's supplied fader's native SVG paths, converted to a **track-only** asset by removing the fixed thumb and embedded raster/label. On production GUI builds the asset is decompressed once on the UI thread; each slider draws the actual original vector track with a dynamic JUCE thumb, allowing separate per-band movement. Native no-BinaryData unit-test builds use a procedural fallback. + +## Frequencies + +```text + 20 25 31.5 40 50 63 80 100 125 160 200 + 250 315 400 500 630 800 1k 1.25k 1.6k 2k 2.5k + 3.15k 4k 5k 6.3k 8k 10k 12.5k 16k 20k +``` + +- Per-band boost/cut: **±12 dB**, fixed nominal centres. +- Input/output trim: **±12 dB**, smoothed. +- Automatic sample-rate reprepare and Nyquist guard; a band above the physical rate's guard keeps its saved value but its filter is transparent until supported. +- Linked stereo gain coefficients, separate L/R filter history, no artificial delay or lookahead. +- UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, input/output gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. + +## State and safety + +A separate versioned `GEQ1` 140-byte binary payload stores 31 gains and 2 trims. `restoreUnpublishedState` validates the **entire** blob before changing parameters and refuses modifications after the instance has been sealed into a published realtime graph. The existing host prepares a replacement lease rather than mutating published DSP state. The processor exposes only an atomic per-block peak to its GUI. + +Coefficient transitions are smoothed over 5ms on the audio thread when gain targets change; parameter values are atomics, not locks. The realtime implementation avoids disk, JSON and heap allocation. + +## Verification evidence and release boundary + +- Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). +- Shared host registration: `ARMixNativeFxExtensionTests` (catalog, state roundtrip, bad binary reject, PCM finite, published restore reject). +- Follow the current exact-SHA Windows `native` GitHub CI workflow before merge. A CI success proves compilation and automated tests, not physical sound quality. +- **Still requires owner equipment FAT**: audition all 31 faders at representative rates, verify Flat unity (0dB trims), inspect bypass/restore and `.smix`, open/close editor while live ASIO runs, verify CPU/XRUN and confirm headroom/clipping at ±12dB in a complete music mix. + +No claim is made that this is a hardware-accurate proprietary dbx transfer function: frequency centres and classic panel controls are matched, while the original JUCE biquad implementation is independently authored. From e65d75d918892e752499ef531872e6ee601ee628 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:56:50 +0700 Subject: [PATCH 13/43] perf(geq31): block-by-band vector-friendly cascade and flat fast path --- engine/builtin_fx/GraphicEq31Core.h | 37 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Core.h b/engine/builtin_fx/GraphicEq31Core.h index 5233940ad..2121fb4aa 100644 --- a/engine/builtin_fx/GraphicEq31Core.h +++ b/engine/builtin_fx/GraphicEq31Core.h @@ -65,30 +65,37 @@ class GraphicEq31Core final { b.frames=rampFrames_; return true; } - // In-place, stereo, no heap, locks or control-side work on the callback. - // Each band uses a bounded 5ms coefficient ramp to avoid gain-step clicks. + // Per-band, in-place stereo cascade: the active band processes the + // entire buffer before the next band. Flat EQ skips all 31 biquads, + // avoiding work in the default zero-gain state without extra buffers. + // The coefficient ramp is sample-accurate and remains click-free. void processStereo(float* left,float* right,std::size_t frames) noexcept { if(!ready_||!left||!right)return; - for(std::size_t n=0;n0) { b.current.b0+=b.step.b0;b.current.b1+=b.step.b1; b.current.b2+=b.step.b2;b.current.a1+=b.step.a1; b.current.a2+=b.step.a2; if(--b.frames==0)b.current=b.target; } - const auto& c=b.current; - const double yl=c.b0*l+b.l1; - b.l1=c.b1*l-c.a1*yl+b.l2; - b.l2=c.b2*l-c.a2*yl; - const double yr=c.b0*r+b.r1; - b.r1=c.b1*r-c.a1*yr+b.r2; - b.r2=c.b2*r-c.a2*yr; - l=yl;r=yr; + const auto& co=b.current; + const double l=left[n],r=right[n]; + const double yl=co.b0*l+b.l1; + b.l1=co.b1*l-co.a1*yl+b.l2; + b.l2=co.b2*l-co.a2*yl; + const double yr=co.b0*r+b.r1; + b.r1=co.b1*r-co.a1*yr+b.r2; + b.r2=co.b2*r-co.a2*yr; + left[n]=static_cast(yl); + right[n]=static_cast(yr); } - left[n]=static_cast(l); - right[n]=static_cast(r); } } void reset() noexcept { From baa591b4ba3f459af25c4b87a1c74caccabcca4e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 09:57:17 +0700 Subject: [PATCH 14/43] test(geq31): assert zero-band fast path leaves PCM bit-exact --- tests/graphic_eq31_core_test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/graphic_eq31_core_test.cpp b/tests/graphic_eq31_core_test.cpp index 19d7f7108..0d8da5f5c 100644 --- a/tests/graphic_eq31_core_test.cpp +++ b/tests/graphic_eq31_core_test.cpp @@ -45,6 +45,18 @@ int main() { assert(!eq.prepare(7999.)); assert(!eq.prepare(384001.)); assert(eq.prepare(48000.)); + // Flat fast path must be bit-exact for both channels, including after + // moving a previously active band back to 0 dB. + { + std::array unchangedL{},unchangedR{}; + for(std::size_t i=0;i<64;++i) { + unchangedL[i]=static_cast(i)*0.001f; + unchangedR[i]=-unchangedL[i]; + } + const auto referenceL=unchangedL,referenceR=unchangedR; + eq.processStereo(unchangedL.data(),unchangedR.data(),64); + assert(unchangedL==referenceL && unchangedR==referenceR); + } assert(!eq.setGain(31,3.)); assert(!eq.setGain(1,13.)); assert(!eq.setGain(1,-13.)); From f4e4aa7fa526242640ec0d22a7ec46a0d2971bfe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 10:25:30 +0700 Subject: [PATCH 15/43] test(geq31): execute DSP checks in Release CI instead of disabled assertions --- tests/graphic_eq31_core_test.cpp | 70 ++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/tests/graphic_eq31_core_test.cpp b/tests/graphic_eq31_core_test.cpp index 0d8da5f5c..1874afaaa 100644 --- a/tests/graphic_eq31_core_test.cpp +++ b/tests/graphic_eq31_core_test.cpp @@ -2,7 +2,17 @@ #include "../engine/builtin_fx/GraphicEq31Core.h" #include #include -#include +#include + +// Keep verification active in Release builds (NDEBUG disables assert). +// Side-effecting setup must always execute in the Windows CI configuration. +#define GEQ_CHECK(expr) do { \ + if (!(expr)) { \ + std::fprintf(stderr, "Graphic EQ 31 FAILED: %s (%s:%d)\n", \ + #expr, __FILE__, __LINE__); \ + std::abort(); \ + } \ +} while (false) #include #include #include @@ -19,8 +29,8 @@ static double rms(const std::vector& x,std::size_t from) { } static double responseDb(std::size_t band,double gain,double toneHz,int rate) { GraphicEq31Core eq; - assert(eq.prepare(rate)); - assert(eq.setGain(band,gain)); + GEQ_CHECK(eq.prepare(rate)); + GEQ_CHECK(eq.setGain(band,gain)); constexpr std::size_t count=96000; std::vector left(count),right(count); for(std::size_t i=0;igraphicEq31Hz[i-1]); - assert(graphicEq31Hz.front()==20.); - assert(graphicEq31Hz.back()==20000.); + GEQ_CHECK(graphicEq31Hz[i]>graphicEq31Hz[i-1]); + GEQ_CHECK(graphicEq31Hz.front()==20.); + GEQ_CHECK(graphicEq31Hz.back()==20000.); GraphicEq31Core eq; - assert(!eq.prepare(std::numeric_limits::quiet_NaN())); - assert(!eq.prepare(7999.)); - assert(!eq.prepare(384001.)); - assert(eq.prepare(48000.)); + GEQ_CHECK(!eq.prepare(std::numeric_limits::quiet_NaN())); + GEQ_CHECK(!eq.prepare(7999.)); + GEQ_CHECK(!eq.prepare(384001.)); + GEQ_CHECK(eq.prepare(48000.)); // Flat fast path must be bit-exact for both channels, including after // moving a previously active band back to 0 dB. { @@ -55,43 +65,43 @@ int main() { } const auto referenceL=unchangedL,referenceR=unchangedR; eq.processStereo(unchangedL.data(),unchangedR.data(),64); - assert(unchangedL==referenceL && unchangedR==referenceR); + GEQ_CHECK(unchangedL==referenceL && unchangedR==referenceR); } - assert(!eq.setGain(31,3.)); - assert(!eq.setGain(1,13.)); - assert(!eq.setGain(1,-13.)); - assert(!eq.setGain(1,std::numeric_limits::infinity())); - assert(eq.setGain(17,6.)); - assert(std::fabs(eq.gainDb(17)-6.)<1e-8); - assert(responseDb(17,6.,1000.,48000)>5.4); - assert(responseDb(17,-6.,1000.,48000)<-5.4); - assert(std::fabs(responseDb(17,6.,200.,48000))<.6); + GEQ_CHECK(!eq.setGain(31,3.)); + GEQ_CHECK(!eq.setGain(1,13.)); + GEQ_CHECK(!eq.setGain(1,-13.)); + GEQ_CHECK(!eq.setGain(1,std::numeric_limits::infinity())); + GEQ_CHECK(eq.setGain(17,6.)); + GEQ_CHECK(std::fabs(eq.gainDb(17)-6.)<1e-8); + GEQ_CHECK(responseDb(17,6.,1000.,48000)>5.4); + GEQ_CHECK(responseDb(17,-6.,1000.,48000)<-5.4); + GEQ_CHECK(std::fabs(responseDb(17,6.,200.,48000))<.6); // Stereo isolation: a silent right channel must remain silent. std::array l{},r{}; l[0]=.5f; for(int i=0;i<100;++i) { eq.processStereo(l.data(),r.data(),l.size()); - for(auto s:r)assert(s==0.f); - for(auto s:l)assert(std::isfinite(s)); + for(auto s:r)GEQ_CHECK(s==0.f); + for(auto s:l)GEQ_CHECK(std::isfinite(s)); l.fill(0.f); } // Low sample rate: out-of-Nyquist bands must be safely transparent. GraphicEq31Core low; - assert(low.setGain(30,12.)); - assert(low.prepare(8000.)); + GEQ_CHECK(low.setGain(30,12.)); + GEQ_CHECK(low.prepare(8000.)); std::array ll{},rr{}; ll[0]=rr[0]=.25f; low.processStereo(ll.data(),rr.data(),ll.size()); - assert(std::fabs(ll[0]-.25f)<1e-6f); - for(std::size_t i=1;i((iteration%255)+1)); - for(auto s:l)assert(std::isfinite(s)); - for(auto s:r)assert(std::isfinite(s)); + for(auto s:l)GEQ_CHECK(std::isfinite(s)); + for(auto s:r)GEQ_CHECK(std::isfinite(s)); } std::puts("Graphic EQ 31 core: frequencies, response, stereo isolation, Nyquist, stress PASS"); } From dcda95d59a919f920b9f0e8dc354b0e85160d67c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 10:26:12 +0700 Subject: [PATCH 16/43] fix(geq31 gui): reflow 31 faders within resizable compact native editor --- engine/builtin_fx/GraphicEq31Processor.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index ba87907b6..1da057716 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -215,7 +215,12 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: peakLabel_.setJustificationType(juce::Justification::centred); peakLabel_.setColour(juce::Label::textColourId,juce::Colours::black); addAndMakeVisible(peakLabel_); - setSize(1500,328); + // Fit a normal 1366px desktop without clipping the last three bands. + // Host-owned JUCE editor stays one surface; width-only resize reflows + // frequency labels and all 31 independent SVG faders. + setResizable(true,true); + setResizeLimits(1070,328,1700,328); + setSize(1280,328); startTimerHz(20); } ~GraphicEq31Editor() override {stopTimer();setLookAndFeel(nullptr);} @@ -252,11 +257,19 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: flat_.setBounds(19,205,68,27); smile_.setBounds(93,205,68,27); peakLabel_.setBounds(16,253,150,26); - constexpr int x0=211,step=41; + // Every column is derived from the live editor width, not a fixed + // 1500px desktop. Integer-rounded boundaries never overlap or clip. + constexpr int x0=202,rightMargin=15; + const float cell=static_cast(getWidth()-x0-rightMargin)/ + static_cast(GraphicEq31Core::bandCount); for(std::size_t i=0;i(i)*step; - labels_[i].setBounds(x,61,40,19); - sliders_[i].setBounds(x+3,83,34,203); + const int left=juce::roundToInt(x0+static_cast(i)*cell); + const int right=juce::roundToInt(x0+static_cast(i+1)*cell); + const int width=right-left; + labels_[i].setBounds(left,61,width,19); + labels_[i].setFont(juce::Font(juce::jlimit(8.2f,11.f, + (static_cast(width)-3.f)*0.34f),juce::Font::plain)); + sliders_[i].setBounds(left+1,83,width-2,203); } } private: From d50653c3037d947f953ecfc1c91295e32f4a6370 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 10:32:38 +0700 Subject: [PATCH 17/43] fix(geq31 ui): constrain dynamic fader thumbs inside compact columns --- engine/builtin_fx/GraphicEq31Processor.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 1da057716..2bc90fc0c 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -313,16 +313,26 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce:: } const auto py=juce::jlimit(static_cast(y+11), static_cast(y+height-11),sliderPos); + // The supplied SVG is the track only; moving metal thumbs must + // fit even at the compact minimum editor width. Never overlap + // adjacent frequency columns when the operator resizes the host. + const float shadowWidth=juce::jlimit(20.f,34.f, + static_cast(width)-2.f); + const float thumbWidth=juce::jlimit(16.f,26.f, + static_cast(width)-6.f); g.setColour(juce::Colour::fromRGB(94,98,103).withAlpha(.35f)); - g.fillRoundedRectangle(cx-17.f,py-13.f,34.f,27.f,7.f); + g.fillRoundedRectangle(cx-shadowWidth*.5f,py-13.f, + shadowWidth,27.f,7.f); g.setGradientFill(juce::ColourGradient( juce::Colours::white,cx,py-10.f, juce::Colour::fromRGB(187,191,195),cx,py+10.f,false)); - g.fillRoundedRectangle(cx-13.f,py-11.f,26.f,22.f,7.f); + g.fillRoundedRectangle(cx-thumbWidth*.5f,py-11.f, + thumbWidth,22.f,7.f); g.setColour(juce::Colour::fromRGB(131,137,141)); - g.drawRoundedRectangle(cx-13.f,py-11.f,26.f,22.f,7.f,1.f); + g.drawRoundedRectangle(cx-thumbWidth*.5f,py-11.f, + thumbWidth,22.f,7.f,1.f); g.setColour(juce::Colour::fromRGB(225,228,230)); - g.drawLine(cx-8.f,py,cx+8.f,py,1.2f); + g.drawLine(cx-thumbWidth*.31f,py,cx+thumbWidth*.31f,py,1.2f); } private: std::unique_ptr vectorTrack_; From 615e80df1a2a878aeef4c0dbdb14f7ec92a36575 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 10:34:37 +0700 Subject: [PATCH 18/43] docs(geq31): qualify compact JUCE layout and Release-mode DSP assertions --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md index e850ce2d0..a432c1e63 100644 --- a/docs/fx/GRAPHIC_EQ31_NATIVE.md +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -26,6 +26,8 @@ - Automatic sample-rate reprepare and Nyquist guard; a band above the physical rate's guard keeps its saved value but its filter is transparent until supported. - Linked stereo gain coefficients, separate L/R filter history, no artificial delay or lookahead. - UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, input/output gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. +- The native editor defaults to **1280×328** and may be resized horizontally from **1070 to 1700 px**. Frequency labels and all 31 faders use a single width-derived column layout; the moving metal thumb is clipped by its column width to prevent overlaps. The operator's SVG track is embedded only in the production JUCE binary; independent CTest targets use the procedural track fallback. +- A source-derived HTML/PNG preview may help inspect the art direction but must be labeled **not a live JUCE screenshot** and must never be used as physical FAT proof. ## State and safety @@ -35,7 +37,7 @@ Coefficient transitions are smoothed over 5ms on the audio thread when gain targ ## Verification evidence and release boundary -- Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). +- Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). Its 29 explicit `GEQ_CHECK` predicates remain executable in Release (`NDEBUG`) builds, including setup calls that used to disappear inside standard `assert`. - Shared host registration: `ARMixNativeFxExtensionTests` (catalog, state roundtrip, bad binary reject, PCM finite, published restore reject). - Follow the current exact-SHA Windows `native` GitHub CI workflow before merge. A CI success proves compilation and automated tests, not physical sound quality. - **Still requires owner equipment FAT**: audition all 31 faders at representative rates, verify Flat unity (0dB trims), inspect bypass/restore and `.smix`, open/close editor while live ASIO runs, verify CPU/XRUN and confirm headroom/clipping at ±12dB in a complete music mix. From 212b9afe3ff89fa9425362e8a102335e43328670 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 10:54:42 +0700 Subject: [PATCH 19/43] assets(geq31): preserve owner's exact layered slider_eq_grp.svg with THUMB Text Track --- assets/fx/graphic-eq31/slider_eq_grp.svg | 150 +++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 assets/fx/graphic-eq31/slider_eq_grp.svg diff --git a/assets/fx/graphic-eq31/slider_eq_grp.svg b/assets/fx/graphic-eq31/slider_eq_grp.svg new file mode 100644 index 000000000..386777fec --- /dev/null +++ b/assets/fx/graphic-eq31/slider_eq_grp.svg @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 32 + + + + + Hz + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 42ac141069d7dcbec86fd787dd1cce30929c6dcb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:00:55 +0700 Subject: [PATCH 20/43] feat(geq31): render original grouped SVG THUMB/Text/Track with native JUCE automation and reference-inspired UX --- engine/builtin_fx/GraphicEq31Processor.h | 342 +++++++++++++---------- 1 file changed, 199 insertions(+), 143 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 2bc90fc0c..49f389499 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -11,6 +11,7 @@ #include #include #include +#include #include namespace armix::builtin_fx { @@ -171,190 +172,245 @@ class GraphicEq31Processor final : public juce::AudioProcessor, bool published_=false,ready_=false; }; -class GraphicEq31Editor final : public juce::AudioProcessorEditor,private juce::Timer { +class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce::Timer { public: explicit GraphicEq31Editor(GraphicEq31Processor& processor) - : juce::AudioProcessorEditor(processor),processor_(processor) { + : juce::AudioProcessorEditor(processor), processor_(processor) { setLookAndFeel(&skin_); - for(std::size_t i=0;i(i))); slider.setSliderStyle(juce::Slider::LinearVertical); - slider.setTextBoxStyle(juce::Slider::NoTextBox,false,0,0); - slider.setDoubleClickReturnValue(true,0.); - slider.setTooltip(juce::String(graphicEq31Labels[i])+ - " Hz \xC2\xB1 12 dB; double-click for 0 dB"); - addAndMakeVisible(slider); - auto& label=labels_[i]; - label.setText(graphicEq31Labels[i],juce::dontSendNotification); - label.setJustificationType(juce::Justification::centred); - label.setFont(juce::Font(11.f,juce::Font::plain)); - label.setColour(juce::Label::textColourId,juce::Colours::black); - addAndMakeVisible(label); + slider.setTextBoxStyle(juce::Slider::NoTextBox, false, 0, 0); + slider.setDoubleClickReturnValue(true, 0.0); + slider.setTooltip(juce::String(graphicEq31Labels[i]) + + " Hz, -12 to +12 dB; double-click to centre"); + bandSurface_.addAndMakeVisible(slider); attachments_.emplace_back(std::make_unique( - processor_.parameters(), "band"+juce::String(static_cast(i)),slider)); + processor_.parameters(), "band" + juce::String(static_cast(i)), slider)); } - for(auto* knob:{&input_,&output_}) { + // The original THUMB is raster/vector artwork embedded in the exact + // owner's SVG; the JUCE Slider is input/automation, never a new thumb. + viewport_.setViewedComponent(&bandSurface_, false); + viewport_.setScrollBarsShown(false, true); + viewport_.setScrollBarThickness(9); + addAndMakeVisible(viewport_); + + for (auto* knob : {&input_, &output_}) { knob->setSliderStyle(juce::Slider::RotaryHorizontalVerticalDrag); - knob->setTextBoxStyle(juce::Slider::TextBoxBelow,false,68,19); - knob->setDoubleClickReturnValue(true,0.); + knob->setTextBoxStyle(juce::Slider::TextBoxBelow, false, 65, 18); + knob->setDoubleClickReturnValue(true, 0.0); addAndMakeVisible(*knob); } - inputAttachment_=std::make_unique(processor_.parameters(),"inputDb",input_); - outputAttachment_=std::make_unique(processor_.parameters(),"outputDb",output_); - flat_.setButtonText("FLAT"); - flat_.onClick=[this]{processor_.setFlatFromUi();}; + input_.setComponentID("geq31-input"); + output_.setComponentID("geq31-output"); + inputAttachment_ = std::make_unique(processor_.parameters(), "inputDb", input_); + outputAttachment_ = std::make_unique(processor_.parameters(), "outputDb", output_); + + flat_.setButtonText("Flat"); + flat_.onClick = [this] { processor_.setFlatFromUi(); }; addAndMakeVisible(flat_); - smile_.setButtonText("SMILE"); - smile_.onClick=[this] { - for(std::size_t i=0;i4500?2.5f:-1.f)); + smile_.setButtonText("Smile"); + smile_.onClick = [this] { + for (std::size_t i = 0; i < GraphicEq31Core::bandCount; ++i) { + const auto hz = graphicEq31Hz[i]; + processor_.setBandFromUi(i, hz < 110. ? 3.f : (hz > 4500. ? 2.5f : -1.f)); } }; addAndMakeVisible(smile_); + for (int n = 0; n < 3; ++n) { + const auto id = n; + jump_[n].setButtonText(n == 0 ? "LOW" : n == 1 ? "MID" : "HIGH"); + jump_[n].onClick = [this, id] { + viewport_.setViewPosition(id == 0 ? 0 : (id == 1 ? 11 : 22) * bandCellWidth, 0); + }; + addAndMakeVisible(jump_[n]); + } peakLabel_.setJustificationType(juce::Justification::centred); - peakLabel_.setColour(juce::Label::textColourId,juce::Colours::black); addAndMakeVisible(peakLabel_); - // Fit a normal 1366px desktop without clipping the last three bands. - // Host-owned JUCE editor stays one surface; width-only resize reflows - // frequency labels and all 31 independent SVG faders. - setResizable(true,true); - setResizeLimits(1070,328,1700,328); - setSize(1280,328); + setResizable(true, true); + setResizeLimits(900, 470, 1920, 470); + setSize(1420, 470); startTimerHz(20); } - ~GraphicEq31Editor() override {stopTimer();setLookAndFeel(nullptr);} + + ~GraphicEq31Editor() override { + stopTimer(); + setLookAndFeel(nullptr); + } + void paint(juce::Graphics& g) override { - auto b=getLocalBounds().toFloat(); - g.setGradientFill(juce::ColourGradient( - juce::Colour::fromRGB(241,242,242),b.getTopLeft(), - juce::Colour::fromRGB(202,207,211),b.getBottomLeft(),false)); - g.fillRoundedRectangle(b.reduced(2.f),11.f); - g.setColour(juce::Colour::fromRGB(72,78,82)); - g.drawRoundedRectangle(b.reduced(3.f),11.f,2.f); - g.setColour(juce::Colours::black); - g.setFont(juce::Font(20.f,juce::Font::plain)); - g.drawText("GRAPHIC EQ 31",juce::Rectangle(20,12,250,31), - juce::Justification::centredLeft); - g.setFont(juce::Font(11.f,juce::Font::plain)); - g.drawText("ARSONMIX | 1/3 OCTAVE",juce::Rectangle(23,44,190,22), + const auto width = getWidth(); + g.fillAll(juce::Colour::fromRGB(244, 245, 246)); + g.setColour(juce::Colour::fromRGB(225, 228, 229)); + g.fillRoundedRectangle(8.f, 9.f, static_cast(width - 16), 452.f, 12.f); + g.setColour(juce::Colour::fromRGB(249, 250, 250)); + g.fillRoundedRectangle(11.f, 11.f, static_cast(width - 22), 449.f, 10.f); + g.setColour(juce::Colour::fromRGB(78, 85, 88)); + g.setFont(juce::Font(18.f, juce::Font::plain)); + g.drawText("GRAPHIC EQ 31", 30, 19, 260, 28, juce::Justification::centredLeft); + g.setFont(juce::Font(11.f, juce::Font::plain)); + g.setColour(juce::Colour::fromRGB(143, 151, 154)); + g.drawText("ARSONMIX / 1/3 OCTAVE / 20 Hz – 20 kHz", 31, 45, 390, 20, juce::Justification::centredLeft); - g.drawText("INPUT",juce::Rectangle(18,78,72,20),juce::Justification::centred); - g.drawText("OUTPUT",juce::Rectangle(92,78,72,20),juce::Justification::centred); - g.drawText("+12",juce::Rectangle(169,81,34,22),juce::Justification::centred); - g.drawText("0",juce::Rectangle(169,170,34,22),juce::Justification::centred); - g.drawText("-12",juce::Rectangle(169,259,34,22),juce::Justification::centred); - g.setColour(juce::Colour::fromRGB(70,75,78)); - g.drawLine(202.f,65.f,202.f,291.f,1.f); - g.setFont(juce::Font(11.f,juce::Font::plain)); - g.drawText("31 FIXED FREQUENCY BANDS \xC2\xB1 12 dB", - juce::Rectangle(220,294,getWidth()-235,20), + const auto right = width - rightPanelWidth; + g.setColour(juce::Colour::fromRGB(220, 225, 225)); + g.drawVerticalLine(right, 72.f, 433.f); + g.setColour(juce::Colour::fromRGB(107, 114, 117)); + g.setFont(juce::Font(12.f, juce::Font::plain)); + g.drawText("OUTPUT GAIN", right + 18, 75, rightPanelWidth - 34, 22, juce::Justification::centred); + g.drawText("INPUT", right + 20, 279, rightPanelWidth - 40, 20, + juce::Justification::centred); + g.setColour(juce::Colour::fromRGB(155, 161, 164)); + g.setFont(juce::Font(10.f, juce::Font::plain)); + g.drawText("FX power & bypass: ARSONMIX FX RACK", right + 8, 420, + rightPanelWidth - 16, 20, juce::Justification::centred); + g.drawText("31 ORIGINAL SVG FADERS · ±12 dB", 28, 427, + juce::jmax(0, right - 42), 20, juce::Justification::centredLeft); } + void resized() override { - input_.setBounds(19,102,69,83); - output_.setBounds(92,102,69,83); - flat_.setBounds(19,205,68,27); - smile_.setBounds(93,205,68,27); - peakLabel_.setBounds(16,253,150,26); - // Every column is derived from the live editor width, not a fixed - // 1500px desktop. Integer-rounded boundaries never overlap or clip. - constexpr int x0=202,rightMargin=15; - const float cell=static_cast(getWidth()-x0-rightMargin)/ - static_cast(GraphicEq31Core::bandCount); - for(std::size_t i=0;i(i)*cell); - const int right=juce::roundToInt(x0+static_cast(i+1)*cell); - const int width=right-left; - labels_[i].setBounds(left,61,width,19); - labels_[i].setFont(juce::Font(juce::jlimit(8.2f,11.f, - (static_cast(width)-3.f)*0.34f),juce::Font::plain)); - sliders_[i].setBounds(left+1,83,width-2,203); - } + const int right = getWidth() - rightPanelWidth; + viewport_.setBounds(24, 90, right - 37, 327); + bandSurface_.setSize(static_cast(GraphicEq31Core::bandCount) * bandCellWidth, 317); + for (std::size_t i = 0; i < GraphicEq31Core::bandCount; ++i) + sliders_[i].setBounds(static_cast(i) * bandCellWidth + 4, 0, + bandCellWidth - 8, 305); + output_.setBounds(right + 31, 102, rightPanelWidth - 62, 160); + input_.setBounds(right + 68, 298, rightPanelWidth - 136, 92); + flat_.setBounds(right + 16, 380, 82, 29); + smile_.setBounds(right + 112, 380, 82, 29); + const int jumpX = juce::jmax(485, right - 265); + for (int i = 0; i < 3; ++i) + jump_[i].setBounds(jumpX + i * 78, 25, 71, 25); + peakLabel_.setBounds(right + 35, 57, rightPanelWidth - 70, 20); } + private: + // Never reinterpret/trace the owner artwork with JUCE Paths. The complete + // slider_eq_grp.svg (Track + Text + THUMB + embedded thumb image) is parsed + // once per value change on the MESSAGE thread. Only two named SVG groups + // are changed: Text gets the canonical dbx label; THUMB gets translate Y. + // Cached Drawables are repainted without reparsing on every frame. class EqSkin final : public juce::LookAndFeel_V4 { public: EqSkin() { #if defined(ARMIX_GEQ31_VECTOR_ASSET) && ARMIX_GEQ31_VECTOR_ASSET - // UI thread only: user's original fader-track SVG, stripped of its - // stationary thumb and baked label, stored as compact gzip. - // The JUCE attachment controls the independent live silver thumb. - juce::GZIPDecompressorInputStream decompressed( - new juce::MemoryInputStream(BinaryData::slider_eq_vector_svgz, - static_cast(BinaryData::slider_eq_vector_svgzSize),false), - true,juce::GZIPDecompressorInputStream::gzipFormat); - if(auto xml=juce::XmlDocument::parse( - decompressed.readEntireStreamAsString())) - vectorTrack_=juce::Drawable::createFromSVG(*xml); + originalSvg_ = juce::String::fromUTF8(BinaryData::slider_eq_grp_svg, + static_cast(BinaryData::slider_eq_grp_svgSize)); #endif + cachedGain_.fill(std::numeric_limits::quiet_NaN()); + setColour(juce::TextButton::buttonColourId, juce::Colour::fromRGB(232, 236, 237)); + setColour(juce::TextButton::textColourOffId, juce::Colour::fromRGB(78, 85, 88)); } - void drawLinearSlider(juce::Graphics& g,int x,int y,int width,int height, - float sliderPos,float /*minPos*/,float /*maxPos*/, - juce::Slider::SliderStyle,juce::Slider&) override { - const float cx=x+width*.5f; - if(vectorTrack_) { - vectorTrack_->drawWithin(g,juce::Rectangle( - static_cast(x),static_cast(y), - static_cast(width),static_cast(height)), - juce::RectanglePlacement::stretchToFit,1.f); - }else { - g.setColour(juce::Colour::fromRGB(175,180,184)); - for(int t=0;t<=12;++t) { - const float yy=y+11.f+(height-22.f)*t/12.f; - const float length=t==6?12.f:6.f; - g.drawLine(cx-11.f,yy,cx-11.f+length,yy,.9f); - g.drawLine(cx+11.f-length,yy,cx+11.f,yy,.9f); + + void drawLinearSlider(juce::Graphics& g, int x, int y, int width, int height, + float, float, float, juce::Slider::SliderStyle, + juce::Slider& slider) override { + const auto id = slider.getComponentID(); + if (!id.startsWith("geq31-band-")) return; + const int band = id.fromFirstOccurrenceOf("geq31-band-", false, false).getIntValue(); + if (band < 0 || band >= static_cast(GraphicEq31Core::bandCount)) return; + const float gain = static_cast(slider.getValue()); + if (!drawables_[static_cast(band)] || + cachedGain_[static_cast(band)] != gain) + rebuild(static_cast(band), gain); + if (auto* art = drawables_[static_cast(band)].get()) { + art->drawWithin(g, {static_cast(x), static_cast(y), + static_cast(width), static_cast(height)}, + juce::RectanglePlacement::stretchToFit, 1.f); + } else { + // Fail visibly if the owner's SVG cannot be rendered. There is + // deliberately NO hand-painted replacement thumb/track. + g.setColour(juce::Colours::red); + g.drawFittedText("SVG ERROR", x, y, width, height, + juce::Justification::centred, 2); } - g.setColour(juce::Colour::fromRGB(19,27,31)); - g.fillRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f); - g.setColour(juce::Colour::fromRGB(61,67,70)); - g.drawRoundedRectangle(cx-5.f,y+9.f,10.f,height-18.f,5.f,1.f); + } + + void drawRotarySlider(juce::Graphics& g, int x, int y, int width, int height, + float position, float startAngle, float endAngle, + juce::Slider&) override { + const auto size = static_cast(juce::jmin(width, height)) - 21.f; + const float cx = x + width * 0.5f; + const float cy = y + height * 0.45f; + const float radius = size * 0.5f; + const auto ring = juce::Colour::fromRGB(55, 185, 156); + for (int i = 0; i < 45; ++i) { + const float a = startAngle + (endAngle - startAngle) * static_cast(i) / 44.f; + const float cs = std::sin(a), sn = -std::cos(a); + g.setColour(i <= static_cast(position * 44.f) ? ring : + juce::Colour::fromRGB(177, 183, 186)); + g.drawLine(cx + cs * (radius + 3.f), cy + sn * (radius + 3.f), + cx + cs * (radius + 9.f), cy + sn * (radius + 9.f), 2.f); } - const auto py=juce::jlimit(static_cast(y+11), - static_cast(y+height-11),sliderPos); - // The supplied SVG is the track only; moving metal thumbs must - // fit even at the compact minimum editor width. Never overlap - // adjacent frequency columns when the operator resizes the host. - const float shadowWidth=juce::jlimit(20.f,34.f, - static_cast(width)-2.f); - const float thumbWidth=juce::jlimit(16.f,26.f, - static_cast(width)-6.f); - g.setColour(juce::Colour::fromRGB(94,98,103).withAlpha(.35f)); - g.fillRoundedRectangle(cx-shadowWidth*.5f,py-13.f, - shadowWidth,27.f,7.f); + g.setColour(juce::Colour::fromRGB(218, 220, 220)); + g.fillEllipse(cx - radius + 5.f, cy - radius + 8.f, 2.f * radius - 10.f, 2.f * radius - 10.f); g.setGradientFill(juce::ColourGradient( - juce::Colours::white,cx,py-10.f, - juce::Colour::fromRGB(187,191,195),cx,py+10.f,false)); - g.fillRoundedRectangle(cx-thumbWidth*.5f,py-11.f, - thumbWidth,22.f,7.f); - g.setColour(juce::Colour::fromRGB(131,137,141)); - g.drawRoundedRectangle(cx-thumbWidth*.5f,py-11.f, - thumbWidth,22.f,7.f,1.f); - g.setColour(juce::Colour::fromRGB(225,228,230)); - g.drawLine(cx-thumbWidth*.31f,py,cx+thumbWidth*.31f,py,1.2f); + juce::Colours::white, cx - radius * .6f, cy - radius * .8f, + juce::Colour::fromRGB(239, 241, 242), cx + radius, cy + radius, false)); + g.fillEllipse(cx - radius + 7.f, cy - radius + 4.f, + 2.f * radius - 14.f, 2.f * radius - 14.f); + g.setColour(ring); + g.fillEllipse(cx - 3.f, cy - radius * .65f, 6.f, 6.f); } + private: - std::unique_ptr vectorTrack_; + void rebuild(std::size_t band, float gain) { + if (originalSvg_.isEmpty()) return; + auto document = juce::XmlDocument::parse(originalSvg_); + if (!document) return; + auto* fader = document->getChildByAttribute("id", "Slider_EQ"); + if (!fader) return; + auto* labelGroup = fader->getChildByAttribute("id", "Text"); + auto* thumbGroup = fader->getChildByAttribute("id", "THUMB"); + if (!labelGroup || !thumbGroup) return; + auto* frequency = labelGroup->getChildByAttribute("id", "32"); + if (!frequency) return; + auto* tspan = frequency->getFirstChildElement(); + if (!tspan) return; + tspan->deleteAllTextElements(); + tspan->addTextElement(juce::String(graphicEq31Labels[band])); + frequency->setAttribute("text-anchor", "middle"); + frequency->setAttribute("style", "transform: matrix(4.167,0,0,4.167,237.76,1850.466)"); + // The authored THUMB centre is at y~=916 in a 2042px viewBox. + // Move its ORIGINAL embedded image and vector layers together. + // Top/bottom keep the full 418px-high thumb inside the artwork. + const float travelSvg = 560.f; + thumbGroup->setAttribute("transform", "translate(0," + + juce::String(-travelSvg * juce::jlimit(-12.f, 12.f, gain) / 12.f, 3) + ")"); + drawables_[band] = juce::Drawable::createFromSVG(*document); + if (drawables_[band]) cachedGain_[band] = gain; + } + + juce::String originalSvg_; + std::array, GraphicEq31Core::bandCount> drawables_{}; + std::array cachedGain_{}; }; + void timerCallback() override { - const auto p=processor_.observedPeak(); - const bool clip=p>=.999f; - peakLabel_.setText(clip?"CLIP":"OUTPUT LEVEL", - juce::dontSendNotification); - peakLabel_.setColour(juce::Label::backgroundColourId, - clip?juce::Colour::fromRGB(233,76,55): - juce::Colour::fromRGB(173,192,177)); + const bool clip = processor_.observedPeak() >= .999f; + peakLabel_.setText(clip ? "CLIP" : "OUTPUT LEVEL", juce::dontSendNotification); + peakLabel_.setColour(juce::Label::textColourId, + clip ? juce::Colour::fromRGB(235, 81, 57) : + juce::Colour::fromRGB(73, 159, 139)); } - using Attachment=juce::AudioProcessorValueTreeState::SliderAttachment; + using Attachment = juce::AudioProcessorValueTreeState::SliderAttachment; + static constexpr int bandCellWidth = 80; + static constexpr int rightPanelWidth = 225; GraphicEq31Processor& processor_; EqSkin skin_; - std::array sliders_; - std::array labels_; + juce::Component bandSurface_; + juce::Viewport viewport_; + std::array sliders_; std::vector> attachments_; - juce::Slider input_,output_; - std::unique_ptr inputAttachment_,outputAttachment_; - juce::TextButton flat_,smile_; + juce::Slider input_, output_; + std::unique_ptr inputAttachment_, outputAttachment_; + juce::TextButton flat_, smile_; + std::array jump_; juce::Label peakLabel_; }; inline juce::AudioProcessorEditor* GraphicEq31Processor::createEditor() { From 9282a67446ebdfe1bbfe69c08805354ff9b95d73 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:01:07 +0700 Subject: [PATCH 21/43] build(geq31): embed owner's full layered slider_eq_grp.svg into JUCE BinaryData --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bec6dd9e9..4068117d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,12 +332,12 @@ endforeach() juce_add_binary_data(ARMixAssets SOURCES "${ARMIX_APPROVED_GUI_DIR}/index.html" ${ARMIX_APPROVED_GUI_BINARIES} ${ARMIX_GUITAR_SKIN_PNGS} - "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/slider_eq_vector.svgz" + "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/slider_eq_grp.svg" ${ARMIX_LEGAL_RESOURCE_FILES} "${ARMIX_BRAND_DIR}/arsonmix-256.png" ${ARMIX_IMERSIB_SCENE_PNG_SOURCES}) target_include_directories(ARMixConsole PRIVATE "${ARMIX_APPROVED_GUI_DIR}") -# Only the production GUI builds the vectorized EQ31 editor; isolated native +# Only the production GUI embeds the owner's complete grouped EQ31 SVG; isolated native # FX tests use the procedural fallback without depending on BinaryData. target_compile_definitions(ARMixConsole PRIVATE ARMIX_GEQ31_VECTOR_ASSET=1) From df4e788ee3249553a0464560738fcef28f4b42f4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:02:22 +0700 Subject: [PATCH 22/43] test(geq31): prevent SVG THUMB/Text/Track regressions and require original asset checksum --- tests/graphic_eq31_svg_layers_test.py | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/graphic_eq31_svg_layers_test.py diff --git a/tests/graphic_eq31_svg_layers_test.py b/tests/graphic_eq31_svg_layers_test.py new file mode 100644 index 000000000..1b455b4bf --- /dev/null +++ b/tests/graphic_eq31_svg_layers_test.py @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: AGPL-3.0-only +"""Release-gate contract: GEQ31 must use the owner's ORIGINAL grouped SVG. + +Not an audio/ASIO test. This deliberately prevents future visual rewrites that +silently flatten THUMB, paint JUCE substitutes or discard the embedded artwork. +""" +from pathlib import Path +import hashlib +import unittest +import xml.etree.ElementTree as ET + +ROOT = Path(__file__).resolve().parents[1] +SVG = ROOT / 'assets/fx/graphic-eq31/slider_eq_grp.svg' +PROCESSOR = ROOT / 'engine/builtin_fx/GraphicEq31Processor.h' +CMAKE = ROOT / 'CMakeLists.txt' +EXPECTED_SHA256 = 'aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba' +SVGNS = {'s': 'http://www.w3.org/2000/svg'} + +class OwnerOriginalSvgLayersTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.raw = SVG.read_bytes() + cls.svg = ET.fromstring(cls.raw) + cls.native = PROCESSOR.read_text(encoding='utf-8') + cls.cmake = CMAKE.read_text(encoding='utf-8') + + def test_exact_owner_artwork_and_named_groups(self): + self.assertEqual(hashlib.sha256(self.raw).hexdigest(), EXPECTED_SHA256) + self.assertEqual(self.svg.attrib['viewBox'], '0 0 469 2042') + fader = self.svg.find("./s:g[@id='Slider_EQ']", SVGNS) + self.assertIsNotNone(fader) + self.assertEqual([child.get('id') for child in fader], ['Track', 'Text', 'THUMB']) + self.assertGreaterEqual(len(fader.find("./s:g[@id='Track']", SVGNS)), 6) + self.assertIsNotNone(fader.find("./s:g[@id='Text']/s:text[@id='32']/s:tspan", SVGNS)) + self.assertIsNotNone(fader.find("./s:g[@id='Text']/s:g[@id='Hz']", SVGNS)) + self.assertIsNotNone(fader.find("./s:g[@id='THUMB']//s:use[@id='_Image3']", SVGNS)) + embedded = self.svg.find("./s:defs/s:image[@id='img1']", SVGNS) + self.assertTrue(embedded.get('href', '').startswith('data:image/png;base64,')) + + def test_exact_svg_is_production_embedded_source(self): + self.assertIn('assets/fx/graphic-eq31/slider_eq_grp.svg', self.cmake) + self.assertNotIn('assets/fx/graphic-eq31/slider_eq_vector.svgz', self.cmake) + self.assertIn('BinaryData::slider_eq_grp_svg', self.native) + self.assertIn('getChildByAttribute("id", "Text")', self.native) + self.assertIn('getChildByAttribute("id", "THUMB")', self.native) + self.assertIn('tspan->addTextElement(juce::String(graphicEq31Labels[band]))', self.native) + self.assertIn('thumbGroup->setAttribute("transform", "translate(0,"', self.native) + self.assertIn('juce::Drawable::createFromSVG(*document)', self.native) + self.assertIn('juce::Viewport viewport_', self.native) + self.assertIn('std::array sliders_', self.native) + self.assertNotIn('fillRoundedRectangle(cx-thumbWidth', self.native) + + def test_thumb_travel_stays_inside_owner_viewbox(self): + # Authored thumb bounds from original 469x2042 grouped SVG: + # top ~721, bottom ~1139. Positive boost moves original group up. + for gain in [-12., -6., 0., 6., 12.]: + shift = -560 * gain / 12 + self.assertGreaterEqual(721 + shift, 0) + self.assertLessEqual(1139 + shift, 2042) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file From 2af19954b56f6d998c6ac782e826496ecb8f259d Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:02:33 +0700 Subject: [PATCH 23/43] ci(geq31): add exact-source SVG layer regression to Windows native CTest --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4068117d8..6b3c9ec7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1621,6 +1621,8 @@ if(BUILD_TESTING) target_compile_features(ARMixGraphicEq31CoreTests PRIVATE cxx_std_20) add_test(NAME GraphicEq31FrequencyResponseAndRealtimeStability COMMAND ARMixGraphicEq31CoreTests) + add_test(NAME GraphicEq31OriginalSvgLayersAndDynamicThumb + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/graphic_eq31_svg_layers_test.py") add_dependencies(ARMixMixerRoutingTests ARMixGraphicEq31CoreTests) # Zero-lookahead native compressor DSP: zero PDC, stereo-linked peak, From a371e058cd18160618adab07e8d0f05645edfb47 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:03:10 +0700 Subject: [PATCH 24/43] docs(geq31): record exact owner SVG, correct 31-band viewport UX and non-screenshot release gate --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md index a432c1e63..d3e41849e 100644 --- a/docs/fx/GRAPHIC_EQ31_NATIVE.md +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -11,7 +11,7 @@ - `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus `inputDb` and `outputDb`, are used for the host's existing native plugin-editor parameter bindings. - `src/NativeBuiltInFx.h` registers one catalog descriptor. Existing `FxInstance`, per-ChannelId ordering, per-insert bypass, lifecycle, `.smix` binary storage, device switching and generic owned editor remain the exclusive authorities. - `web/approved-native-bridge.js` adds a discovery fallback until native `arMixCatalog` returns the canonical descriptor. **No second GUI or WebAudio processing** is introduced. -- `assets/fx/graphic-eq31/slider_eq_vector.svgz` contains the user's supplied fader's native SVG paths, converted to a **track-only** asset by removing the fixed thumb and embedded raster/label. On production GUI builds the asset is decompressed once on the UI thread; each slider draws the actual original vector track with a dynamic JUCE thumb, allowing separate per-band movement. Native no-BinaryData unit-test builds use a procedural fallback. +- `assets/fx/graphic-eq31/slider_eq_grp.svg` is the owner's **byte-exact original 33,354-byte SVG** (`SHA256 aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba`). Its three authored children `Track`, `Text`, and `THUMB` are preserved. The production JUCE binary embeds the entire SVG including the original raster/vector THUMB. The editor updates only the `Text` frequency tspan and the `THUMB` group's Y translation, then caches the resulting JUCE Drawable. There are **no JUCE-painted substitute tracks or silver thumbs**; invalid SVG displays a visible error. No BinaryData means the graphical layer cannot render, rather than silently showing a fake substitute. ## Frequencies @@ -26,7 +26,7 @@ - Automatic sample-rate reprepare and Nyquist guard; a band above the physical rate's guard keeps its saved value but its filter is transparent until supported. - Linked stereo gain coefficients, separate L/R filter history, no artificial delay or lookahead. - UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, input/output gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. -- The native editor defaults to **1280×328** and may be resized horizontally from **1070 to 1700 px**. Frequency labels and all 31 faders use a single width-derived column layout; the moving metal thumb is clipped by its column width to prevent overlaps. The operator's SVG track is embedded only in the production JUCE binary; independent CTest targets use the procedural track fallback. +- Native editor defaults to **1280×470** and resizes horizontally from **900 to 1920 px**. The horizontal scroll viewport contains 31 fixed-width 80px band cells; it preserves the original slider proportions instead of squeezing 31 faders into a tiny window. LOW/MID/HIGH navigation jumps across the canonical frequency sequence. Right-hand gain controls follow the light/silver minimal style of the owner's `equalizer-interface.svg` design reference. No additional WebView, PCM path, FX host or FX editor routing owner is introduced. - A source-derived HTML/PNG preview may help inspect the art direction but must be labeled **not a live JUCE screenshot** and must never be used as physical FAT proof. ## State and safety @@ -38,6 +38,7 @@ Coefficient transitions are smoothed over 5ms on the audio thread when gain targ ## Verification evidence and release boundary - Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). Its 29 explicit `GEQ_CHECK` predicates remain executable in Release (`NDEBUG`) builds, including setup calls that used to disappear inside standard `assert`. +- Source-artwork regression: `GraphicEq31OriginalSvgLayersAndDynamicThumb` validates the immutable owner's SHA256, original `Track`/`Text`/`THUMB` groups, embedded PNG reference, CMake BinaryData ownership and native dynamic SVG group mutation. - Shared host registration: `ARMixNativeFxExtensionTests` (catalog, state roundtrip, bad binary reject, PCM finite, published restore reject). - Follow the current exact-SHA Windows `native` GitHub CI workflow before merge. A CI success proves compilation and automated tests, not physical sound quality. - **Still requires owner equipment FAT**: audition all 31 faders at representative rates, verify Flat unity (0dB trims), inspect bypass/restore and `.smix`, open/close editor while live ASIO runs, verify CPU/XRUN and confirm headroom/clipping at ±12dB in a complete music mix. From 48e8eecabc24ad0b109c1aebc2cadd1712617a2c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:03:37 +0700 Subject: [PATCH 25/43] chore(geq31): remove rejected track-only surrogate SVGZ asset --- assets/fx/graphic-eq31/slider_eq_vector.svgz | Bin 1821 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 assets/fx/graphic-eq31/slider_eq_vector.svgz diff --git a/assets/fx/graphic-eq31/slider_eq_vector.svgz b/assets/fx/graphic-eq31/slider_eq_vector.svgz deleted file mode 100644 index 3756e0438539aebc9211f799f7781a92ff2b6be9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1821 zcmV+&2jci2iwFP!00002|Lt1KZrer_-S;a97KLL#8qJIIkSzzO7Tvh$qRl3o!nJ9c zh%5;d{YbyQ_d!aQW7)D|W4ed~hDXEU<++cUIV0-$KtT9Oa9;1k1N&o-LcNQ)sxXrqh0XGcAYZZ8@7?TpXQGtHox^ zvZ?1^%KmlLl=ZZN(@@Ey{N$$${*EVEQ=iS2m-G61lwY4Ub#?#23gzI>_ayvVedrfX zNFAiLJsX42RuzRlZ0&5dC4~&qC`-0fPZ?pY^QPBVDvHAU=r?STow_`4G7L(deWm}q z2wExE5wuZmgke}u{`sJ->1kjH$KlaBIJ5ce-?E+`<%0)w2a^}LtCnYIu3|akZ^t#2ZTumr!+V?i38yz$#7AaE*XfEkO*!~0&x-&g|8 z0&x-&gpG1Oi5)vi~*O5S+gakQQoYO}f#_upBzl=c0?o@DNb@p>1d^9m zOp?6BA%)^)4y1UQLju9e97ymohXi_;Igs9E4vFOMijdbLLL`J4J41T_VX~qSp=aAO zFt(?JP-&@g3!^A9y2DB@bVg}ZUv6qlK|=^0BCRwXLta0rAMx4eBKPkO+Eea z^WUe{tURmLOW%uc^(+X*k8!;FLnMU*mcos@HlM-T9k5?SI+oBlsIDzU^wtQ+s4%B= zM!&+ig@v$L@bnEWx($*D0x2QI<3JqRU=S>X>Y#+>g5Yan)1NQS&a39@5N<496&di! z@}me@^xb=mhhg6%A&i^mHfOtjgs3J6aZR)kyv^ty69a^ac_SQ?b#A3ca^DtWU92cQ zlYhNO{>cxIBaQtakDziLdh3Me+OQO6On|kJAWszx2zYZ#keJ8-y$E6MWji7u_YA>8 zB!|I3Aa@;DfQyFQjh(w1qPX&0pYE89t-04b<^I|2t#|Mc4Pt4`CVmdTe9Pd)eV9N`W7( z=p7EHn}|VCM980pSpc2GZ>3;hddvk}4LlVf8hguk1SEV#{N!>fcmUB#ey3?NvG zkXgP)ZRDaC51bvZLV$OuN5T5eyua>y4q{@JgITpKOy}P6R zfR
^n6CBt%oJPzI)mdMi| zjxWl~<%9MqO~=30XBSmDYqAQ$*)7p|cCYyLH=pkHD2K+cnm$e1TRzRIW;x1lmSz1X z{ygB1*{5Z>zWmoW@3Rez4jB3LR=dL}L<)za1UCIHn8W-GX>FkWJE~2-45A+!|Y(EFk9^yuw!ta@Uk7X-3U%yc(|vG z3^tRtQ#SQGWfRI<7SZu<6j}@t!UX5{$R;cdA;K)MLkjdZ8$clXUW_}~aNBIa3f5B+ zU&iiYCdTb{VoxcEjQWmhc)`d%)nMOiY{R@4B>!Ti!v*XtylcO6H;~(R8r$1Plg3g6 zS)g}G<})K3l?5KVm?^fJfn`oxjmHjV{M)dJZxI`{XP)*c(Bhp6RQCG15IzLZb?sU9 zaQRgZUj-@Qyo#@=P#Bt8f#+(MWa{nN)c67hwQ2EPwPhd?ya4S|Tjnk3s6At|PgS^g zt_s&yh1;kK*siN+!jG!>pH_u`zp8*Of({@9`1Ek504ZPSA2UU=nm8WtM&=lQEPe7H LZu3cLdo2I}J9uV< From e3876c06f08b3300b58bdd16d21601785fb09cdf Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:09:30 +0700 Subject: [PATCH 26/43] perf(geq31): move authored THUMB Drawable in place without reparsing source SVG while dragging --- engine/builtin_fx/GraphicEq31Processor.h | 60 ++++++++++++++---------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 49f389499..043fa33a0 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -232,7 +232,7 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: addAndMakeVisible(peakLabel_); setResizable(true, true); setResizeLimits(900, 470, 1920, 470); - setSize(1420, 470); + setSize(1280, 470); startTimerHz(20); } @@ -290,11 +290,10 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: } private: - // Never reinterpret/trace the owner artwork with JUCE Paths. The complete - // slider_eq_grp.svg (Track + Text + THUMB + embedded thumb image) is parsed - // once per value change on the MESSAGE thread. Only two named SVG groups - // are changed: Text gets the canonical dbx label; THUMB gets translate Y. - // Cached Drawables are repainted without reparsing on every frame. + // Preserve the owner's authored SVG as an editable DRAWABLE TREE. + // Parse once per band on the message thread, then move only the existing + // THUMB Drawable via a cheap affine transform during drag/automation. + // No raster decode, XML parsing or heap allocation in the drag path. class EqSkin final : public juce::LookAndFeel_V4 { public: EqSkin() { @@ -302,7 +301,8 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: originalSvg_ = juce::String::fromUTF8(BinaryData::slider_eq_grp_svg, static_cast(BinaryData::slider_eq_grp_svgSize)); #endif - cachedGain_.fill(std::numeric_limits::quiet_NaN()); + lastGain_.fill(std::numeric_limits::quiet_NaN()); + thumbGroups_.fill(nullptr); setColour(juce::TextButton::buttonColourId, juce::Colour::fromRGB(232, 236, 237)); setColour(juce::TextButton::textColourOffId, juce::Colour::fromRGB(78, 85, 88)); } @@ -312,19 +312,24 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: juce::Slider& slider) override { const auto id = slider.getComponentID(); if (!id.startsWith("geq31-band-")) return; - const int band = id.fromFirstOccurrenceOf("geq31-band-", false, false).getIntValue(); - if (band < 0 || band >= static_cast(GraphicEq31Core::bandCount)) return; - const float gain = static_cast(slider.getValue()); - if (!drawables_[static_cast(band)] || - cachedGain_[static_cast(band)] != gain) - rebuild(static_cast(band), gain); - if (auto* art = drawables_[static_cast(band)].get()) { + const int index = id.fromFirstOccurrenceOf("geq31-band-", false, false).getIntValue(); + if (index < 0 || index >= static_cast(GraphicEq31Core::bandCount)) return; + const auto band = static_cast(index); + if (!drawables_[band]) createBandArtwork(band); + if (auto* art = drawables_[band].get()) { + const auto gain = static_cast(slider.getValue()); + if (lastGain_[band] != gain && thumbGroups_[band] != nullptr) { + // Authored SVG THUMB centre: y~=916, native viewBox 2042. + // +/-560px keeps the original 418px thumb inside Track. + const float shift = -560.f * juce::jlimit(-12.f, 12.f, gain) / 12.f; + thumbGroups_[band]->setTransform(juce::AffineTransform::translation(0.f, shift)); + lastGain_[band] = gain; + } art->drawWithin(g, {static_cast(x), static_cast(y), static_cast(width), static_cast(height)}, juce::RectanglePlacement::stretchToFit, 1.f); } else { - // Fail visibly if the owner's SVG cannot be rendered. There is - // deliberately NO hand-painted replacement thumb/track. + // No silent surrogate design: broken asset is a visible error. g.setColour(juce::Colours::red); g.drawFittedText("SVG ERROR", x, y, width, height, juce::Justification::centred, 2); @@ -359,7 +364,7 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: } private: - void rebuild(std::size_t band, float gain) { + void createBandArtwork(std::size_t band) { if (originalSvg_.isEmpty()) return; auto document = juce::XmlDocument::parse(originalSvg_); if (!document) return; @@ -376,19 +381,22 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: tspan->addTextElement(juce::String(graphicEq31Labels[band])); frequency->setAttribute("text-anchor", "middle"); frequency->setAttribute("style", "transform: matrix(4.167,0,0,4.167,237.76,1850.466)"); - // The authored THUMB centre is at y~=916 in a 2042px viewBox. - // Move its ORIGINAL embedded image and vector layers together. - // Top/bottom keep the full 418px-high thumb inside the artwork. - const float travelSvg = 560.f; - thumbGroup->setAttribute("transform", "translate(0," + - juce::String(-travelSvg * juce::jlimit(-12.f, 12.f, gain) / 12.f, 3) + ")"); - drawables_[band] = juce::Drawable::createFromSVG(*document); - if (drawables_[band]) cachedGain_[band] = gain; + auto drawable = juce::Drawable::createFromSVG(*document); + if (!drawable) return; + // JUCE 8.0.15 maps SVG group IDs onto Drawable component IDs. + // findChildWithID searches only DIRECT children; first descend + // root -> Slider_EQ -> THUMB. This is the untouched author layer. + auto* authoredFader = drawable->findChildWithID("Slider_EQ"); + auto* authoredThumb = authoredFader ? authoredFader->findChildWithID("THUMB") : nullptr; + if (!authoredThumb) return; + thumbGroups_[band] = authoredThumb; + drawables_[band] = std::move(drawable); } juce::String originalSvg_; std::array, GraphicEq31Core::bandCount> drawables_{}; - std::array cachedGain_{}; + std::array thumbGroups_{}; + std::array lastGain_{}; }; void timerCallback() override { From c388b8abdf84c592f74486ed995a652157b813a4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:09:40 +0700 Subject: [PATCH 27/43] test(geq31): validate low-allocation native THUMB Drawable mutation --- tests/graphic_eq31_svg_layers_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/graphic_eq31_svg_layers_test.py b/tests/graphic_eq31_svg_layers_test.py index 1b455b4bf..895e5cd5e 100644 --- a/tests/graphic_eq31_svg_layers_test.py +++ b/tests/graphic_eq31_svg_layers_test.py @@ -44,7 +44,8 @@ def test_exact_svg_is_production_embedded_source(self): self.assertIn('getChildByAttribute("id", "Text")', self.native) self.assertIn('getChildByAttribute("id", "THUMB")', self.native) self.assertIn('tspan->addTextElement(juce::String(graphicEq31Labels[band]))', self.native) - self.assertIn('thumbGroup->setAttribute("transform", "translate(0,"', self.native) + self.assertIn('thumbGroups_[band]->setTransform(juce::AffineTransform::translation(0.f, shift))', self.native) + self.assertIn('authoredFader->findChildWithID("THUMB")', self.native) self.assertIn('juce::Drawable::createFromSVG(*document)', self.native) self.assertIn('juce::Viewport viewport_', self.native) self.assertIn('std::array sliders_', self.native) From 12bde7f120672d5783519714876447a2ed531fa6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:09:50 +0700 Subject: [PATCH 28/43] docs(geq31): clarify one-time SVG render and in-place original thumb transform --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md index d3e41849e..70bbfec88 100644 --- a/docs/fx/GRAPHIC_EQ31_NATIVE.md +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -11,7 +11,7 @@ - `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus `inputDb` and `outputDb`, are used for the host's existing native plugin-editor parameter bindings. - `src/NativeBuiltInFx.h` registers one catalog descriptor. Existing `FxInstance`, per-ChannelId ordering, per-insert bypass, lifecycle, `.smix` binary storage, device switching and generic owned editor remain the exclusive authorities. - `web/approved-native-bridge.js` adds a discovery fallback until native `arMixCatalog` returns the canonical descriptor. **No second GUI or WebAudio processing** is introduced. -- `assets/fx/graphic-eq31/slider_eq_grp.svg` is the owner's **byte-exact original 33,354-byte SVG** (`SHA256 aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba`). Its three authored children `Track`, `Text`, and `THUMB` are preserved. The production JUCE binary embeds the entire SVG including the original raster/vector THUMB. The editor updates only the `Text` frequency tspan and the `THUMB` group's Y translation, then caches the resulting JUCE Drawable. There are **no JUCE-painted substitute tracks or silver thumbs**; invalid SVG displays a visible error. No BinaryData means the graphical layer cannot render, rather than silently showing a fake substitute. +- `assets/fx/graphic-eq31/slider_eq_grp.svg` is the owner's **byte-exact original 33,354-byte SVG** (`SHA256 aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba`). Its three authored children `Track`, `Text`, and `THUMB` are preserved. The production JUCE binary embeds the entire SVG including the original raster/vector THUMB. The editor changes only the `Text` frequency tspan while parsing each band **once** on the UI thread; afterwards it holds the original authored `THUMB` Drawable and applies a simple affine Y transform on parameter changes (no XML reparse, PNG decode, or allocation in the drag path). There are **no JUCE-painted substitute tracks or silver thumbs**; invalid SVG displays a visible error. No BinaryData means the graphical layer cannot render, rather than silently showing a fake substitute. ## Frequencies From 449000bc124c087463615a37d49647f7e92b6915 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:12:20 +0700 Subject: [PATCH 29/43] build(geq31): preserve original layered SVG bytes across Windows Git checkouts --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..b2932458c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Keep the user's original layered SVG byte-identical on Windows and Linux. +# Reformatting line endings would invalidate the asset QA SHA256 contract. +assets/fx/graphic-eq31/slider_eq_grp.svg -text From af57e6cf4ff259bc9a80911e5a2d5f80c127c075 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:34:59 +0700 Subject: [PATCH 30/43] asset(geq31): preserve owner-supplied KNOB-EQ SVG with KNOB and POINTER layers --- assets/fx/graphic-eq31/KNOB-EQ.svg | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 assets/fx/graphic-eq31/KNOB-EQ.svg diff --git a/assets/fx/graphic-eq31/KNOB-EQ.svg b/assets/fx/graphic-eq31/KNOB-EQ.svg new file mode 100644 index 000000000..512da2154 --- /dev/null +++ b/assets/fx/graphic-eq31/KNOB-EQ.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ffd00f4c7e382339dfe279dea036586d6be1d138 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:37:10 +0700 Subject: [PATCH 31/43] refactor(geq31): single input gain with v1 legacy output-trim state migration --- engine/builtin_fx/GraphicEq31Processor.h | 62 ++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 043fa33a0..12b1c238d 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -29,7 +29,6 @@ class GraphicEq31Processor final : public juce::AudioProcessor, for(std::size_t i=0;i(bandValues_[i]->load(std::memory_order_relaxed))); inputSmooth_.reset(sampleRate,.006); - outputSmooth_.reset(sampleRate,.006); inputSmooth_.setCurrentAndTargetValue(dbToGain(inputValue_->load())); - outputSmooth_.setCurrentAndTargetValue(dbToGain(outputValue_->load())); peak_.store(0.f,std::memory_order_relaxed); } void releaseResources() override {ready_=false;} @@ -80,50 +77,57 @@ class GraphicEq31Processor final : public juce::AudioProcessor, auto* l=pcm.getWritePointer(0); auto* r=pcm.getWritePointer(1); inputSmooth_.setTargetValue(dbToGain(inputValue_->load(std::memory_order_relaxed))); - outputSmooth_.setTargetValue(dbToGain(outputValue_->load(std::memory_order_relaxed))); for(int n=0;n(inputSmooth_.getNextValue()); l[n]*=g;r[n]*=g; } core_.processStereo(l,r,static_cast(count)); float peak=0.f; - for(int n=0;n(outputSmooth_.getNextValue()); - l[n]*=g;r[n]*=g; + // Output gain was removed from Graphic EQ 31: meter post-EQ PCM, + // without a hidden output trim altering levels or headroom. + for(int n=0;n&,juce::MidiBuffer&) override {} void getStateInformation(juce::MemoryBlock& destination) override { // CONTROL thread. Only one fixed-size, versioned state per insert. juce::MemoryOutputStream out(destination,false); - out.writeInt(stateMagic);out.writeInt(1); + // GEQ1 v2: 31 bands + one input gain, 136 bytes. + // Legacy GEQ1 v1 (140 bytes) still restores without its output trim. + out.writeInt(stateMagic);out.writeInt(2); for(auto* p:bandValues_)out.writeFloat(p->load(std::memory_order_acquire)); out.writeFloat(inputValue_->load(std::memory_order_acquire)); - out.writeFloat(outputValue_->load(std::memory_order_acquire)); } bool restoreUnpublishedState(const void* bytes,int length) { - constexpr int stateBytes=8+static_cast(GraphicEq31Core::bandCount+2)*4; - if(published_||!bytes||length!=stateBytes)return false; + constexpr int v1Bytes=8+static_cast(GraphicEq31Core::bandCount+2)*4; + constexpr int v2Bytes=8+static_cast(GraphicEq31Core::bandCount+1)*4; + if(published_||!bytes||(length!=v1Bytes&&length!=v2Bytes))return false; juce::MemoryInputStream input(bytes,static_cast(length),false); - if(input.readInt()!=stateMagic||input.readInt()!=1)return false; - std::array data{}; - for(auto& v:data) { - v=input.readFloat(); - if(!std::isfinite(v)||v < -12.f||v>12.f)return false; + if(input.readInt()!=stateMagic)return false; + const int version=input.readInt(); + if((version==1&&length!=v1Bytes)||(version==2&&length!=v2Bytes)|| + (version!=1&&version!=2))return false; + // Validate the entire state, including the deprecated v1 output trim, + // before touching live parameters. v1 output gain is NOT reapplied. + std::array values{}; + for(auto& value:values) { + value=input.readFloat(); + if(!std::isfinite(value)||value < -12.f||value>12.f)return false; + } + if(version==1) { + const float discardedOutputDb=input.readFloat(); + if(!std::isfinite(discardedOutputDb)|| + discardedOutputDb < -12.f||discardedOutputDb>12.f)return false; } if(!input.isExhausted())return false; for(std::size_t i=0;i(-12.f,12.f,.1f),0.f)); - for(const auto& id:{"inputDb","outputDb"}) - result.add(std::make_unique( - juce::ParameterID{id,1},juce::String(id), - juce::NormalisableRange(-12.f,12.f,.1f),0.f)); + result.add(std::make_unique( + juce::ParameterID{"inputDb",1},"Input Gain", + juce::NormalisableRange(-12.f,12.f,.1f),0.f)); return result; } void setParameter(const juce::String& id,float db) { @@ -166,8 +169,7 @@ class GraphicEq31Processor final : public juce::AudioProcessor, GraphicEq31Core core_; std::array*,GraphicEq31Core::bandCount> bandValues_{}; std::atomic* inputValue_=nullptr; - std::atomic* outputValue_=nullptr; - juce::SmoothedValue inputSmooth_,outputSmooth_; + juce::SmoothedValue inputSmooth_; std::atomic peak_{0.f}; bool published_=false,ready_=false; }; From 4ad3c94d081870581bd1b9a34a81fb363aa5ffc8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:37:22 +0700 Subject: [PATCH 32/43] build(geq31): embed owner KNOB-EQ.svg alongside original grouped fader --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b3c9ec7f..80222239f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,6 +333,7 @@ juce_add_binary_data(ARMixAssets SOURCES "${ARMIX_APPROVED_GUI_DIR}/index.html" ${ARMIX_APPROVED_GUI_BINARIES} ${ARMIX_GUITAR_SKIN_PNGS} "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/slider_eq_grp.svg" + "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/KNOB-EQ.svg" ${ARMIX_LEGAL_RESOURCE_FILES} "${ARMIX_BRAND_DIR}/arsonmix-256.png" ${ARMIX_IMERSIB_SCENE_PNG_SOURCES}) From 6dd230c6732008c6f0c74be9da46e026d9134893 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:38:50 +0700 Subject: [PATCH 33/43] feat(geq31 ui): compact 37px original SVG faders, Inter text, owner KNOB-EQ input only --- engine/builtin_fx/GraphicEq31Processor.h | 379 ++++++++++++----------- 1 file changed, 200 insertions(+), 179 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 12b1c238d..568a42753 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -179,248 +179,269 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: explicit GraphicEq31Editor(GraphicEq31Processor& processor) : juce::AudioProcessorEditor(processor), processor_(processor) { setLookAndFeel(&skin_); - // The approved FX Rack/ChannelId owner still owns this floating editor. - // Never create a separate WebView, signal-processing path or VST host. - for (std::size_t i = 0; i < GraphicEq31Core::bandCount; ++i) { - auto& slider = sliders_[i]; - slider.setComponentID("geq31-band-" + juce::String(static_cast(i))); + // The existing ArSonMix rack/ChannelId owns this JUCE editor window. + // The owner's original grouped SVG provides EVERY track and thumb. + for(std::size_t i=0;i(i))); slider.setSliderStyle(juce::Slider::LinearVertical); - slider.setTextBoxStyle(juce::Slider::NoTextBox, false, 0, 0); - slider.setDoubleClickReturnValue(true, 0.0); - slider.setTooltip(juce::String(graphicEq31Labels[i]) + - " Hz, -12 to +12 dB; double-click to centre"); + slider.setTextBoxStyle(juce::Slider::NoTextBox,false,0,0); + slider.setDoubleClickReturnValue(true,0.); + slider.setTooltip(juce::String(graphicEq31Labels[i])+ + " Hz | -12 ... +12 dB | Double-click: 0 dB"); bandSurface_.addAndMakeVisible(slider); attachments_.emplace_back(std::make_unique( - processor_.parameters(), "band" + juce::String(static_cast(i)), slider)); + processor_.parameters(),"band"+juce::String(static_cast(i)),slider)); } - // The original THUMB is raster/vector artwork embedded in the exact - // owner's SVG; the JUCE Slider is input/automation, never a new thumb. - viewport_.setViewedComponent(&bandSurface_, false); - viewport_.setScrollBarsShown(false, true); - viewport_.setScrollBarThickness(9); + viewport_.setViewedComponent(&bandSurface_,false); + viewport_.setScrollBarsShown(false,true); + viewport_.setScrollBarThickness(7); addAndMakeVisible(viewport_); - for (auto* knob : {&input_, &output_}) { - knob->setSliderStyle(juce::Slider::RotaryHorizontalVerticalDrag); - knob->setTextBoxStyle(juce::Slider::TextBoxBelow, false, 65, 18); - knob->setDoubleClickReturnValue(true, 0.0); - addAndMakeVisible(*knob); - } + // ONE gain control, using the owner's KNOB-EQ.svg (KNOB + POINTER). + // No output knob, no input/output fader, and no duplicate FX host. input_.setComponentID("geq31-input"); - output_.setComponentID("geq31-output"); - inputAttachment_ = std::make_unique(processor_.parameters(), "inputDb", input_); - outputAttachment_ = std::make_unique(processor_.parameters(), "outputDb", output_); + input_.setSliderStyle(juce::Slider::RotaryHorizontalVerticalDrag); + input_.setRotaryParameters(juce::degreesToRadians(225.f), + juce::degreesToRadians(495.f),true); + input_.setTextBoxStyle(juce::Slider::TextBoxBelow,false,82,21); + input_.setTextValueSuffix(" dB"); + input_.setDoubleClickReturnValue(true,0.); + input_.setTooltip("Input Gain -12 to +12 dB. Double-click for 0 dB"); + inputAttachment_=std::make_unique( + processor_.parameters(),"inputDb",input_); + addAndMakeVisible(input_); flat_.setButtonText("Flat"); - flat_.onClick = [this] { processor_.setFlatFromUi(); }; + flat_.onClick=[this]{processor_.setFlatFromUi();}; addAndMakeVisible(flat_); smile_.setButtonText("Smile"); - smile_.onClick = [this] { - for (std::size_t i = 0; i < GraphicEq31Core::bandCount; ++i) { - const auto hz = graphicEq31Hz[i]; - processor_.setBandFromUi(i, hz < 110. ? 3.f : (hz > 4500. ? 2.5f : -1.f)); + smile_.onClick=[this]{ + for(std::size_t i=0;i4500.?2.5f:-1.f)); } }; addAndMakeVisible(smile_); - for (int n = 0; n < 3; ++n) { - const auto id = n; - jump_[n].setButtonText(n == 0 ? "LOW" : n == 1 ? "MID" : "HIGH"); - jump_[n].onClick = [this, id] { - viewport_.setViewPosition(id == 0 ? 0 : (id == 1 ? 11 : 22) * bandCellWidth, 0); + for(int i=0;i<3;++i) { + jump_[i].setButtonText(i==0?"LOW":i==1?"MID":"HIGH"); + jump_[i].onClick=[this,i]{ + viewport_.setViewPosition(i==0?0:(i==1?11:22)*bandCellWidth,0); }; - addAndMakeVisible(jump_[n]); + addAndMakeVisible(jump_[i]); } peakLabel_.setJustificationType(juce::Justification::centred); + peakLabel_.setFont(inter(10.f)); addAndMakeVisible(peakLabel_); - setResizable(true, true); - setResizeLimits(900, 470, 1920, 470); - setSize(1280, 470); + setResizable(true,true); + setResizeLimits(850,391,1800,391); + setSize(1370,391); startTimerHz(20); } - ~GraphicEq31Editor() override { - stopTimer(); - setLookAndFeel(nullptr); - } + ~GraphicEq31Editor() override {stopTimer();setLookAndFeel(nullptr);} void paint(juce::Graphics& g) override { - const auto width = getWidth(); - g.fillAll(juce::Colour::fromRGB(244, 245, 246)); - g.setColour(juce::Colour::fromRGB(225, 228, 229)); - g.fillRoundedRectangle(8.f, 9.f, static_cast(width - 16), 452.f, 12.f); - g.setColour(juce::Colour::fromRGB(249, 250, 250)); - g.fillRoundedRectangle(11.f, 11.f, static_cast(width - 22), 449.f, 10.f); - g.setColour(juce::Colour::fromRGB(78, 85, 88)); - g.setFont(juce::Font(18.f, juce::Font::plain)); - g.drawText("GRAPHIC EQ 31", 30, 19, 260, 28, juce::Justification::centredLeft); - g.setFont(juce::Font(11.f, juce::Font::plain)); - g.setColour(juce::Colour::fromRGB(143, 151, 154)); - g.drawText("ARSONMIX / 1/3 OCTAVE / 20 Hz – 20 kHz", 31, 45, 390, 20, - juce::Justification::centredLeft); - const auto right = width - rightPanelWidth; - g.setColour(juce::Colour::fromRGB(220, 225, 225)); - g.drawVerticalLine(right, 72.f, 433.f); - g.setColour(juce::Colour::fromRGB(107, 114, 117)); - g.setFont(juce::Font(12.f, juce::Font::plain)); - g.drawText("OUTPUT GAIN", right + 18, 75, rightPanelWidth - 34, 22, - juce::Justification::centred); - g.drawText("INPUT", right + 20, 279, rightPanelWidth - 40, 20, - juce::Justification::centred); - g.setColour(juce::Colour::fromRGB(155, 161, 164)); - g.setFont(juce::Font(10.f, juce::Font::plain)); - g.drawText("FX power & bypass: ARSONMIX FX RACK", right + 8, 420, - rightPanelWidth - 16, 20, juce::Justification::centred); - g.drawText("31 ORIGINAL SVG FADERS · ±12 dB", 28, 427, - juce::jmax(0, right - 42), 20, juce::Justification::centredLeft); + g.fillAll(juce::Colour::fromRGB(243,245,246)); + auto b=getLocalBounds().toFloat().reduced(7.f); + g.setColour(juce::Colour::fromRGB(251,252,252)); + g.fillRoundedRectangle(b,9.f); + g.setColour(juce::Colour::fromRGB(220,225,226)); + g.drawRoundedRectangle(b,9.f,1.f); + + g.setColour(juce::Colour::fromRGB(53,67,72)); + g.setFont(inter(17.f)); + g.drawText("Graphic EQ 31",187,19,300,28,juce::Justification::centredLeft); + g.setFont(inter(10.5f)); + g.setColour(juce::Colour::fromRGB(125,140,145)); + g.drawText("ARSONMIX / 1/3 OCTAVE / 20 Hz - 20 kHz", + 188,44,410,18,juce::Justification::centredLeft); + + g.setColour(juce::Colour::fromRGB(224,230,230)); + g.drawVerticalLine(177,69.f,367.f); + g.setColour(juce::Colour::fromRGB(65,76,79)); + g.setFont(inter(12.f)); + g.drawText("INPUT GAIN",18,79,149,20,juce::Justification::centred); + g.setFont(inter(10.f)); + g.setColour(juce::Colour::fromRGB(133,146,149)); + g.drawText("-12",18,231,45,20,juce::Justification::centred); + g.drawText("+12",116,231,48,20,juce::Justification::centred); + g.drawText("31 BANDS / +/-12 dB",188,358, + juce::jmax(0,getWidth()-209),20,juce::Justification::centredLeft); } void resized() override { - const int right = getWidth() - rightPanelWidth; - viewport_.setBounds(24, 90, right - 37, 327); - bandSurface_.setSize(static_cast(GraphicEq31Core::bandCount) * bandCellWidth, 317); - for (std::size_t i = 0; i < GraphicEq31Core::bandCount; ++i) - sliders_[i].setBounds(static_cast(i) * bandCellWidth + 4, 0, - bandCellWidth - 8, 305); - output_.setBounds(right + 31, 102, rightPanelWidth - 62, 160); - input_.setBounds(right + 68, 298, rightPanelWidth - 136, 92); - flat_.setBounds(right + 16, 380, 82, 29); - smile_.setBounds(right + 112, 380, 82, 29); - const int jumpX = juce::jmax(485, right - 265); - for (int i = 0; i < 3; ++i) - jump_[i].setBounds(jumpX + i * 78, 25, 71, 25); - peakLabel_.setBounds(right + 35, 57, rightPanelWidth - 70, 20); + constexpr int x0=186; + // 37px pitch instead of the former 80px: 31 bands total 1147px. + // At 1370px default width all 31 appear without horizontal scrolling. + viewport_.setBounds(x0,69,juce::jmax(1,getWidth()-x0-17),283); + bandSurface_.setSize(static_cast(GraphicEq31Core::bandCount)*bandCellWidth,276); + for(std::size_t i=0;i(i)*bandCellWidth,0, + bandCellWidth,274); + input_.setBounds(21,110,138,175); + flat_.setBounds(19,302,70,27); + smile_.setBounds(96,302,70,27); + for(int i=0;i<3;++i) + jump_[i].setBounds(juce::jmax(595,getWidth()-250)+i*77,26,71,25); + peakLabel_.setBounds(18,340,150,20); } private: - // Preserve the owner's authored SVG as an editable DRAWABLE TREE. - // Parse once per band on the message thread, then move only the existing - // THUMB Drawable via a cheap affine transform during drag/automation. - // No raster decode, XML parsing or heap allocation in the drag path. + static juce::Font inter(float size) {return juce::Font("Inter",size,juce::Font::plain);} class EqSkin final : public juce::LookAndFeel_V4 { public: EqSkin() { #if defined(ARMIX_GEQ31_VECTOR_ASSET) && ARMIX_GEQ31_VECTOR_ASSET - originalSvg_ = juce::String::fromUTF8(BinaryData::slider_eq_grp_svg, + originalSvg_=juce::String::fromUTF8(BinaryData::slider_eq_grp_svg, static_cast(BinaryData::slider_eq_grp_svgSize)); + knobSvg_=juce::String::fromUTF8(BinaryData::KNOB_EQ_svg, + static_cast(BinaryData::KNOB_EQ_svgSize)); #endif lastGain_.fill(std::numeric_limits::quiet_NaN()); thumbGroups_.fill(nullptr); - setColour(juce::TextButton::buttonColourId, juce::Colour::fromRGB(232, 236, 237)); - setColour(juce::TextButton::textColourOffId, juce::Colour::fromRGB(78, 85, 88)); + setColour(juce::TextButton::buttonColourId,juce::Colour::fromRGB(231,237,237)); + setColour(juce::TextButton::textColourOffId,juce::Colour::fromRGB(65,77,79)); } - - void drawLinearSlider(juce::Graphics& g, int x, int y, int width, int height, - float, float, float, juce::Slider::SliderStyle, + juce::Font getTextButtonFont(juce::TextButton&,int) override { + return GraphicEq31Editor::inter(11.f); + } + juce::Font getLabelFont(juce::Label&) override { + return GraphicEq31Editor::inter(11.f); + } + void drawLinearSlider(juce::Graphics& g,int x,int y,int width,int height, + float,float,float,juce::Slider::SliderStyle, juce::Slider& slider) override { - const auto id = slider.getComponentID(); - if (!id.startsWith("geq31-band-")) return; - const int index = id.fromFirstOccurrenceOf("geq31-band-", false, false).getIntValue(); - if (index < 0 || index >= static_cast(GraphicEq31Core::bandCount)) return; - const auto band = static_cast(index); - if (!drawables_[band]) createBandArtwork(band); - if (auto* art = drawables_[band].get()) { - const auto gain = static_cast(slider.getValue()); - if (lastGain_[band] != gain && thumbGroups_[band] != nullptr) { - // Authored SVG THUMB centre: y~=916, native viewBox 2042. - // +/-560px keeps the original 418px thumb inside Track. - const float shift = -560.f * juce::jlimit(-12.f, 12.f, gain) / 12.f; + const auto id=slider.getComponentID(); + if(!id.startsWith("geq31-band-"))return; + const int index=id.fromFirstOccurrenceOf("geq31-band-",false,false).getIntValue(); + if(index<0||index>=static_cast(GraphicEq31Core::bandCount))return; + const auto band=static_cast(index); + if(!drawables_[band])createBandArtwork(band); + if(auto* art=drawables_[band].get()) { + const auto gain=static_cast(slider.getValue()); + if(lastGain_[band]!=gain&&thumbGroups_[band]!=nullptr) { + const float shift=-560.f*juce::jlimit(-12.f,12.f,gain)/12.f; thumbGroups_[band]->setTransform(juce::AffineTransform::translation(0.f, shift)); - lastGain_[band] = gain; + lastGain_[band]=gain; } - art->drawWithin(g, {static_cast(x), static_cast(y), - static_cast(width), static_cast(height)}, - juce::RectanglePlacement::stretchToFit, 1.f); - } else { - // No silent surrogate design: broken asset is a visible error. + // Constrained to each 37px column. The original grouped SVG + // still contains every native Track/Text/THUMB path and raster. + art->drawWithin(g,{static_cast(x),static_cast(y), + static_cast(width),static_cast(height)}, + juce::RectanglePlacement::stretchToFit,1.f); + }else { g.setColour(juce::Colours::red); - g.drawFittedText("SVG ERROR", x, y, width, height, - juce::Justification::centred, 2); + g.drawFittedText("SVG ERROR",x,y,width,height, + juce::Justification::centred,2); } } - - void drawRotarySlider(juce::Graphics& g, int x, int y, int width, int height, - float position, float startAngle, float endAngle, - juce::Slider&) override { - const auto size = static_cast(juce::jmin(width, height)) - 21.f; - const float cx = x + width * 0.5f; - const float cy = y + height * 0.45f; - const float radius = size * 0.5f; - const auto ring = juce::Colour::fromRGB(55, 185, 156); - for (int i = 0; i < 45; ++i) { - const float a = startAngle + (endAngle - startAngle) * static_cast(i) / 44.f; - const float cs = std::sin(a), sn = -std::cos(a); - g.setColour(i <= static_cast(position * 44.f) ? ring : - juce::Colour::fromRGB(177, 183, 186)); - g.drawLine(cx + cs * (radius + 3.f), cy + sn * (radius + 3.f), - cx + cs * (radius + 9.f), cy + sn * (radius + 9.f), 2.f); + void drawRotarySlider(juce::Graphics& g,int x,int y,int width,int height, + float position,float,float,juce::Slider& slider) override { + if(slider.getComponentID()!="geq31-input")return; + if(!knobArt_)createKnobArtwork(); + if(!knobArt_) { + g.setColour(juce::Colours::red); + g.drawFittedText("KNOB SVG ERROR",x,y,width,height, + juce::Justification::centred,2); + return; } - g.setColour(juce::Colour::fromRGB(218, 220, 220)); - g.fillEllipse(cx - radius + 5.f, cy - radius + 8.f, 2.f * radius - 10.f, 2.f * radius - 10.f); - g.setGradientFill(juce::ColourGradient( - juce::Colours::white, cx - radius * .6f, cy - radius * .8f, - juce::Colour::fromRGB(239, 241, 242), cx + radius, cy + radius, false)); - g.fillEllipse(cx - radius + 7.f, cy - radius + 4.f, - 2.f * radius - 14.f, 2.f * radius - 14.f); - g.setColour(ring); - g.fillEllipse(cx - 3.f, cy - radius * .65f, 6.f, 6.f); + if(knobPointer_&&lastKnobPosition_!=position) { + constexpr float pi=3.14159265358979323846f; + const float angle=(-135.f+270.f*juce::jlimit(0.f,1.f,position))*pi/180.f; + // Source coordinate and POINTER group retained from KNOB-EQ.svg. + knobPointer_->setTransform(juce::AffineTransform::rotation( + angle,35.62f,113.63f)); + lastKnobPosition_=position; + } + knobArt_->drawWithin(g,{static_cast(x),static_cast(y), + static_cast(width),static_cast(height)}, + juce::RectanglePlacement::stretchToFit,1.f); } private: + static juce::Component* findGroup(juce::Component* root,const juce::String& id) { + if(root==nullptr)return nullptr; + if(root->getComponentID()==id)return root; + for(int i=0;igetNumChildComponents();++i) + if(auto* child=findGroup(root->getChildComponent(i),id))return child; + return nullptr; + } void createBandArtwork(std::size_t band) { - if (originalSvg_.isEmpty()) return; - auto document = juce::XmlDocument::parse(originalSvg_); - if (!document) return; - auto* fader = document->getChildByAttribute("id", "Slider_EQ"); - if (!fader) return; - auto* labelGroup = fader->getChildByAttribute("id", "Text"); - auto* thumbGroup = fader->getChildByAttribute("id", "THUMB"); - if (!labelGroup || !thumbGroup) return; - auto* frequency = labelGroup->getChildByAttribute("id", "32"); - if (!frequency) return; - auto* tspan = frequency->getFirstChildElement(); - if (!tspan) return; + if(originalSvg_.isEmpty())return; + auto document=juce::XmlDocument::parse(originalSvg_); + if(!document)return; + auto* fader=document->getChildByAttribute("id","Slider_EQ"); + if(!fader)return; + auto* labelGroup=fader->getChildByAttribute("id","Text"); + auto* thumbGroup=fader->getChildByAttribute("id","THUMB"); + if(!labelGroup||!thumbGroup)return; + auto* frequency=labelGroup->getChildByAttribute("id","32"); + auto* tspan=frequency?frequency->getFirstChildElement():nullptr; + if(!tspan)return; tspan->deleteAllTextElements(); tspan->addTextElement(juce::String(graphicEq31Labels[band])); - frequency->setAttribute("text-anchor", "middle"); - frequency->setAttribute("style", "transform: matrix(4.167,0,0,4.167,237.76,1850.466)"); - auto drawable = juce::Drawable::createFromSVG(*document); - if (!drawable) return; - // JUCE 8.0.15 maps SVG group IDs onto Drawable component IDs. - // findChildWithID searches only DIRECT children; first descend - // root -> Slider_EQ -> THUMB. This is the untouched author layer. - auto* authoredFader = drawable->findChildWithID("Slider_EQ"); - auto* authoredThumb = authoredFader ? authoredFader->findChildWithID("THUMB") : nullptr; - if (!authoredThumb) return; - thumbGroups_[band] = authoredThumb; - drawables_[band] = std::move(drawable); + // Override the authored Arial class at render time, preserving + // the source asset and all original SVG layers byte-for-byte. + tspan->setAttribute("style","font-family: Inter; font-size: "+ + juce::String(juce::String(graphicEq31Labels[band]).length()>3?15:18)+"px"); + frequency->setAttribute("text-anchor","middle"); + frequency->setAttribute("style", + "transform: matrix(4.167,0,0,4.167,237.76,1850.466); font-family: Inter"); + if(auto* hz=labelGroup->getChildByAttribute("id","Hz")) { + if(auto* text=hz->getFirstChildElement()) { + text->setAttribute("font-family","Inter"); + if(auto* unit=text->getFirstChildElement()) + unit->setAttribute("style","font-family: Inter"); + } + } + auto drawable=juce::Drawable::createFromSVG(*document); + if(!drawable)return; + auto* authoredFader=drawable->findChildWithID("Slider_EQ"); + auto* authoredThumb=authoredFader?authoredFader->findChildWithID("THUMB"):nullptr; + if(!authoredThumb)return; + thumbGroups_[band]=authoredThumb; + drawables_[band]=std::move(drawable); + } + void createKnobArtwork() { + if(knobSvg_.isEmpty())return; + auto document=juce::XmlDocument::parse(knobSvg_); + if(!document)return; + // Crop transparent authored margins only in the UI viewBox, + // never edit/flatten the original asset, KNOB or POINTER paths. + document->setAttribute("viewBox","-56 20 180 187"); + knobArt_=juce::Drawable::createFromSVG(*document); + knobPointer_=findGroup(knobArt_.get(),"POINTER"); } - juce::String originalSvg_; - std::array, GraphicEq31Core::bandCount> drawables_{}; - std::array thumbGroups_{}; - std::array lastGain_{}; + juce::String originalSvg_,knobSvg_; + std::array,GraphicEq31Core::bandCount> drawables_{}; + std::array thumbGroups_{}; + std::array lastGain_{}; + std::unique_ptr knobArt_; + juce::Component* knobPointer_=nullptr; + float lastKnobPosition_=std::numeric_limits::quiet_NaN(); }; void timerCallback() override { - const bool clip = processor_.observedPeak() >= .999f; - peakLabel_.setText(clip ? "CLIP" : "OUTPUT LEVEL", juce::dontSendNotification); + const bool clip=processor_.observedPeak()>=.999f; + peakLabel_.setText(clip?"CLIP":"OUTPUT LEVEL",juce::dontSendNotification); peakLabel_.setColour(juce::Label::textColourId, - clip ? juce::Colour::fromRGB(235, 81, 57) : - juce::Colour::fromRGB(73, 159, 139)); + clip?juce::Colour::fromRGB(226,78,58): + juce::Colour::fromRGB(55,158,136)); } - using Attachment = juce::AudioProcessorValueTreeState::SliderAttachment; - static constexpr int bandCellWidth = 80; - static constexpr int rightPanelWidth = 225; + using Attachment=juce::AudioProcessorValueTreeState::SliderAttachment; + static constexpr int bandCellWidth=37; GraphicEq31Processor& processor_; EqSkin skin_; juce::Component bandSurface_; juce::Viewport viewport_; - std::array sliders_; + std::array sliders_; std::vector> attachments_; - juce::Slider input_, output_; - std::unique_ptr inputAttachment_, outputAttachment_; - juce::TextButton flat_, smile_; - std::array jump_; + juce::Slider input_; + std::unique_ptr inputAttachment_; + juce::TextButton flat_,smile_; + std::array jump_; juce::Label peakLabel_; }; inline juce::AudioProcessorEditor* GraphicEq31Processor::createEditor() { From 31fcf0ea9d859f0a6b08820976634e1843629c6a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:39:33 +0700 Subject: [PATCH 34/43] test(geq31): migrate legacy two-trim state to input-only v2 and reject corrupt output --- tests/native_fx_registry_extension_test.cpp | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/native_fx_registry_extension_test.cpp b/tests/native_fx_registry_extension_test.cpp index 945bb2a4e..3621180a3 100644 --- a/tests/native_fx_registry_extension_test.cpp +++ b/tests/native_fx_registry_extension_test.cpp @@ -433,7 +433,31 @@ static void verifyGraphicEq31Processor() { geq->setBandFromUi(17,6.f); juce::MemoryBlock state; processor->getStateInformation(state); - assert(state.getSize()==8u+(31u+2u)*4u); + assert(state.getSize()==8u+(31u+1u)*4u); // GEQ1 v2, only input trim + assert(geq->parameters().getParameter("outputDb")==nullptr); + // Existing user shows saved in GEQ1 v1 remain loadable. The old output + // trim must be valid but never be reactivated in the v2 audio path. + juce::MemoryBlock legacy; + { + juce::MemoryOutputStream out(legacy,false); + out.writeInt(armix::builtin_fx::GraphicEq31Processor::stateMagic); + out.writeInt(1); + out.write(static_cast(state.getData())+8,state.getSize()-8); + out.writeFloat(9.5f); + } + assert(legacy.getSize()==8u+(31u+2u)*4u); + auto migrated=descriptor->prepare(48000.,128, + legacy.getData(),static_cast(legacy.getSize())); + assert(migrated); + juce::MemoryBlock converted; + migrated->getStateInformation(converted); + assert(converted==state); + auto badLegacy=legacy; + const float badTrim=std::numeric_limits::quiet_NaN(); + std::memcpy(static_cast(badLegacy.getData())+badLegacy.getSize()-4, + &badTrim,sizeof(badTrim)); + assert(!descriptor->prepare(48000.,128,badLegacy.getData(), + static_cast(badLegacy.getSize()))); auto restored=descriptor->prepare(44100.,256, state.getData(),static_cast(state.getSize())); assert(restored && restored->getName()=="Graphic EQ 31"); From 2d25eb8c03a35e43d7cc71b05e621a65b351cf7e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:40:00 +0700 Subject: [PATCH 35/43] test(geq31 ui): lock compact Inter layout and exact owner KNOB-EQ layers --- tests/graphic_eq31_svg_layers_test.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/graphic_eq31_svg_layers_test.py b/tests/graphic_eq31_svg_layers_test.py index 895e5cd5e..6176e674f 100644 --- a/tests/graphic_eq31_svg_layers_test.py +++ b/tests/graphic_eq31_svg_layers_test.py @@ -12,8 +12,10 @@ ROOT = Path(__file__).resolve().parents[1] SVG = ROOT / 'assets/fx/graphic-eq31/slider_eq_grp.svg' PROCESSOR = ROOT / 'engine/builtin_fx/GraphicEq31Processor.h' +KNOB = ROOT / 'assets/fx/graphic-eq31/KNOB-EQ.svg' CMAKE = ROOT / 'CMakeLists.txt' EXPECTED_SHA256 = 'aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba' +KNOB_SHA256 = '754b3d525be1d4dcbe26fdca1d6bedc5b67e2d2436efec2aa9265ad86c5aad80' SVGNS = {'s': 'http://www.w3.org/2000/svg'} class OwnerOriginalSvgLayersTests(unittest.TestCase): @@ -51,6 +53,25 @@ def test_exact_svg_is_production_embedded_source(self): self.assertIn('std::array sliders_', self.native) self.assertNotIn('fillRoundedRectangle(cx-thumbWidth', self.native) + def test_compact_inter_and_owner_knob_input_only(self): + raw_knob = KNOB.read_bytes() + self.assertEqual(hashlib.sha256(raw_knob).hexdigest(), KNOB_SHA256) + knob = ET.fromstring(raw_knob) + self.assertIsNotNone(knob.find(".//s:g[@id='KNOB']", SVGNS)) + self.assertIsNotNone(knob.find(".//s:g[@id='POINTER']", SVGNS)) + self.assertIn('assets/fx/graphic-eq31/KNOB-EQ.svg', self.cmake) + self.assertIn('BinaryData::KNOB_EQ_svg', self.native) + self.assertIn('knobPointer_->setTransform(', self.native) + self.assertIn('static constexpr int bandCellWidth=37', self.native) + self.assertIn('setSize(1370,391)', self.native) + self.assertIn('font-family: Inter', self.native) + self.assertIn('return juce::Font("Inter",size,juce::Font::plain)', self.native) + self.assertNotIn('output_.setBounds', self.native) + self.assertNotIn('getRawParameterValue("outputDb")', self.native) + self.assertNotIn('outputSmooth_', self.native) + self.assertIn('out.writeInt(stateMagic);out.writeInt(2);', self.native) + self.assertIn('discardedOutputDb=input.readFloat();', self.native) + def test_thumb_travel_stays_inside_owner_viewbox(self): # Authored thumb bounds from original 469x2042 grouped SVG: # top ~721, bottom ~1139. Positive boost moves original group up. From b3d5a090b0f7099d5aa5b8bde26eeb3144202c18 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:43:06 +0700 Subject: [PATCH 36/43] fix(geq31 svg): increase Inter frequency-label legibility in 37px columns --- engine/builtin_fx/GraphicEq31Processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 568a42753..613bab4f3 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -384,10 +384,10 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: // Override the authored Arial class at render time, preserving // the source asset and all original SVG layers byte-for-byte. tspan->setAttribute("style","font-family: Inter; font-size: "+ - juce::String(juce::String(graphicEq31Labels[band]).length()>3?15:18)+"px"); + juce::String(juce::String(graphicEq31Labels[band]).length()>3?22:28)+"px"); frequency->setAttribute("text-anchor","middle"); frequency->setAttribute("style", - "transform: matrix(4.167,0,0,4.167,237.76,1850.466); font-family: Inter"); + "transform: matrix(5.4,0,0,4.167,237.76,1850.466); font-family: Inter"); if(auto* hz=labelGroup->getChildByAttribute("id","Hz")) { if(auto* text=hz->getFirstChildElement()) { text->setAttribute("font-family","Inter"); From e3332808b02873b896165c4883974c4c01a081fe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 11:43:33 +0700 Subject: [PATCH 37/43] docs(geq31): 37px Inter artwork, original KNOB-EQ and input-only GEQ1 v2 migration --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md index 70bbfec88..b1359d487 100644 --- a/docs/fx/GRAPHIC_EQ31_NATIVE.md +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -8,7 +8,7 @@ ## What is owned where - `engine/builtin_fx/GraphicEq31Core.h` owns the fixed 31-frequency stereo signal path. 31 matched second-order peaking sections are directly cascaded without adding a callback or allocation. Nominal centres are the ISO/dbx-style 1/3-octave series from 20 Hz to 20 kHz; Q is fixed at 4.318473, so adjacent bands overlap. -- `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus `inputDb` and `outputDb`, are used for the host's existing native plugin-editor parameter bindings. +- `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus exactly one `inputDb`, are used for host parameter bindings. No `outputDb` processing or output-gain UI exists in the current version. - `src/NativeBuiltInFx.h` registers one catalog descriptor. Existing `FxInstance`, per-ChannelId ordering, per-insert bypass, lifecycle, `.smix` binary storage, device switching and generic owned editor remain the exclusive authorities. - `web/approved-native-bridge.js` adds a discovery fallback until native `arMixCatalog` returns the canonical descriptor. **No second GUI or WebAudio processing** is introduced. - `assets/fx/graphic-eq31/slider_eq_grp.svg` is the owner's **byte-exact original 33,354-byte SVG** (`SHA256 aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba`). Its three authored children `Track`, `Text`, and `THUMB` are preserved. The production JUCE binary embeds the entire SVG including the original raster/vector THUMB. The editor changes only the `Text` frequency tspan while parsing each band **once** on the UI thread; afterwards it holds the original authored `THUMB` Drawable and applies a simple affine Y transform on parameter changes (no XML reparse, PNG decode, or allocation in the drag path). There are **no JUCE-painted substitute tracks or silver thumbs**; invalid SVG displays a visible error. No BinaryData means the graphical layer cannot render, rather than silently showing a fake substitute. @@ -22,23 +22,24 @@ ``` - Per-band boost/cut: **±12 dB**, fixed nominal centres. -- Input/output trim: **±12 dB**, smoothed. +- **One Input Gain only**, **±12 dB**, smoothed. The output trim control and its audio multiplier were deleted; peak metering remains post-EQ. - Automatic sample-rate reprepare and Nyquist guard; a band above the physical rate's guard keeps its saved value but its filter is transparent until supported. - Linked stereo gain coefficients, separate L/R filter history, no artificial delay or lookahead. -- UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, input/output gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. -- Native editor defaults to **1280×470** and resizes horizontally from **900 to 1920 px**. The horizontal scroll viewport contains 31 fixed-width 80px band cells; it preserves the original slider proportions instead of squeezing 31 faders into a tiny window. LOW/MID/HIGH navigation jumps across the canonical frequency sequence. Right-hand gain controls follow the light/silver minimal style of the owner's `equalizer-interface.svg` design reference. No additional WebView, PCM path, FX host or FX editor routing owner is introduced. +- UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, owner `KNOB-EQ.svg` input gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. +- The editor defaults to **1370×391** and resizes horizontally from **850 to 1800 px**. Its pitch is **37 px per slider** (31×37=1147px), reduced from 80px. At default width all bands fit simultaneously; narrower windows retain horizontal LOW/MID/HIGH navigation. Source `slider_eq_grp.svg` remains byte-exact and retains its authored `Track`/`Text`/`THUMB` groups; the frequency label alone is updated on the UI thread and rendered in Inter. +- The **byte-exact original `KNOB-EQ.svg`** (`SHA256 754b3d525be1d4dcbe26fdca1d6bedc5b67e2d2436efec2aa9265ad86c5aad80`) is embedded alongside the fader. The native editor draws the original `KNOB` layer and rotates the original `POINTER` group around its authored origin. All JUCE/HTML EQ labels/buttons request **Inter**, with no extra output gain control. **On Windows, JUCE needs Inter installed** to avoid automatic system-font fallback; no extra font binaries are bundled in this PR. No second UI host/PCM owner was introduced. - A source-derived HTML/PNG preview may help inspect the art direction but must be labeled **not a live JUCE screenshot** and must never be used as physical FAT proof. ## State and safety -A separate versioned `GEQ1` 140-byte binary payload stores 31 gains and 2 trims. `restoreUnpublishedState` validates the **entire** blob before changing parameters and refuses modifications after the instance has been sealed into a published realtime graph. The existing host prepares a replacement lease rather than mutating published DSP state. The processor exposes only an atomic per-block peak to its GUI. +A separate versioned `GEQ1` **v2 136-byte** binary payload stores 31 band gains and one input gain. **Legacy v1 140-byte** payloads are validated in full and migrated, discarding their deprecated output trim so it cannot secretly alter output PCM. `restoreUnpublishedState` validates the **entire** blob before changing parameters and refuses modifications after the instance has been sealed into a published realtime graph. The existing host prepares a replacement lease rather than mutating published DSP state. The processor exposes only an atomic per-block peak to its GUI. Coefficient transitions are smoothed over 5ms on the audio thread when gain targets change; parameter values are atomics, not locks. The realtime implementation avoids disk, JSON and heap allocation. ## Verification evidence and release boundary - Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). Its 29 explicit `GEQ_CHECK` predicates remain executable in Release (`NDEBUG`) builds, including setup calls that used to disappear inside standard `assert`. -- Source-artwork regression: `GraphicEq31OriginalSvgLayersAndDynamicThumb` validates the immutable owner's SHA256, original `Track`/`Text`/`THUMB` groups, embedded PNG reference, CMake BinaryData ownership and native dynamic SVG group mutation. +- Source-artwork regression: `GraphicEq31OriginalSvgLayersAndDynamicThumb` validates byte-exact checksums for both owner assets, original `Track`/`Text`/`THUMB` and `KNOB`/`POINTER` groups, CMake BinaryData ownership, compact 37px pitch, Inter, and absence of output trim. - Shared host registration: `ARMixNativeFxExtensionTests` (catalog, state roundtrip, bad binary reject, PCM finite, published restore reject). - Follow the current exact-SHA Windows `native` GitHub CI workflow before merge. A CI success proves compilation and automated tests, not physical sound quality. - **Still requires owner equipment FAT**: audition all 31 faders at representative rates, verify Flat unity (0dB trims), inspect bypass/restore and `.smix`, open/close editor while live ASIO runs, verify CPU/XRUN and confirm headroom/clipping at ±12dB in a complete music mix. From 6a41c724821c45a3d6eefd1b83e50b10d5097ce1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:35:32 +0700 Subject: [PATCH 38/43] fix(geq31): remove invisible gain processing; migrate GEQ1 v1/v2 into 31-band-only v3 --- engine/builtin_fx/GraphicEq31Processor.h | 57 ++++++++++-------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index 613bab4f3..d3035e9ab 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -28,7 +28,6 @@ class GraphicEq31Processor final : public juce::AudioProcessor, params_(*this,nullptr,"GEQ31",makeParameters()) { for(std::size_t i=0;i(bandValues_[i]->load(std::memory_order_relaxed))); - inputSmooth_.reset(sampleRate,.006); - inputSmooth_.setCurrentAndTargetValue(dbToGain(inputValue_->load())); peak_.store(0.f,std::memory_order_relaxed); } void releaseResources() override {ready_=false;} @@ -76,11 +73,8 @@ class GraphicEq31Processor final : public juce::AudioProcessor, const auto count=pcm.getNumSamples(); auto* l=pcm.getWritePointer(0); auto* r=pcm.getWritePointer(1); - inputSmooth_.setTargetValue(dbToGain(inputValue_->load(std::memory_order_relaxed))); - for(int n=0;n(inputSmooth_.getNextValue()); - l[n]*=g;r[n]*=g; - } + // Graphic EQ 31 has only the 31 band controls. No invisible + // input/output gain, and no extra multiplier in the realtime path. core_.processStereo(l,r,static_cast(count)); float peak=0.f; // Output gain was removed from Graphic EQ 31: meter post-EQ PCM, @@ -93,37 +87,40 @@ class GraphicEq31Processor final : public juce::AudioProcessor, void getStateInformation(juce::MemoryBlock& destination) override { // CONTROL thread. Only one fixed-size, versioned state per insert. juce::MemoryOutputStream out(destination,false); - // GEQ1 v2: 31 bands + one input gain, 136 bytes. - // Legacy GEQ1 v1 (140 bytes) still restores without its output trim. - out.writeInt(stateMagic);out.writeInt(2); + // GEQ1 v3: 31 band gains, no hidden trim (132 bytes). + // Restore supports legacy v1/v2 and discards old input/output trims. + out.writeInt(stateMagic);out.writeInt(3); for(auto* p:bandValues_)out.writeFloat(p->load(std::memory_order_acquire)); - out.writeFloat(inputValue_->load(std::memory_order_acquire)); } bool restoreUnpublishedState(const void* bytes,int length) { - constexpr int v1Bytes=8+static_cast(GraphicEq31Core::bandCount+2)*4; - constexpr int v2Bytes=8+static_cast(GraphicEq31Core::bandCount+1)*4; - if(published_||!bytes||(length!=v1Bytes&&length!=v2Bytes))return false; + constexpr int bandBytes=static_cast(GraphicEq31Core::bandCount)*4; + constexpr int v1Bytes=8+bandBytes+8; // band + input + output + constexpr int v2Bytes=8+bandBytes+4; // band + input + constexpr int v3Bytes=8+bandBytes; // band only + if(published_||!bytes|| + (length!=v1Bytes&&length!=v2Bytes&&length!=v3Bytes))return false; juce::MemoryInputStream input(bytes,static_cast(length),false); if(input.readInt()!=stateMagic)return false; const int version=input.readInt(); - if((version==1&&length!=v1Bytes)||(version==2&&length!=v2Bytes)|| - (version!=1&&version!=2))return false; - // Validate the entire state, including the deprecated v1 output trim, - // before touching live parameters. v1 output gain is NOT reapplied. - std::array values{}; - for(auto& value:values) { + if((version==1&&length!=v1Bytes)|| + (version==2&&length!=v2Bytes)|| + (version==3&&length!=v3Bytes)|| + (version!=1&&version!=2&&version!=3))return false; + std::array bands{}; + for(auto& value:bands) { value=input.readFloat(); if(!std::isfinite(value)||value < -12.f||value>12.f)return false; } - if(version==1) { - const float discardedOutputDb=input.readFloat(); - if(!std::isfinite(discardedOutputDb)|| - discardedOutputDb < -12.f||discardedOutputDb>12.f)return false; + // Strictly validate legacy trims before any state mutation, then + // discard them. Hidden gain must NEVER survive a UI migration. + for(int i=0;i<(version==1?2:version==2?1:0);++i) { + const auto obsoleteTrim=input.readFloat(); + if(!std::isfinite(obsoleteTrim)|| + obsoleteTrim < -12.f||obsoleteTrim>12.f)return false; } if(!input.isExhausted())return false; for(std::size_t i=0;i(-12.f,12.f,.1f),0.f)); - result.add(std::make_unique( - juce::ParameterID{"inputDb",1},"Input Gain", - juce::NormalisableRange(-12.f,12.f,.1f),0.f)); return result; } void setParameter(const juce::String& id,float db) { @@ -164,12 +158,9 @@ class GraphicEq31Processor final : public juce::AudioProcessor, p->endChangeGesture(); } } - static double dbToGain(float db) noexcept {return std::pow(10.,static_cast(db)/20.);} juce::AudioProcessorValueTreeState params_; GraphicEq31Core core_; std::array*,GraphicEq31Core::bandCount> bandValues_{}; - std::atomic* inputValue_=nullptr; - juce::SmoothedValue inputSmooth_; std::atomic peak_{0.f}; bool published_=false,ready_=false; }; From 280d8a9a45dd11ea1981a238972ed659f6e754bb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:37:15 +0700 Subject: [PATCH 39/43] fix(geq31): readable 50px native SVG faders, no gain knob, no duplicate bitmap shadow --- engine/builtin_fx/GraphicEq31Processor.h | 156 +++++++---------------- 1 file changed, 43 insertions(+), 113 deletions(-) diff --git a/engine/builtin_fx/GraphicEq31Processor.h b/engine/builtin_fx/GraphicEq31Processor.h index d3035e9ab..454e83c99 100644 --- a/engine/builtin_fx/GraphicEq31Processor.h +++ b/engine/builtin_fx/GraphicEq31Processor.h @@ -189,20 +189,6 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: viewport_.setScrollBarThickness(7); addAndMakeVisible(viewport_); - // ONE gain control, using the owner's KNOB-EQ.svg (KNOB + POINTER). - // No output knob, no input/output fader, and no duplicate FX host. - input_.setComponentID("geq31-input"); - input_.setSliderStyle(juce::Slider::RotaryHorizontalVerticalDrag); - input_.setRotaryParameters(juce::degreesToRadians(225.f), - juce::degreesToRadians(495.f),true); - input_.setTextBoxStyle(juce::Slider::TextBoxBelow,false,82,21); - input_.setTextValueSuffix(" dB"); - input_.setDoubleClickReturnValue(true,0.); - input_.setTooltip("Input Gain -12 to +12 dB. Double-click for 0 dB"); - inputAttachment_=std::make_unique( - processor_.parameters(),"inputDb",input_); - addAndMakeVisible(input_); - flat_.setButtonText("Flat"); flat_.onClick=[this]{processor_.setFlatFromUi();}; addAndMakeVisible(flat_); @@ -225,59 +211,50 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: peakLabel_.setFont(inter(10.f)); addAndMakeVisible(peakLabel_); setResizable(true,true); - setResizeLimits(850,391,1800,391); - setSize(1370,391); + setResizeLimits(850,391,1900,391); + setSize(1610,391); startTimerHz(20); } ~GraphicEq31Editor() override {stopTimer();setLookAndFeel(nullptr);} void paint(juce::Graphics& g) override { - g.fillAll(juce::Colour::fromRGB(243,245,246)); - auto b=getLocalBounds().toFloat().reduced(7.f); - g.setColour(juce::Colour::fromRGB(251,252,252)); - g.fillRoundedRectangle(b,9.f); - g.setColour(juce::Colour::fromRGB(220,225,226)); - g.drawRoundedRectangle(b,9.f,1.f); - - g.setColour(juce::Colour::fromRGB(53,67,72)); - g.setFont(inter(17.f)); - g.drawText("Graphic EQ 31",187,19,300,28,juce::Justification::centredLeft); + // One uninterrupted control panel. No per-band card or shadow. + g.fillAll(juce::Colour::fromRGB(246,247,247)); + g.setColour(juce::Colour::fromRGB(212,219,221)); + g.drawRect(getLocalBounds().reduced(1),1); + g.setColour(juce::Colour::fromRGB(52,67,73)); + g.setFont(inter(18.f)); + g.drawText("Graphic EQ 31",20,15,300,32,juce::Justification::centredLeft); + g.setColour(juce::Colour::fromRGB(128,143,148)); g.setFont(inter(10.5f)); - g.setColour(juce::Colour::fromRGB(125,140,145)); g.drawText("ARSONMIX / 1/3 OCTAVE / 20 Hz - 20 kHz", - 188,44,410,18,juce::Justification::centredLeft); - - g.setColour(juce::Colour::fromRGB(224,230,230)); - g.drawVerticalLine(177,69.f,367.f); - g.setColour(juce::Colour::fromRGB(65,76,79)); - g.setFont(inter(12.f)); - g.drawText("INPUT GAIN",18,79,149,20,juce::Justification::centred); + 213,24,400,20,juce::Justification::centredLeft); + g.setColour(juce::Colour::fromRGB(226,231,232)); + g.drawHorizontalLine(53,0.f,static_cast(getWidth())); g.setFont(inter(10.f)); - g.setColour(juce::Colour::fromRGB(133,146,149)); - g.drawText("-12",18,231,45,20,juce::Justification::centred); - g.drawText("+12",116,231,48,20,juce::Justification::centred); - g.drawText("31 BANDS / +/-12 dB",188,358, - juce::jmax(0,getWidth()-209),20,juce::Justification::centredLeft); + g.setColour(juce::Colour::fromRGB(112,126,131)); + g.drawText("+12",5,86,36,16,juce::Justification::centredRight); + g.drawText("0",5,195,36,16,juce::Justification::centredRight); + g.drawText("-12",5,307,36,16,juce::Justification::centredRight); + g.setColour(juce::Colour::fromRGB(143,155,159)); + g.drawText("31 BANDS / +/-12 dB",53,366, + juce::jmax(0,getWidth()-70),17,juce::Justification::centredLeft); } - void resized() override { - constexpr int x0=186; - // 37px pitch instead of the former 80px: 31 bands total 1147px. - // At 1370px default width all 31 appear without horizontal scrolling. - viewport_.setBounds(x0,69,juce::jmax(1,getWidth()-x0-17),283); - bandSurface_.setSize(static_cast(GraphicEq31Core::bandCount)*bandCellWidth,276); + constexpr int x0=46; + viewport_.setBounds(x0,66,juce::jmax(1,getWidth()-x0-12),297); + bandSurface_.setSize(static_cast(GraphicEq31Core::bandCount)*bandCellWidth,287); for(std::size_t i=0;i(i)*bandCellWidth,0, - bandCellWidth,274); - input_.setBounds(21,110,138,175); - flat_.setBounds(19,302,70,27); - smile_.setBounds(96,302,70,27); - for(int i=0;i<3;++i) - jump_[i].setBounds(juce::jmax(595,getWidth()-250)+i*77,26,71,25); - peakLabel_.setBounds(18,340,150,20); + bandCellWidth,286); + const int controlX=juce::jmax(440,getWidth()-415); + flat_.setBounds(controlX,17,64,27); + smile_.setBounds(controlX+71,17,64,27); + for(int j=0;j<3;++j) + jump_[j].setBounds(controlX+156+j*74,17,69,27); + peakLabel_.setBounds(5,352,39,20); } - private: static juce::Font inter(float size) {return juce::Font("Inter",size,juce::Font::plain);} class EqSkin final : public juce::LookAndFeel_V4 { @@ -286,8 +263,6 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: #if defined(ARMIX_GEQ31_VECTOR_ASSET) && ARMIX_GEQ31_VECTOR_ASSET originalSvg_=juce::String::fromUTF8(BinaryData::slider_eq_grp_svg, static_cast(BinaryData::slider_eq_grp_svgSize)); - knobSvg_=juce::String::fromUTF8(BinaryData::KNOB_EQ_svg, - static_cast(BinaryData::KNOB_EQ_svgSize)); #endif lastGain_.fill(std::numeric_limits::quiet_NaN()); thumbGroups_.fill(nullptr); @@ -316,8 +291,7 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: thumbGroups_[band]->setTransform(juce::AffineTransform::translation(0.f, shift)); lastGain_[band]=gain; } - // Constrained to each 37px column. The original grouped SVG - // still contains every native Track/Text/THUMB path and raster. + // 50px columns; original authored vector thumb, zero raster shadow. art->drawWithin(g,{static_cast(x),static_cast(y), static_cast(width),static_cast(height)}, juce::RectanglePlacement::stretchToFit,1.f); @@ -327,43 +301,15 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: juce::Justification::centred,2); } } - void drawRotarySlider(juce::Graphics& g,int x,int y,int width,int height, - float position,float,float,juce::Slider& slider) override { - if(slider.getComponentID()!="geq31-input")return; - if(!knobArt_)createKnobArtwork(); - if(!knobArt_) { - g.setColour(juce::Colours::red); - g.drawFittedText("KNOB SVG ERROR",x,y,width,height, - juce::Justification::centred,2); - return; - } - if(knobPointer_&&lastKnobPosition_!=position) { - constexpr float pi=3.14159265358979323846f; - const float angle=(-135.f+270.f*juce::jlimit(0.f,1.f,position))*pi/180.f; - // Source coordinate and POINTER group retained from KNOB-EQ.svg. - knobPointer_->setTransform(juce::AffineTransform::rotation( - angle,35.62f,113.63f)); - lastKnobPosition_=position; - } - knobArt_->drawWithin(g,{static_cast(x),static_cast(y), - static_cast(width),static_cast(height)}, - juce::RectanglePlacement::stretchToFit,1.f); - } - private: - static juce::Component* findGroup(juce::Component* root,const juce::String& id) { - if(root==nullptr)return nullptr; - if(root->getComponentID()==id)return root; - for(int i=0;igetNumChildComponents();++i) - if(auto* child=findGroup(root->getChildComponent(i),id))return child; - return nullptr; - } void createBandArtwork(std::size_t band) { if(originalSvg_.isEmpty())return; auto document=juce::XmlDocument::parse(originalSvg_); if(!document)return; auto* fader=document->getChildByAttribute("id","Slider_EQ"); if(!fader)return; + // Crop only empty source margins for readable track geometry. + document->setAttribute("viewBox","60 0 352 2042"); auto* labelGroup=fader->getChildByAttribute("id","Text"); auto* thumbGroup=fader->getChildByAttribute("id","THUMB"); if(!labelGroup||!thumbGroup)return; @@ -379,13 +325,13 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: frequency->setAttribute("text-anchor","middle"); frequency->setAttribute("style", "transform: matrix(5.4,0,0,4.167,237.76,1850.466); font-family: Inter"); - if(auto* hz=labelGroup->getChildByAttribute("id","Hz")) { - if(auto* text=hz->getFirstChildElement()) { - text->setAttribute("font-family","Inter"); - if(auto* unit=text->getFirstChildElement()) - unit->setAttribute("style","font-family: Inter"); - } - } + // Preserve the original SVG bytes. On this temporary UI clone: + // hide redundant 31x "Hz" and the bitmap duplicate shadow. + if(auto* hz=labelGroup->getChildByAttribute("id","Hz")) + labelGroup->removeChildElement(hz,true); + auto* bitmapWrapper=thumbGroup->getFirstChildElement(); + if(bitmapWrapper&&bitmapWrapper->getChildByAttribute("id","_Image3")) + thumbGroup->removeChildElement(bitmapWrapper,true); auto drawable=juce::Drawable::createFromSVG(*document); if(!drawable)return; auto* authoredFader=drawable->findChildWithID("Slider_EQ"); @@ -394,43 +340,27 @@ class GraphicEq31Editor final : public juce::AudioProcessorEditor, private juce: thumbGroups_[band]=authoredThumb; drawables_[band]=std::move(drawable); } - void createKnobArtwork() { - if(knobSvg_.isEmpty())return; - auto document=juce::XmlDocument::parse(knobSvg_); - if(!document)return; - // Crop transparent authored margins only in the UI viewBox, - // never edit/flatten the original asset, KNOB or POINTER paths. - document->setAttribute("viewBox","-56 20 180 187"); - knobArt_=juce::Drawable::createFromSVG(*document); - knobPointer_=findGroup(knobArt_.get(),"POINTER"); - } - - juce::String originalSvg_,knobSvg_; + juce::String originalSvg_; std::array,GraphicEq31Core::bandCount> drawables_{}; std::array thumbGroups_{}; std::array lastGain_{}; - std::unique_ptr knobArt_; - juce::Component* knobPointer_=nullptr; - float lastKnobPosition_=std::numeric_limits::quiet_NaN(); }; void timerCallback() override { const bool clip=processor_.observedPeak()>=.999f; - peakLabel_.setText(clip?"CLIP":"OUTPUT LEVEL",juce::dontSendNotification); + peakLabel_.setText(clip?"CLIP":"",juce::dontSendNotification); peakLabel_.setColour(juce::Label::textColourId, clip?juce::Colour::fromRGB(226,78,58): juce::Colour::fromRGB(55,158,136)); } using Attachment=juce::AudioProcessorValueTreeState::SliderAttachment; - static constexpr int bandCellWidth=37; + static constexpr int bandCellWidth=50; GraphicEq31Processor& processor_; EqSkin skin_; juce::Component bandSurface_; juce::Viewport viewport_; std::array sliders_; std::vector> attachments_; - juce::Slider input_; - std::unique_ptr inputAttachment_; juce::TextButton flat_,smile_; std::array jump_; juce::Label peakLabel_; From ffa2c8280cfae41720b23a5e74f9b9032b7c8953 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:37:55 +0700 Subject: [PATCH 40/43] test(geq31): v3 band-only state with strict v1/v2 trim migration regressions --- tests/native_fx_registry_extension_test.cpp | 53 +++++++++++++-------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/tests/native_fx_registry_extension_test.cpp b/tests/native_fx_registry_extension_test.cpp index 3621180a3..99d676595 100644 --- a/tests/native_fx_registry_extension_test.cpp +++ b/tests/native_fx_registry_extension_test.cpp @@ -433,31 +433,44 @@ static void verifyGraphicEq31Processor() { geq->setBandFromUi(17,6.f); juce::MemoryBlock state; processor->getStateInformation(state); - assert(state.getSize()==8u+(31u+1u)*4u); // GEQ1 v2, only input trim + assert(state.getSize()==8u+31u*4u); // GEQ1 v3, no hidden gain + assert(geq->parameters().getParameter("inputDb")==nullptr); assert(geq->parameters().getParameter("outputDb")==nullptr); - // Existing user shows saved in GEQ1 v1 remain loadable. The old output - // trim must be valid but never be reactivated in the v2 audio path. - juce::MemoryBlock legacy; - { + // Both historic state schemas must restore without reactivating obsolete + // gain. Each legacy trim is fully validated, never applied to PCM. + auto makeLegacy=[&](int version) { + juce::MemoryBlock legacy; juce::MemoryOutputStream out(legacy,false); out.writeInt(armix::builtin_fx::GraphicEq31Processor::stateMagic); - out.writeInt(1); + out.writeInt(version); out.write(static_cast(state.getData())+8,state.getSize()-8); - out.writeFloat(9.5f); + out.writeFloat(6.5f); // old inputDb + if(version==1)out.writeFloat(9.5f); // old outputDb + return legacy; + }; + for(int version:{1,2}) { + auto legacy=makeLegacy(version); + assert(legacy.getSize()==8u+31u*4u+(version==1?8u:4u)); + auto migrated=descriptor->prepare(48000.,128, + legacy.getData(),static_cast(legacy.getSize())); + assert(migrated); + juce::MemoryBlock converted; + migrated->getStateInformation(converted); + assert(converted==state); + auto badLegacy=legacy; + const float badTrim=std::numeric_limits::quiet_NaN(); + std::memcpy(static_cast(badLegacy.getData())+8+31*4, + &badTrim,sizeof(badTrim)); + assert(!descriptor->prepare(48000.,128,badLegacy.getData(), + static_cast(badLegacy.getSize()))); + if(version==1) { + auto badOutput=legacy; + std::memcpy(static_cast(badOutput.getData())+8+32*4, + &badTrim,sizeof(badTrim)); + assert(!descriptor->prepare(48000.,128,badOutput.getData(), + static_cast(badOutput.getSize()))); + } } - assert(legacy.getSize()==8u+(31u+2u)*4u); - auto migrated=descriptor->prepare(48000.,128, - legacy.getData(),static_cast(legacy.getSize())); - assert(migrated); - juce::MemoryBlock converted; - migrated->getStateInformation(converted); - assert(converted==state); - auto badLegacy=legacy; - const float badTrim=std::numeric_limits::quiet_NaN(); - std::memcpy(static_cast(badLegacy.getData())+badLegacy.getSize()-4, - &badTrim,sizeof(badTrim)); - assert(!descriptor->prepare(48000.,128,badLegacy.getData(), - static_cast(badLegacy.getSize()))); auto restored=descriptor->prepare(44100.,256, state.getData(),static_cast(state.getSize())); assert(restored && restored->getName()=="Graphic EQ 31"); From 6c1b041611de99d7226b32586fa83f9eddbaa105 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:38:14 +0700 Subject: [PATCH 41/43] test(geq31): forbid raster thumb shadows, cramped cells, knobs and hidden trims --- tests/graphic_eq31_svg_layers_test.py | 31 +++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/graphic_eq31_svg_layers_test.py b/tests/graphic_eq31_svg_layers_test.py index 6176e674f..b006c2348 100644 --- a/tests/graphic_eq31_svg_layers_test.py +++ b/tests/graphic_eq31_svg_layers_test.py @@ -53,24 +53,27 @@ def test_exact_svg_is_production_embedded_source(self): self.assertIn('std::array sliders_', self.native) self.assertNotIn('fillRoundedRectangle(cx-thumbWidth', self.native) - def test_compact_inter_and_owner_knob_input_only(self): - raw_knob = KNOB.read_bytes() - self.assertEqual(hashlib.sha256(raw_knob).hexdigest(), KNOB_SHA256) - knob = ET.fromstring(raw_knob) - self.assertIsNotNone(knob.find(".//s:g[@id='KNOB']", SVGNS)) - self.assertIsNotNone(knob.find(".//s:g[@id='POINTER']", SVGNS)) - self.assertIn('assets/fx/graphic-eq31/KNOB-EQ.svg', self.cmake) - self.assertIn('BinaryData::KNOB_EQ_svg', self.native) - self.assertIn('knobPointer_->setTransform(', self.native) - self.assertIn('static constexpr int bandCellWidth=37', self.native) - self.assertIn('setSize(1370,391)', self.native) + def test_readable_50px_zero_shadow_band_only_policy(self): + # Original owner asset remains untouched, but the duplicated raster + # shadow is omitted from the UI clone; vector THUMB stays authentic. + self.assertIn('document->setAttribute("viewBox","60 0 352 2042")', self.native) + self.assertIn('bitmapWrapper->getChildByAttribute("id","_Image3")', self.native) + self.assertIn('thumbGroup->removeChildElement(bitmapWrapper,true)', self.native) + self.assertIn('labelGroup->removeChildElement(hz,true)', self.native) + self.assertIn('static constexpr int bandCellWidth=50', self.native) + self.assertIn('setSize(1610,391)', self.native) self.assertIn('font-family: Inter', self.native) self.assertIn('return juce::Font("Inter",size,juce::Font::plain)', self.native) - self.assertNotIn('output_.setBounds', self.native) + self.assertNotIn('BinaryData::KNOB_EQ_svg', self.native) + self.assertNotIn('drawRotarySlider(', self.native) + self.assertNotIn('input_.setBounds', self.native) + self.assertNotIn('getRawParameterValue("inputDb")', self.native) self.assertNotIn('getRawParameterValue("outputDb")', self.native) + self.assertNotIn('inputSmooth_', self.native) self.assertNotIn('outputSmooth_', self.native) - self.assertIn('out.writeInt(stateMagic);out.writeInt(2);', self.native) - self.assertIn('discardedOutputDb=input.readFloat();', self.native) + self.assertIn('out.writeInt(stateMagic);out.writeInt(3);', self.native) + self.assertIn('const auto obsoleteTrim=input.readFloat();', self.native) + self.assertNotIn('assets/fx/graphic-eq31/KNOB-EQ.svg', self.cmake) def test_thumb_travel_stays_inside_owner_viewbox(self): # Authored thumb bounds from original 469x2042 grouped SVG: From dbfcf553508cfe1c030f77fdc0881947218678c7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:38:24 +0700 Subject: [PATCH 42/43] build(geq31): stop embedding unused KNOB-EQ asset in mixer binary --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80222239f..6b3c9ec7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,7 +333,6 @@ juce_add_binary_data(ARMixAssets SOURCES "${ARMIX_APPROVED_GUI_DIR}/index.html" ${ARMIX_APPROVED_GUI_BINARIES} ${ARMIX_GUITAR_SKIN_PNGS} "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/slider_eq_grp.svg" - "${CMAKE_CURRENT_SOURCE_DIR}/assets/fx/graphic-eq31/KNOB-EQ.svg" ${ARMIX_LEGAL_RESOURCE_FILES} "${ARMIX_BRAND_DIR}/arsonmix-256.png" ${ARMIX_IMERSIB_SCENE_PNG_SOURCES}) From 40016cfc6b1bc077c7956831ee7acfba22fc0d54 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 12:39:25 +0700 Subject: [PATCH 43/43] docs(geq31): zero-shadow vector panel, readable 50px pitch, no gains, state v3 --- docs/fx/GRAPHIC_EQ31_NATIVE.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/docs/fx/GRAPHIC_EQ31_NATIVE.md b/docs/fx/GRAPHIC_EQ31_NATIVE.md index b1359d487..059376d44 100644 --- a/docs/fx/GRAPHIC_EQ31_NATIVE.md +++ b/docs/fx/GRAPHIC_EQ31_NATIVE.md @@ -8,7 +8,7 @@ ## What is owned where - `engine/builtin_fx/GraphicEq31Core.h` owns the fixed 31-frequency stereo signal path. 31 matched second-order peaking sections are directly cascaded without adding a callback or allocation. Nominal centres are the ISO/dbx-style 1/3-octave series from 20 Hz to 20 kHz; Q is fixed at 4.318473, so adjacent bands overlap. -- `engine/builtin_fx/GraphicEq31Processor.h` adapts to the existing JUCE `AudioProcessor` and `RealtimeNativeFxControl`. Stable per-band `AudioParameterFloat` IDs `band0`…`band30`, plus exactly one `inputDb`, are used for host parameter bindings. No `outputDb` processing or output-gain UI exists in the current version. +- `engine/builtin_fx/GraphicEq31Processor.h` is a native JUCE `AudioProcessor`, controlled by `band0`…`band30` only. The input/output trim parameters were fully removed from DSP and editor; legacy saved states migrate safely. - `src/NativeBuiltInFx.h` registers one catalog descriptor. Existing `FxInstance`, per-ChannelId ordering, per-insert bypass, lifecycle, `.smix` binary storage, device switching and generic owned editor remain the exclusive authorities. - `web/approved-native-bridge.js` adds a discovery fallback until native `arMixCatalog` returns the canonical descriptor. **No second GUI or WebAudio processing** is introduced. - `assets/fx/graphic-eq31/slider_eq_grp.svg` is the owner's **byte-exact original 33,354-byte SVG** (`SHA256 aeaf02b8904a667724f34774a692da39a5a466bae302611f347fae4d9fd14dba`). Its three authored children `Track`, `Text`, and `THUMB` are preserved. The production JUCE binary embeds the entire SVG including the original raster/vector THUMB. The editor changes only the `Text` frequency tspan while parsing each band **once** on the UI thread; afterwards it holds the original authored `THUMB` Drawable and applies a simple affine Y transform on parameter changes (no XML reparse, PNG decode, or allocation in the drag path). There are **no JUCE-painted substitute tracks or silver thumbs**; invalid SVG displays a visible error. No BinaryData means the graphical layer cannot render, rather than silently showing a fake substitute. @@ -21,25 +21,23 @@ 3.15k 4k 5k 6.3k 8k 10k 12.5k 16k 20k ``` -- Per-band boost/cut: **±12 dB**, fixed nominal centres. -- **One Input Gain only**, **±12 dB**, smoothed. The output trim control and its audio multiplier were deleted; peak metering remains post-EQ. -- Automatic sample-rate reprepare and Nyquist guard; a band above the physical rate's guard keeps its saved value but its filter is transparent until supported. -- Linked stereo gain coefficients, separate L/R filter history, no artificial delay or lookahead. -- UI controls: 31 faders, centre-zero double-click, Flat/Smile quick buttons, owner `KNOB-EQ.svg` input gain and clip display. The one approved `/preview/` remains the mixer surface; this effect uses the existing JUCE owned plugin-editor window. -- The editor defaults to **1370×391** and resizes horizontally from **850 to 1800 px**. Its pitch is **37 px per slider** (31×37=1147px), reduced from 80px. At default width all bands fit simultaneously; narrower windows retain horizontal LOW/MID/HIGH navigation. Source `slider_eq_grp.svg` remains byte-exact and retains its authored `Track`/`Text`/`THUMB` groups; the frequency label alone is updated on the UI thread and rendered in Inter. -- The **byte-exact original `KNOB-EQ.svg`** (`SHA256 754b3d525be1d4dcbe26fdca1d6bedc5b67e2d2436efec2aa9265ad86c5aad80`) is embedded alongside the fader. The native editor draws the original `KNOB` layer and rotates the original `POINTER` group around its authored origin. All JUCE/HTML EQ labels/buttons request **Inter**, with no extra output gain control. **On Windows, JUCE needs Inter installed** to avoid automatic system-font fallback; no extra font binaries are bundled in this PR. No second UI host/PCM owner was introduced. -- A source-derived HTML/PNG preview may help inspect the art direction but must be labeled **not a live JUCE screenshot** and must never be used as physical FAT proof. +- 31 fixed dbx/ISO nominal one-third-octave centres, each **±12 dB**, linked stereo gains with independent L/R filter history. Zero additional delay/lookahead and normal host bypass. +- **No input or output gain control** and no hidden input/output gain multiplication. Flat with zero bands is unity; peak metering is post-EQ. +- **GEQ1 v3** state stores 31 bands only (**132 bytes**). Historic **v1 140-byte** and **v2 136-byte** states are validated entirely and imported, discarding obsolete input/output trim values. Invalid state fails closed; published graph state is not mutated. +- GUI: authentic owner `slider_eq_grp.svg` remains byte-identical (original `Track`, `Text`, `THUMB` groups). The JUCE editor creates 31 independent Drawables once on the UI thread and moves each vector `THUMB` by Y translation. The duplicate raster use `_Image3` (dark rectangular shadow) is **omitted from the render clone**, not deleted from the source. The duplicate per-band `Hz` group is also hidden in each render clone to declutter the UI. Frequency labels remain within the original `Text` group, switched to Inter. +- **50 px pitch** (31 × 50 = 1550 px) rather than the unreadable previous 37 px. The editor defaults to **1610 × 391 px** and can be resized horizontally from **850 to 1900 px**; smaller windows scroll horizontally with LOW/MID/HIGH jump controls. The source `viewBox` stays unchanged; only the UI clone is cropped horizontally (`60 0 352 2042`) to use screen real estate efficiently. +- One uninterrupted neutral EQ background. **No per-fader shadow blocks, additional cards, gain knob, knob asset in production binary, or second GUI host.** `KNOB-EQ.svg` may remain archived in the repository but is no longer included in CMake BinaryData. +- The only mixer interface authority remains the existing ArSonMix FX Rack and mixer-owned JUCE editor; no extra PCM path or WebView is added. +- The screenshot/HTML design preview is a source-derived Chromium rendering, **not** evidence that the JUCE Windows native build has passed. ## State and safety -A separate versioned `GEQ1` **v2 136-byte** binary payload stores 31 band gains and one input gain. **Legacy v1 140-byte** payloads are validated in full and migrated, discarding their deprecated output trim so it cannot secretly alter output PCM. `restoreUnpublishedState` validates the **entire** blob before changing parameters and refuses modifications after the instance has been sealed into a published realtime graph. The existing host prepares a replacement lease rather than mutating published DSP state. The processor exposes only an atomic per-block peak to its GUI. - -Coefficient transitions are smoothed over 5ms on the audio thread when gain targets change; parameter values are atomics, not locks. The realtime implementation avoids disk, JSON and heap allocation. +The versioned state loader validates magic, version, exact byte length, every per-band value, and any legacy trims **before changing any parameters**. Live audio coefficients use existing realtime-safe smoothing; no allocation, file IO, locks, or JSON parsing is performed on the realtime callback. ## Verification evidence and release boundary - Static/pure-C++ checks: `ARMixGraphicEq31CoreTests` / `GraphicEq31FrequencyResponseAndRealtimeStability` (frequency response, invalid gains, stereo isolation, low-rate Nyquist and automation stress). Its 29 explicit `GEQ_CHECK` predicates remain executable in Release (`NDEBUG`) builds, including setup calls that used to disappear inside standard `assert`. -- Source-artwork regression: `GraphicEq31OriginalSvgLayersAndDynamicThumb` validates byte-exact checksums for both owner assets, original `Track`/`Text`/`THUMB` and `KNOB`/`POINTER` groups, CMake BinaryData ownership, compact 37px pitch, Inter, and absence of output trim. +- Source-artwork regression: `GraphicEq31OriginalSvgLayersAndDynamicThumb` validates the owner's byte-exact SVG, original `Track`/`Text`/`THUMB` structure, shadow removal on the UI clone, CMake BinaryData, 50px fader pitch, Inter, and absence of both gain trims. - Shared host registration: `ARMixNativeFxExtensionTests` (catalog, state roundtrip, bad binary reject, PCM finite, published restore reject). - Follow the current exact-SHA Windows `native` GitHub CI workflow before merge. A CI success proves compilation and automated tests, not physical sound quality. - **Still requires owner equipment FAT**: audition all 31 faders at representative rates, verify Flat unity (0dB trims), inspect bypass/restore and `.smix`, open/close editor while live ASIO runs, verify CPU/XRUN and confirm headroom/clipping at ±12dB in a complete music mix.