Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
224357c
feat(geq31): add fixed ISO 31-band realtime stereo EQ core
masarray Nov 20, 2026
d36b833
feat(geq31): add JUCE built-in processor and 31 hardware-style native…
masarray Nov 20, 2026
cbda60c
feat(geq31): register Graphic EQ 31 as first-class native FX
masarray Nov 20, 2026
7ee7ba2
test(geq31): verify standard centres, PCM response and realtime stabi…
masarray Nov 20, 2026
67f16e0
build(geq31): include deterministic DSP test in native mixer gate
masarray Nov 20, 2026
6d3db78
feat(geq31): expose Graphic EQ 31 in native FX picker fallback
masarray Nov 20, 2026
2aec94e
assets(geq31): preserve user-supplied slider vector geometry (thumb r…
masarray Nov 20, 2026
1c2dd2c
test(geq31): prove native registry, state restore and PCM lease lifec…
masarray Nov 20, 2026
4d52abb
assets(geq31): isolate user's SVG fader track for dynamic thumb
masarray Nov 20, 2026
b00f426
feat(geq31): render supplied vector slider track in native JUCE editor
masarray Nov 20, 2026
f9ccaba
build(geq31): embed owner-provided vector fader asset for native FX UI
masarray Nov 20, 2026
d7e5eaa
docs(geq31): define native ownership, SVG source, state and acceptanc…
masarray Nov 20, 2026
e65d75d
perf(geq31): block-by-band vector-friendly cascade and flat fast path
masarray Nov 20, 2026
baa591b
test(geq31): assert zero-band fast path leaves PCM bit-exact
masarray Nov 20, 2026
f4e4aa7
test(geq31): execute DSP checks in Release CI instead of disabled ass…
masarray Nov 20, 2026
dcda95d
fix(geq31 gui): reflow 31 faders within resizable compact native editor
masarray Nov 20, 2026
d50653c
fix(geq31 ui): constrain dynamic fader thumbs inside compact columns
masarray Nov 20, 2026
615e80d
docs(geq31): qualify compact JUCE layout and Release-mode DSP assertions
masarray Nov 20, 2026
212b9af
assets(geq31): preserve owner's exact layered slider_eq_grp.svg with …
masarray Nov 20, 2026
42ac141
feat(geq31): render original grouped SVG THUMB/Text/Track with native…
masarray Nov 20, 2026
9282a67
build(geq31): embed owner's full layered slider_eq_grp.svg into JUCE …
masarray Nov 20, 2026
df4e788
test(geq31): prevent SVG THUMB/Text/Track regressions and require ori…
masarray Nov 20, 2026
2af1995
ci(geq31): add exact-source SVG layer regression to Windows native CTest
masarray Nov 20, 2026
a371e05
docs(geq31): record exact owner SVG, correct 31-band viewport UX and …
masarray Nov 20, 2026
48e8eec
chore(geq31): remove rejected track-only surrogate SVGZ asset
masarray Nov 20, 2026
e3876c0
perf(geq31): move authored THUMB Drawable in place without reparsing …
masarray Nov 20, 2026
c388b8a
test(geq31): validate low-allocation native THUMB Drawable mutation
masarray Nov 20, 2026
12bde7f
docs(geq31): clarify one-time SVG render and in-place original thumb …
masarray Nov 20, 2026
449000b
build(geq31): preserve original layered SVG bytes across Windows Git …
masarray Nov 20, 2026
af57e6c
asset(geq31): preserve owner-supplied KNOB-EQ SVG with KNOB and POINT…
masarray Nov 20, 2026
ffd00f4
refactor(geq31): single input gain with v1 legacy output-trim state m…
masarray Nov 20, 2026
4ad3c94
build(geq31): embed owner KNOB-EQ.svg alongside original grouped fader
masarray Nov 20, 2026
6dd230c
feat(geq31 ui): compact 37px original SVG faders, Inter text, owner K…
masarray Nov 20, 2026
31fcf0e
test(geq31): migrate legacy two-trim state to input-only v2 and rejec…
masarray Nov 20, 2026
2d25eb8
test(geq31 ui): lock compact Inter layout and exact owner KNOB-EQ layers
masarray Nov 20, 2026
b3d5a09
fix(geq31 svg): increase Inter frequency-label legibility in 37px col…
masarray Nov 20, 2026
e333280
docs(geq31): 37px Inter artwork, original KNOB-EQ and input-only GEQ1…
masarray Nov 20, 2026
6a41c72
fix(geq31): remove invisible gain processing; migrate GEQ1 v1/v2 into…
masarray Nov 20, 2026
280d8a9
fix(geq31): readable 50px native SVG faders, no gain knob, no duplica…
masarray Nov 20, 2026
ffa2c82
test(geq31): v3 band-only state with strict v1/v2 trim migration regr…
masarray Nov 20, 2026
6c1b041
test(geq31): forbid raster thumb shadows, cramped cells, knobs and hi…
masarray Nov 20, 2026
dbfcf55
build(geq31): stop embedding unused KNOB-EQ asset in mixer binary
masarray Nov 20, 2026
40016cf
docs(geq31): zero-shadow vector panel, readable 50px pitch, no gains,…
masarray Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_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 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)

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
Expand Down Expand Up @@ -1611,6 +1615,16 @@ 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_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,
# soft knee, dry/wet, parameter validation and variable sample rates.
add_executable(ARMixNativeCompressorTests tests/builtin_channel_compressor_test.cpp
Expand Down
39 changes: 39 additions & 0 deletions assets/fx/graphic-eq31/KNOB-EQ.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 150 additions & 0 deletions assets/fx/graphic-eq31/slider_eq_grp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/fx/GRAPHIC_EQ31_NATIVE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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` 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.

## 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
```

- 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

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 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.

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.
134 changes: 134 additions & 0 deletions engine/builtin_fx/GraphicEq31Core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>

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<double,31> 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<const char*,31> 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<int>(std::round(rate_*0.005)));
for(std::size_t i=0;i<bandCount;++i) {
auto& b=bands_[i];
b.current=b.target=coefficients(i,b.db,rate_);
b.step={};b.frames=0;
b.l1=b.l2=b.r1=b.r2=0.;
}
return true;
}
bool ready() const noexcept {return ready_;}
double sampleRate() const noexcept {return rate_;}
double gainDb(std::size_t i) const noexcept {
return i<bandCount?bands_[i].db:0.;
}
bool setGain(std::size_t i,double db) noexcept {
if(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<double>(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;
}
// 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(auto& b:bands_) {
if(b.frames==0 && b.db==0.) {
// Flush stale IIR memories after a completed ramp-to-unity,
// so re-enabling a band never exposes a frozen old history.
b.l1=b.l2=b.r1=b.r2=0.;
continue;
}
for(std::size_t n=0;n<frames;++n) {
if(b.frames>0) {
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& 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<float>(yl);
right[n]=static_cast<float>(yr);
}
}
}
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<Band,bandCount> bands_{};
double rate_=0.;
int rampFrames_=240;
bool ready_=false;
};
} // namespace armix::builtin_fx
Loading
Loading