diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..5bd3b0a
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,57 @@
+name: Validate and build
+on:
+ pull_request:
+ paths: ['engine/**', 'plugin/**', 'assets/**', 'tests/**', 'CMakeLists.txt', 'docs/WINDOWS-QUICKSTART.md', '.github/workflows/**']
+ workflow_dispatch:
+permissions:
+ contents: read
+concurrency:
+ group: arson-comp-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+jobs:
+ engine-safety:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: cmake -S . -B build -DARSON_BUILD_PLUGIN=OFF -DARSON_SANITIZE=ON -DCMAKE_BUILD_TYPE=Debug
+ - run: cmake --build build --parallel 2
+ - run: ctest --test-dir build --output-on-failure
+ windows:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/cache@v4
+ with:
+ path: build/_deps/juce-src
+ key: juce-8.0.12-29396c22-windows
+ - run: cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Release
+ - run: cmake --build build --config Release --parallel 4
+ - run: ctest --test-dir build -C Release --output-on-failure
+ - name: Measure engine throughput
+ shell: pwsh
+ run: |
+ New-Item -ItemType Directory -Force artifacts
+ & ./build/Release/engine_bench.exe | Tee-Object artifacts/benchmark.txt
+ - name: Package install-ready Windows test artifact
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+ $dest = 'artifacts/ArSonComp-Windows-Test'
+ New-Item -ItemType Directory -Force "$dest/Plugin", "$dest/Standalone", "$dest/Screenshots" | Out-Null
+ Copy-Item -Recurse 'build/ArSonComp_artefacts/Release/VST3/ArSonComp.vst3' "$dest/Plugin/"
+ Copy-Item 'build/ArSonComp_artefacts/Release/Standalone/ArSonComp.exe' "$dest/Standalone/"
+ Copy-Item 'docs/WINDOWS-QUICKSTART.md' "$dest/START-HERE.md"
+ Copy-Item 'artifacts/benchmark.txt' "$dest/benchmark.txt"
+ Copy-Item 'build/ArSonComp-preview*.png' "$dest/Screenshots/"
+ $files = Get-ChildItem "$dest/Plugin", "$dest/Standalone" -File -Recurse
+ $files | ForEach-Object { "$((Get-FileHash $_.FullName -Algorithm SHA256).Hash) $($_.FullName.Substring((Resolve-Path $dest).Path.Length + 1))" } |
+ Set-Content "$dest/SHA256SUMS.txt" -Encoding ascii
+ "Commit: ${{ github.sha }}" | Set-Content "$dest/BUILD-INFO.txt" -Encoding ascii
+ "CI: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
+ Add-Content "$dest/BUILD-INFO.txt"
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ArSonComp-Windows-x64-ReadyToTest
+ path: artifacts/ArSonComp-Windows-Test/
+ if-no-files-found: error
+ retention-days: 14
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..e82b518
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,11 @@
+# ArSonComp engineering contract
+
+- Build a live compressor, not an audio editor. Keep the GUI compact, legible and visually calm. Avoid bulky cards, giant fonts and decorative controls.
+- Engine must remain framework independent. Audio thread owns DSP state; no allocation, mutex, file/network I/O or dependency on a worker finishing in process/setParameters.
+- One canonical parameter table in engine/Parameters.h. Stable IDs must not be renamed after release. Sanitize outside the inner sample loop.
+- Do not add a worker for synchronous audio. Add workers only for demonstrably expensive non-audio tasks, with bounded queues, cancellation and joined lifetime.
+- Preserve zero additional latency in the live path. Do not silently introduce lookahead or oversampling.
+- Telemetry must be bounded and may drop visual data; never stall audio. GUI changes must not alter DSP results.
+- Use RAII and bounded containers. Avoid fast-math, speculative approximation or SIMD unless profiling and numerical tests support it.
+- Run meaningful DSP/host tests, inspect GUI renders at minimum/default size, and document unverified hardware behavior. Never claim proprietary Pro-C parity without matched-input audio comparisons.
+- Group meaningful changes before CI. Do not dispatch repetitive builds or commit generated binaries/build directories.
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..1122f9b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,71 @@
+cmake_minimum_required(VERSION 3.22)
+project(ArSonComp VERSION 0.1.0 LANGUAGES CXX)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+option(ARSON_BUILD_PLUGIN "Build VST3 and standalone" ON)
+option(ARSON_SANITIZE "Enable address/undefined sanitizers for engine tests" OFF)
+add_library(arson_engine STATIC engine/Compressor.cpp)
+set_target_properties(arson_engine PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(arson_engine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/engine)
+if(MSVC)
+ target_compile_options(arson_engine PRIVATE /W4)
+else()
+ target_compile_options(arson_engine PRIVATE -Wall -Wextra -Wpedantic)
+endif()
+if(ARSON_SANITIZE AND NOT MSVC)
+ target_compile_options(arson_engine PUBLIC -fsanitize=address,undefined -fno-omit-frame-pointer)
+ target_link_options(arson_engine PUBLIC -fsanitize=address,undefined)
+endif()
+include(CTest)
+if(BUILD_TESTING)
+ find_package(Threads REQUIRED)
+ add_executable(engine_tests tests/EngineTests.cpp)
+ target_link_libraries(engine_tests PRIVATE arson_engine Threads::Threads)
+ add_test(NAME engine_contract COMMAND engine_tests)
+ add_executable(engine_bench tests/Benchmark.cpp)
+ target_link_libraries(engine_bench PRIVATE arson_engine)
+endif()
+if(ARSON_BUILD_PLUGIN)
+ if(DEFINED JUCE_SOURCE_DIR)
+ add_subdirectory(${JUCE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/JUCE)
+ else()
+ include(FetchContent)
+ FetchContent_Declare(JUCE GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
+ GIT_TAG 8.0.12 GIT_SHALLOW TRUE)
+ FetchContent_MakeAvailable(JUCE)
+ execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY "${juce_SOURCE_DIR}"
+ OUTPUT_VARIABLE JUCE_CHECKED_SHA OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY)
+ if(NOT JUCE_CHECKED_SHA STREQUAL "29396c22c93392d6738e021b83196283d6e4d850")
+ message(FATAL_ERROR "JUCE tag does not match the audited commit")
+ endif()
+ endif()
+ juce_add_plugin(ArSonComp COMPANY_NAME "ArSon Audio" BUNDLE_ID "com.arsonaudio.comp"
+ PLUGIN_MANUFACTURER_CODE ArSn PLUGIN_CODE ArCp FORMATS VST3 Standalone
+ PRODUCT_NAME "ArSonComp" IS_SYNTH FALSE NEEDS_MIDI_INPUT FALSE NEEDS_MIDI_OUTPUT FALSE
+ IS_MIDI_EFFECT FALSE EDITOR_WANTS_KEYBOARD_FOCUS FALSE COPY_PLUGIN_AFTER_BUILD FALSE
+ VST3_CATEGORIES Fx Dynamics)
+ # Bundled reference-derived black brushed-metal image. Generated assets
+ # are compiled into the VST3/Standalone; no filesystem access at runtime.
+ juce_add_binary_data(ArSonCompKnobAssets
+ SOURCES assets/black_brushed_knob.jpg
+ assets/gunmetal_slider_track.png
+ assets/gunmetal_slider_thumb_red.png
+ assets/toggle/arson_toggle_on.png
+ assets/toggle/arson_toggle_off.png)
+ target_sources(ArSonComp PRIVATE plugin/Processor.cpp plugin/Editor.cpp)
+ if(MSVC)
+ target_compile_options(ArSonComp PRIVATE /utf-8)
+ endif()
+ target_compile_definitions(ArSonComp PUBLIC JUCE_WEB_BROWSER=0 JUCE_USE_CURL=0
+ JUCE_VST3_CAN_REPLACE_VST2=0)
+ target_link_libraries(ArSonComp PRIVATE arson_engine ArSonCompKnobAssets juce::juce_audio_utils
+ PUBLIC juce::juce_recommended_config_flags juce::juce_recommended_lto_flags)
+ if(BUILD_TESTING)
+ juce_add_console_app(plugin_smoke PRODUCT_NAME "ArSonCompSmoke")
+ target_sources(plugin_smoke PRIVATE tests/PluginSmoke.cpp)
+ target_link_libraries(plugin_smoke PRIVATE ArSonComp ArSonCompKnobAssets
+ arson_engine juce::juce_audio_utils)
+ add_test(NAME plugin_state_editor COMMAND plugin_smoke "${CMAKE_BINARY_DIR}/ArSonComp-preview.png")
+ set_tests_properties(plugin_state_editor PROPERTIES TIMEOUT 30)
+ endif()
+endif()
diff --git a/README.md b/README.md
index 38d9870..5ee0f94 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,70 @@
-# arson-comp
\ No newline at end of file
+# ArSonComp
+
+A lightweight **real-time compressor** with a framework-independent C++17 DSP core, JUCE VST3 and Windows Standalone application. Designed for live vocal, karaoke, podcast, music and mix-bus use. This is an **engineering test baseline**, not a certified production release or a claimed FabFilter Pro-C clone.
+
+## Current verified milestone — 31 October 2026
+
+| Area | Implemented and checked |
+| --- | --- |
+| DSP | Clean feed-forward, causal Feedback and Smooth dual-envelope models; Peak and 10 ms RMS detection; Attack, Release, Hold, Threshold, Ratio, Knee, Range and Auto Release |
+| Signal path | Input/Makeup gain, wet/dry Mix, stereo Link, mono/stereo main buses, optional external sidechain, detector HP/LP, SC Listen, smoothed Bypass |
+| Latency | **0 additional algorithmic samples** reported by the plugin; host buffer, driver and audio interface latency are separate |
+| Host interoperability | Stable APVTS parameter IDs, project state restore, six factory starting presets, user `.arsoncomp` save/open through **FILE**, A/B snapshots, automation attachments |
+| GUI | Grey brushed-metal chassis, recessed black LCD graph and IN/GR/OUT meters, photographic black rotary knobs, matched metal toggle PNGs, fixed gunmetal slider rails with moving PNG thumbs and red value fill |
+| Value workflow | **No floating value popup/tooltip.** Hover/drag the knobs and sliders to read their value in the LCD's bottom-center footer; MINI uses a small right-side footer |
+| Dimensions | Full **780×640** default, **740×585** minimum; MINI **330 px** tall. Resizable full layout and responsive SIDECHAIN row |
+| Automated verification | Windows Release VST3 + Standalone, `engine_contract`, `plugin_state_editor`, Linux engine safety/sanitizers, renderer/asset/layout checks, benchmark and install-ready Windows artifact |
+
+**Latest code-tested revision:** `7b340eb2ee5740df13b52b5bfcf984a3b66d0dd3`. Both jobs passed in [GitHub Actions #41202549812](https://github.com/masarray/arson-comp/actions/runs/41202549812). The [Windows x64 artifact](https://github.com/masarray/arson-comp/actions/runs/41202549812/artifacts/13043510391) contains VST3, Standalone, four actual Windows screenshot captures, a benchmark, and SHA-256 manifests. Subsequent documentation-only reconciliation does not modify the compiled source.
+
+### What is *not* verified yet
+
+Real-device ASIO/WASAPI audio latency and stability; two independent DAW/VST3 hosts, external hardware/host sidechain, pluginval, multi-instance long sessions, 125–150% DPI scaling, and loudness-matched listening comparisons. No full Pro-C sonic, feature or production-readiness claim. The initial standalone uses standard JUCE audio device backends; **ASIO support is not claimed**.
+
+## Quick start — Windows
+
+1. Download the Windows artifact linked above and extract its contents.
+2. Run `Standalone/ArSonComp.exe`, then choose audio input/output devices in its settings; **or** copy the entire `Plugin/ArSonComp.vst3` folder to `C:\Program Files\Common Files\VST3\`, then rescan your VST3 host.
+3. Start with Clean and a moderate preset. Lower Threshold until the GR meter indicates the desired compression. Use Makeup to match audible loudness before A/B or model comparisons.
+4. Open **SIDECHAIN** to configure Peak/RMS, HP/LP and optional EXT SC and LISTEN; use **DYNAMICS** for Range, Hold, Mix, Link, Auto Release. FILE provides Save/Open user presets.
+5. Hover or move any knob/slider to see name, numerical value and unit in the graph LCD footer. Double-click to restore the parameter's default. Use MINI/FULL to switch form factor.
+
+A disconnected external sidechain may produce silence at the detector. Use LISTEN only to audit the detector and turn it off for normal use. This is a compressor—not a limiter; with no lookahead, transients may pass.
+
+## Build from source
+
+CMake 3.22+, C++17, JUCE 8.0.12 pinned to commit `29396c22c93392d6738e021b83196283d6e4d850`. On Windows, install Visual Studio 2022 or newer with C++ desktop tools.
+
+```sh
+cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Release
+cmake --build build --config Release --parallel 4
+ctest --test-dir build -C Release --output-on-failure
+```
+
+For engine-only verification on Linux/macOS, omit the Windows `-A x64` argument and use:
+
+```sh
+cmake -S . -B build-core -DARSON_BUILD_PLUGIN=OFF -DCMAKE_BUILD_TYPE=Release
+cmake --build build-core --parallel 2
+ctest --test-dir build-core --output-on-failure
+./build-core/engine_bench
+```
+
+Linux plugin build dependencies depend on the desktop stack, commonly `pkg-config libasound2-dev libx11-dev libxext-dev libxinerama-dev libxrandr-dev libxcursor-dev libfreetype6-dev libfontconfig1-dev libgl1-mesa-dev`. Use `-DJUCE_SOURCE_DIR=/path/to/JUCE` to reuse a local checkout. ASan/UBSan engine testing: `-DARSON_SANITIZE=ON -DCMAKE_BUILD_TYPE=Debug` under GCC/Clang. **Do not enable fast-math**, because non-finite handling relies on IEEE floating-point semantics.
+
+## Engineering boundaries
+
+The independent DSP core is free of JUCE. The audio callback does not require a worker, mutex, heap allocation or file/network I/O; it has bounded telemetry. GUI paint is message-thread-only, with cached materials, gradient/grid geometry and 30 Hz display updates. The plugin adds no intentional lookahead, oversampling, linear-phase stage or audio delay line. A reported zero algorithmic samples does **not** mean the full monitoring system has zero latency.
+
+Presets and parameter updates are smoothed where appropriate, but are not promised sample-accurate atomic transactions. Host automation behavior, sidechain audibility, distortion and CPU load must be verified with actual devices.
+
+## Documentation and release gates
+
+- [PRD: scope and acceptance](docs/PRD.md)
+- [ARD: DSP, scheduling and GUI ownership](docs/ARD.md)
+- [VALIDATION: evidence and outstanding tests](docs/VALIDATION.md)
+- [HANDOFF: current next steps and historical milestones](docs/HANDOFF.md)
+- [WINDOWS-QUICKSTART: physical test checklist](docs/WINDOWS-QUICKSTART.md)
+- [AGENTS: engineering guardrails](AGENTS.md)
+
+Repository license remains AGPL-3.0; JUCE has its own AGPL/commercial terms. FabFilter Pro-C is a third-party workflow and sound-quality reference; no FabFilter asset, code or proprietary algorithm is included.
diff --git a/assets/black_brushed_knob.jpg b/assets/black_brushed_knob.jpg
new file mode 100644
index 0000000..8d26073
Binary files /dev/null and b/assets/black_brushed_knob.jpg differ
diff --git a/assets/gunmetal_slider_thumb_red.png b/assets/gunmetal_slider_thumb_red.png
new file mode 100644
index 0000000..ac2e40c
Binary files /dev/null and b/assets/gunmetal_slider_thumb_red.png differ
diff --git a/assets/gunmetal_slider_track.png b/assets/gunmetal_slider_track.png
new file mode 100644
index 0000000..cda74e9
Binary files /dev/null and b/assets/gunmetal_slider_track.png differ
diff --git a/assets/sliderthumb.png b/assets/sliderthumb.png
new file mode 100644
index 0000000..f9f9699
Binary files /dev/null and b/assets/sliderthumb.png differ
diff --git a/assets/toggle/README.md b/assets/toggle/README.md
new file mode 100644
index 0000000..31ba4d3
--- /dev/null
+++ b/assets/toggle/README.md
@@ -0,0 +1,12 @@
+# ArSonComp ON/OFF toggle assets
+
+Two state images are authored as transparent SVG source files. Corresponding
+high-resolution RGBA PNG exports are supplied with the design deliverables.
+
+- ON: green case, metal actuator on the left
+- OFF: red case, metal actuator on the right
+- Source canvas: 640 × 246; recommended PNG export: 768 × 295
+- Use images at the same view rectangle for a no-layout-shift state change.
+
+Export for JUCE using: `cairosvg arson_toggle_on.svg -o arson_toggle_on.png -W 768 -H 295`
+(and analogously for OFF). No changes to DSP or plugin UI wiring are included.
diff --git a/assets/toggle/arson_toggle_off.png b/assets/toggle/arson_toggle_off.png
new file mode 100644
index 0000000..a9d24fb
Binary files /dev/null and b/assets/toggle/arson_toggle_off.png differ
diff --git a/assets/toggle/arson_toggle_off.svg b/assets/toggle/arson_toggle_off.svg
new file mode 100644
index 0000000..82e7ba0
--- /dev/null
+++ b/assets/toggle/arson_toggle_off.svg
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/assets/toggle/arson_toggle_on.png b/assets/toggle/arson_toggle_on.png
new file mode 100644
index 0000000..b753c7b
Binary files /dev/null and b/assets/toggle/arson_toggle_on.png differ
diff --git a/assets/toggle/arson_toggle_on.svg b/assets/toggle/arson_toggle_on.svg
new file mode 100644
index 0000000..303fef9
--- /dev/null
+++ b/assets/toggle/arson_toggle_on.svg
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/docs/ARD.md b/docs/ARD.md
new file mode 100644
index 0000000..ecf359a
--- /dev/null
+++ b/docs/ARD.md
@@ -0,0 +1,92 @@
+# Architecture
+
+## Ownership and scheduling
+
+`engine/` is a C++17 static library; `plugin/Processor` adapts host buses, parameters and state; `plugin/Editor` owns presentation. DSP lifetime is independent of editor lifetime. No worker is needed for this bounded, causal processing workload.
+
+The processor caches APVTS atomic pointers once, then snapshots parameters once per block. Snapshot comparisons happen before coefficient/linear gain conversions, eliminating `exp` work for unchanged host values. The Peak path keeps RMS state updated but skips an unnecessary `sqrt`; detector transitions still crossfade over 5 ms. Parameters are clamped/canonicalized; expensive time/filter coefficients only change when their parameter changes. Input/makeup dB conversion occurs at control updates and linear gain ramps run in audio. Five-millisecond ramps protect continuous gain/curve/mix and boolean transitions. Attack/release coefficient updates preserve the current envelope. Sidechain filter coefficients update at block boundaries; rapid cutoff automation during Listen SC still needs listening validation.
+
+Signal flow: input trim → detector tap → optional detector HP/LP → Peak/RMS blend → channel linking → soft-knee static reduction → attack/hold/release envelope → gain application → parallel mix → SC listen crossfade → bypass crossfade. Dry/wet paths share the same sample index. Bypass returns original input after its short transition. Non-finite input is replaced with silence; input magnitudes beyond ±32 are bounded for numerical containment.
+
+The three independent zero-added-latency models are Clean (feed-forward), Feedback (causal detector sensing prior actual pre-makeup attenuation), and Smooth (a second attack/release pole cascaded with the first). All modes process one shared audio path; a 5 ms model ramp blends their behavior without triple-rendering. The stable model parameter ID `style` is appended to the schema. Existing hosts using the original parameter IDs preserve them. These models are original algorithms, not claimed clones of proprietary compression styles.
+
+GUI reference-layout milestone (historical composition target; current dimensions and controls below): one large integrated graph in the upper panel combines a real transfer curve (red glowing line and soft fade), measured 4-second input/output and gain-reduction traces, input stereo LED bars on the left, GR and output stereo bars on the right. Main hardware row: Input, Attack, Release, oversized Threshold, Ratio, Knee, Makeup; bottom strip: Range, Hold, Mix, Link, SC HP/LP, Peak/RMS, AutoRelease, External SC and Listen SC. Header: model, preset, FILE (Save/Open), A/B, bypass and MINI. The supplied mockup dictates composition; UI artwork and code are original JUCE vector rendering. The transfer graph uses input dB horizontally while history is time-based, deliberately independent overlaid information layers. All data traces are measured. No fictional Lookahead knob: zero added algorithmic sample latency is mandatory. The current integrated display is 780×640 default, 740×585 minimum, and 330px-high MINI. One cached background rebuilds on resize, the transfer path is cached by threshold/ratio/knee/range/graph width, and the metering draws at 30 Hz on the message thread only; audio never touches GUI. The 100 Hz MeterFrame has independent input/output L/R peaks; side bars are not duplicated aggregate maxima.
+
+RMS detector uses a 10 ms exponential energy estimate. Attack/release are 63.2% time constants in the dB reduction domain. Auto release blends base and 4× slower release coefficients according to existing reduction. This is an explicit independent design, not a recreation of FabFilter's undisclosed program-dependent models. The first-order detector HP/LP are bypassed at 20 Hz / 20 kHz endpoints. Stereo linking blends each detector toward the maximum channel level.
+
+## Data exchange
+
+A fixed 512-slot SPSC queue transfers 10 ms maxima (input, output, reduction, individual input/output L/R peaks). Acquire/release publication protects non-atomic slots; read/write indices occupy distinct cache lines. Audio drops frames if full. There is exactly one editor consumer. Editor drains at most 512 frames per 30 Hz tick, updates its fixed 400-frame history and coalesces meter repaint. The editor also supports an original compact hardware-inspired layout (380 px tall, no graph allocations) and direct transfer-marker threshold gestures with one `beginChangeGesture`/`endChangeGesture` pair per drag; teardown ends any unfinished gesture. Reopening discards a bounded stale backlog. Static display grid is rebuilt on resize, not on audio or every timer tick.
+
+APVTS parameter atomics are independent, so bulk preset/state changes can be observed across adjacent audio blocks; five-millisecond ramps limit transition artifacts. They are not claimed to be a transactional sample-accurate preset switch. Host automation is block-rate in this implementation. State XML serialization is outside processBlock. Schema 1 rejects unknown root/schema and restores finite, clamped known values.
+
+RAII owns GUI attachments and buffers. Timer is stopped before editor teardown. No process-global mutable DSP state. Audio never accesses editor objects. Memory use does not grow with session duration.
+
+## Reference decisions
+
+- FabFilter Pro-C 3 help (2026): https://www.fabfilter.com/help/pro-c — reference for model differentiation, large level/transfer metering, compact controls, and live audio workflow. Official detailed UI evidence: https://www.fabfilter.com/help/pro-c/using/displays and https://www.fabfilter.com/help/pro-c/using/overview . Latency design: https://www.fabfilter.com/help/pro-c/using/oversampling (zero-latency requires lookahead and oversampling Off). Original UI design and independent compressor models are mandatory. No FabFilter assets, algorithms or branding are used. Lookahead/oversampling are intentionally absent from the live zero-latency path.
+- JUCE APVTS documentation: https://docs.juce.com/master/classjuce_1_1AudioProcessorValueTreeState.html — raw atomic parameter reads and state/attachment separation.
+- JUCE source pinned at 8.0.12: https://github.com/juce-framework/JUCE/tree/29396c22c93392d6738e021b83196283d6e4d850 — build reproducibility, not an assertion this is the newest release.
+
+## Deferred, not represented as working
+
+Pro-C-specific styles, mid/side compression, frequency-dependent linking, auto makeup, lookahead/offline quality mode, oversampling, scalable vector accessibility polish, user preset files, ASIO standalone integration and measured proprietary sound matching. Future modes must declare latency and pass block/automation tests separately.
+
+## Focused-layout / animation CPU milestone
+
+GUI target: **900x765 default; 860x700 min; 380px MINI**, instead of 1120x760. Header reserves safe widths for logo, MINI, model, preset, SAVE, OPEN, A/B and bypass. Main row contains exactly 7 knobs with larger Threshold. Secondary row computes 6 bounded strips plus fixed right-side space for detector and three shortened flags; labels keep full descriptions in dark custom JUCE tooltips. Geometric overlap and bounds are asserted by plugin smoke at default/min sizes, including MINI/FULL restoration.
+
+GUI drawing pipeline: `resized` caches graph background and regenerates path geometry for the new size; `timerCallback` drains SPSC 100 Hz samples once then computes time-compensated meter display easing (18ms rise/210ms fall, 22ms GR rise/185ms fall); when new frames arrive, it computes and reuses four 400-point paths for the time history with lightweight visual one-pole smoothing. `drawDisplay` only strokes existing time paths, cached transfer curve and segmented LED meters at 30 Hz, with dirty-region repaint. This removes repeated per-paint conversion/path-building for ~1200 dB point calculations. All smoothing affects presentation alone; DSP has unchanged zero added algorithmic samples. If editor is hidden, timer skips heavy visualization updates; reopening drains and paints the bounded queue.
+
+## Edge-fade brush cache and meter rails
+
+`plugin/GraphPaint.h` keeps a single composable, GUI-only four-stop horizontal colour gradient helper and reusable meter-rail painting function. The colour stops at x=0 (0% opacity), 13.5% (full), 86.5% (full) and x=100% (0%) apply to live IN / OUT / GR strokes, without a postprocessing blur or offscreen layer. Transfer law keeps ~18% edge brightness to remain visually recognizable at the graph boundaries. The actual centre segment is unchanged and continues to display measured telemetry. Dither/traces are not fabricated.
+
+`Editor::resized` caches six gradients and the 46-segment dark LED rails into the existing graph background, then `drawDisplay` only composites the cached paths using gradient strokes and draws active segments on top. This eliminates ~5×46 inactive-rectangle paints per 30Hz GUI frame and avoids allocating new gradient stop arrays on every paint. The waveform paths are rebuilt only on new telemetry/resize; gain reduction and static transfer DSP logic are untouched. All objects remain message-thread-owned.
+
+## Brushed metal / progressive disclosure milestone
+
+Knob implementation is original software vector art derived from the supplied photo's form language. `CompLook::knobFace` caches one ARGB face for each of the two primary sizes, including a beveled outer lip, recessed black ring and 72 concentric alpha micro-strokes as a faint machined grain; cache refresh occurs only when the dial diameter changes. `drawRotarySlider` uses a cheap cached `drawImageAt`, a two-pass active coral arc on the dark groove and a calibrated center needle. No hundreds of circles per timer tick and no image decoding. `CompLook` and the cache are UI-owned; DSP is untouched.
+
+Progressive-disclosure controls preserve all original host parameter IDs and APVTS attachments. Header FILE opens an asynchronous PopupMenu whose Save/Open options trigger the previously implemented async file dialogs without displaying separate permanent buttons. The bottom DYNAMICS/SIDECHAIN switch changes only Component visibility, not the parameter tree, routing, or audio topology. Main view: Range, Hold, Mix, Link, Auto Release. Sidechain view: detector HP/LP, Peak/RMS, External SC, Listen SC. Both pages render inside a 126px reserved footer at 900x765 default, 860x700 minimum, and 380px MINI, preserving the central graph and sidebar LEDs. CI checks bounds and state transitions.
+
+Maintainability: one `syncPanelVisibility()` is the only source of truth for secondary control visibility and tab emphasis. Text shortcuts hide lengthy captions behind existing premium tooltips. Widgets in hidden pages remain alive and host-automatable. The real-time engine still has zero added algorithmic sample latency.
+
+## Integrated black radial-knob resource
+
+`assets/black_brushed_knob.jpg` is the compact 96×96 compressed build-time image source derived from the user's supplied silver image, recolored to deep gunmetal. The asset has realistic specular radial brush-work; it replaces simulated 72-circle procedural grain. `juce_add_binary_data(ArSonCompKnobAssets)` turns it into compile-time resources used by the VST3, Standalone and GUI smoke tests. `CompLook::CompLook` loads JPEG from `BinaryData` one time on the message thread; `knobFace` composites a round-cropped ARGB tile at the standard/Threshold sizes and caches both. The dynamic coral arc and value marker stay overlay vector geometry. Binary resource checks prevent an empty knob when host paths differ. No changes to DSP, parameter IDs, allocation in audio callbacks or added latency.
+
+## Real host routing and stale-graph lifecycle
+
+`plugin_smoke` now configures JUCE's actual main stereo + mono Sidechain buses and calls `Processor::processBlock()` at 32, 64 and 128 frames, with a known one-second detector signal. Assert expected compression, independent stereo scaling, sidechain input buffer intact, internal detector recovery, host bypass transparency after 5ms automation smoothing, and reported zero additional DSP samples. Run a separate mono/no-sidechain bus case. These tests validate JUCE bus offsets rather than only the library-level `Compressor::process` tests.
+
+`plugin/GraphHistory.h` contains one JUCE-free, bounded GUI-ring ageing helper. The editor timestamps the last actual telemetry, then after 150 ms without producer frames advances the history with silent samples at ~100Hz based on UI clock. The helper caps inserts to 400 frames, then stops; actual metering still comes solely through the original SPSC queue. The audio engine and thread never touch history or timestamps.
+
+## Parameter-ring and switch implementation
+
+Painting order is intentional: an ~5px coral dynamic arc and inactive full ring are composed first at a radius outside the cached PNG/JPEG metal dial; the dial image masks the arc's inner boundary naturally, then only a small red position dot at ~79% body radius renders on the face. Radial value never depends on asset texture. Both knob image and 18×40 transparent slider thumb are decoded one time in `CompLook` (message thread). A 11×22 thumb image is composited in `drawLinearSlider` without creating any new image each frame.
+
+JUCE slider text boxes have been removed for both rotary/linear controls. Dynamic values are exposed via `setTooltip` on value updates; native `setPopupDisplayEnabled(true,false,this)` provides bubble values during drag. This removes 13 persistent numeric boxes from the UI, without changing the host parameter model. Custom L&F switches replace checkbox painting while retaining JUCE ToggleButton and APVTS ButtonAttachment semantics. Lower-panel switches show 9px captions beneath centered tracks; header bypass uses an inversion-aware ACTIVE/BYPASS caption.
+
+## Cached industrial materials, layout, and real-time isolation
+
+`plugin/SurfacePaint.h` centralizes message-thread-only material rendering. `paintBrushedChassis()` produces a grey gradient and repeatable 2px-pitch 2D metal lines on the **single** `metalSurface` bitmap when `resized()` runs; its deterministic hashing cannot affect plugin state. `paintInsetGlass()` draws an opaque almost-black LCD, a recessed bevel, and very subtle top specular edge. The full-sized scope and meter rails are painted into the pre-existing cached `grid` image on resize; the MINI meter LCD frame is baked into `metalSurface`. Runtime 30Hz paints reuse these caches and only update telemetry and lit LED segments.
+
+The main control row now reserves **82px of slider height**, down from 105px, while maintaining seven parameter slots and no permanent value boxes. The full LCD gains ~35px height; the footer is ~106px high and its separate 40px linear-slider components retain at least a 26px-deep black shadow channel surrounding the supplied 22px metallic thumb. Switch captions are rendered to the left of the native ToggleButton-powered capsule tracks, including inverted BYPASS/ACTIVE semantics. Screen metal text remains readable; current dark-mode popup/combobox colors are retained. No shader, blur, worker, audio-thread graphics or DSP modifications.
+
+## Layered gunmetal fader implementation
+
+New binary assets `gunmetal_slider_track.png` (340×57, RGBA) and `gunmetal_slider_thumb_red.png` (58×124, RGBA) are bundled through the existing `juce_add_binary_data(ArSonCompKnobAssets)`. `CompLook` decodes them once on GUI construction. Every JUCE horizontal slider draw uses the same 3-layer compositing sequence:
+1. Stationary gunmetal plate: three source rectangles (37px caps + stretchable centre), fixed 18px rendered endcaps. This preserves plate curvature across 130–170px slider widths without rasterizing/storing a new background for each value.
+2. Value-dependent LED: a small clipped 8px-high slot, with dim outer red, inner bright coral-red and subtle 1.4px highlight. Clamp both LED end and thumb centre to identical limits (x+21..x+w-21). LED is **zero length at minimum** and visibly full at maximum.
+3. Thumb photo in the foreground: 18×37px overlay aligned to slider centre. The red vertical aperture is part of the original approved glowing-thumb image.
+
+All dynamic painting occurs on JUCE GUI thread only. No image decode, texture modification, heap allocation, image cache invalidation, mutex, GPU shader, or engine DSP change per slider motion. Smoke tests check both resources, alpha transparency, visually red level at maximum versus minimum, and pixel-difference from moving photographic thumb.
+
+## Current GUI ownership and rendering contract — reconciliation 2026-10-31
+
+The latest compiled GUI uses 780×640 default, 740×585 minimum, and MINI 330 px high. The `CompLook` object decodes fixed gunmetal slider rail/thumb PNGs, the black rotary-knob JPEG and the matched ON/OFF toggle PNGs as GUI resources. Material backgrounds, black LCD graph and meter rails are cached on resize. Linear slider paint draws stationary metal endcaps/centre, clips the coral-red fill inside its recess, then draws the movable front thumb. ON/OFF asset outer frames are equal size; the Bypass visual meaning is inverted relative to the checkbox parameter (ACTIVE versus BYPASS).
+
+The obsolete JUCE value popup and `TooltipWindow` have been removed. One `view.value.readout` label below the main graph (MINI: right footer) updates from hover/drag and APVTS-backed value notifications, displaying the last selected parameter name, value and unit. This is GUI only: all existing parameter IDs and audio processing remain unchanged. SIDECHAIN filter, detector and toggle control positions are calculated from the editor width rather than fixed x coordinates.
+
+Actual Windows GUI screenshots and CTest passed for code revision `7b340eb2` in [CI #41202549812](https://github.com/masarray/arson-comp/actions/runs/41202549812). Physical host validation remains a separate release gate.
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
new file mode 100644
index 0000000..503cd5f
--- /dev/null
+++ b/docs/HANDOFF.md
@@ -0,0 +1,74 @@
+# Handoff
+
+## Current engineering baseline — reconciled 2026-10-31
+
+- **Source gate:** 34 commits on PR #1, last code-tested SHA `7b340eb2ee5740df13b52b5bfcf984a3b66d0dd3`. Windows VST3/Standalone build, CTest and Linux engine-safety **PASS** in [Actions #41202549812](https://github.com/masarray/arson-comp/actions/runs/41202549812). Windows artifact [#13043510391](https://github.com/masarray/arson-comp/actions/runs/41202549812/artifacts/13043510391) includes four actual editor screenshots.
+- **Current UI, not old mockup:** default 780×640, min 740×585, MINI 330px; black glass LCD, brushed grey chassis; separate gunmetal slider track/overlay thumb + red rail level, matched red/green toggle PNG pair, photo-metal knobs and animated stereo IN/GR/OUT.
+- **Hover/readout:** tooltip popups removed. Knob or slider hover/drag updates a small stationary readout on the bottom of the main LCD, MINI footer on right; host parameter IDs unchanged. Sidechain panel is responsive.
+- **Merge meaning:** merge into `main` records an engineering test baseline; it does **not** declare a shipping release. Preserve evidence in docs/VALIDATION.md and do not claim real device ASIO, pluginval or Pro-C parity.
+- **Next significant milestone:** physical Windows host/standalone acceptance on audio interface; load VST3 in at least two hosts, verify 32/64/128 buffers and mono/stereo external SC, bypass, preset/project recall, automation, MINI/FULL, readout hover, 150% DPI and sustained multiple instances; capture audible/CPU/latency results, then evaluate matched reference listening.
+
+### Historical milestone log follows (earlier sizes/popups/CI states are superseded)
+
+
+Start with README, AGENTS, PRD, ARD and VALIDATION. Source of truth is the canonical parameter table, not UI strings. The current milestone delivers a complete first compressor path and UI with explicit release gates; it is not the final parity milestone.
+
+1. This milestone adds three distinct causal models (Clean feed-forward, Feedback, Smooth dual-pole) and a redesigned meter/transfer-centric GUI, without adding samples of latency. Next batch optimizes unchanged host snapshots and Peak RMS meter CPU, adds direct transfer-marker threshold editing with one automation gesture and a fully reflowed 380 px vintage compact GUI. Smoke screenshots now cover default, minimum and compact sizes; visually inspect all three in Windows artifacts. Confirm the new CI artifact and visually inspect minimum/default-size GUI PNGs. Review labels, overlap and readability in real Windows scaling.
+2. Run pluginval and two-host Windows tests (including ArSonMiX when available). Capture automation, sidechain and project-reload behavior.
+3. Filter cutoff/endpoint activation and internal/external detector source now crossfade for 5 ms with regression probes; confirm perceptual quality in a host. Listen and measure release/hold transitions, bypass clicks and low-frequency distortion. Add regression cases for actual findings.
+4. Profile with GUI open/closed and many instances at 32/64/128 samples. Optimize only measured hotspots.
+5. Work toward Pro-C workflow/quality with documented independent models; never add fake style labels mapped to indistinguishable algorithms.
+
+The next batch addresses fast real-world testing: a single Windows artifact rooted at Plugin/, Standalone/, Screenshots/, plus SHA256 checksums and a quickstart; SAVE/OPEN provides versioned portable preset XML outside the audio callback, with automated roundtrip testing. MINI meter labels are separated from bars for readability. Verify the new UI Windows artifact before promoting the build.
+
+Keep builds grouped: one relevant-PR workflow with Linux safety and one Windows artifact. No gratuitous matrix or repeated manual runs.
+
+## Current priority: reference visual fidelity + previous build regression
+
+The supplied red ArSonComp mockup is now the acceptance layout for a full-width integrated transfer/compression graph, side LED meters with true stereo peaks, animated actual GR, red dissolving fill, dominant Threshold knob, and two-row compact controls. Preserve no-lookahead live mode. IMPORTANT: CI for f847fa6 failed because PresetIO.h incorrectly called juce namespace functions getXmlFromBinary/copyXmlToBinary. Correct public API is juce::AudioProcessor::getXmlFromBinary/copyXmlToBinary. Validate Windows compile and the three screenshot variants before claiming milestone completed. Keep one grouped commit/CI and retain Draft until real verification.
+
+## Focused-layout milestone handoff
+
+The full reference GUI in commit f63e8c6 passed Windows/Linux CI, but user feedback on actual screenshot showed it was too wide and secondary controls were crowded. The new grouped follow-up moves to 900x765 default (860x700 minimum), shortens secondary labels with tooltip help, reflows all header/buttons/slider regions and adds smoke collision bounds tests. It also caches 400-point signal/GR Path objects between actual telemetry updates and applies UI-only time-based meter easing. Do not move easing onto the audio callback or add Lookahead. Review default/minimum/MINI Windows screenshots before release; host/pluginval/real device tests remain outstanding.
+
+## Edge dissolve and physical-test handoff
+
+The latest grouped GUI milestone applies symmetric horizontal transparency fades to input/output/GR history and keeps the transfer curve readable with a lower-opacity edge; cache the six gradient brushes and meter rails on resize. The new `GraphPaint.h` helper is GUI-only; numerical and ARGB rasterizer smoke asserts actual fades. Meter-active segments are rendered at 30Hz over pre-rendered inactive rails; do not recreate LED background rectangles every frame. There must be **no** DSP engine changes or new audio-thread visual work.
+
+Build and visually inspect 900x765 default, 860x700 minimum and MINI 380 screenshots in the Windows Actions artifact before distributing. Verify live rendering on the user's real Windows host/ASIO interface and DAW/ArSonMiX, check visual motion and actual CPU usage, channel independence, host automation, and session reopen. Running an editor smoke in CI does not replace a physical-device validation.
+
+## Hardware knob and progressive disclosure handoff
+
+The user supplied a concentric brushed-metal/black-groove rotary-knob image with a green indicator sector and asked for matching physical feel in the existing coral ArSonComp palette. Implementation: UI-only immutable face cache (regular + larger Threshold), concentric machined microtexture generated on size change, subtle metal rim and black inset ring, coral active groove and understated needle. Do **not** use the supplied source image as a runtime asset or perform high-cost graphics inside DSP callbacks.
+
+To address overcrowding, SAVE/OPEN are moved behind FILE (same async dialogs), header retains Model/Preset/A-B/Bypass/MINI; lower strip uses DYNAMICS vs SIDECHAIN views with all APVTS attachments still alive. Default DYNAMICS displays Range/Hold/Mix/Link/AUTO; SIDECHAIN displays HP/LP, Peak/RMS, External SC and Listen SC. Switching is UI-only. A new CI screenshot `ArSonComp-preview-sidechain.png` is captured at minimum size. Existing default/minimum/MINI screenshots persist. Inspect screenshots, verify text boxes and knobs align with labels, and no tab controls overlap. Validate in VST3/Standalone host, not solely GUI smoke.
+
+One grouped commit should produce one Linux/Windows CI run; keep PR draft until new CI and real device validation.
+
+## Black-metal photographic asset handoff
+
+The latest requested user image is a lighter silver radial-brushed-metal dial. A black/gunmetal reinterpretation was generated, and a compact 96×96 RGB JPEG is now included under `assets/black_brushed_knob.jpg` for efficient JUCE BinaryData inclusion. Compared with the prior vector-only knob, this keeps real radial studio-light reflection, fitted to the user's image. The knob JPEG is decoded once on the GUI thread, circular-clipped and cached at actual UI sizes; no image work leaks into the audio callback. The large original transparent PNG can be distributed as a design master separately. Test Windows screenshots at 900×765 and 860×700, verify the black metal body isn't hidden behind the coral arc, and ensure all dynamics/sidechain and MINI states still function. Do not merge draft before CI and real-device tests.
+
+## Host routing / transport-stop milestone
+
+The previous black-metal image VST3+Standalone build `4e4553e` and its Linux/Windows CI are green, with a verified artifact. Subsequent grouped changes add (1) actual JUCE host-style sidechain/mono/bypass regression at 32/64/128 sample frames; (2) bounded UI-only silent-history ageing so stopping transport clears stale traces rather than freezing them. All DSP math, meter producer, host parameter IDs, and audio callback allocation behavior are left intact. Test Windows screenshots normal/min/MINI/SIDECHAIN plus host bypass/sidechain before claiming hardware readiness. Reference Pro-C 3 for feature/workflow direction, not identical sonic behavior.
+
+## Latest requested premium surface polish
+
+The customer screenshot showed a red ring drawn **on top of** an oversized black-metal knob, a near-center white pointer, cluttered numerical textboxes, checkbox visuals and a misaligned ACTIVE header. One coordinated GUI milestone fixes all together: behind-the-metal enlarged coral arc, small rim-adjacent coral dot, native drag value bubble + dynamically formatted dark tooltip instead of permanent numeric boxes, custom minified toggle tracks with captions below, horizontally aligned header ACTIVE/BYPASS switch and label, and the actual supplied `PAN-SLIDER.png` as the small slider thumb (18×40 source scaled to 11×22).
+
+Do not conflate code completion with physical readiness. The prior `805b7dd` Windows CI failed in `plugin_state_editor` during new host-routing checks (engine-safety passed), so this batch also adds identifiable `HOST_BUS_INTEGRATION_FAILED N` logging and the current branch CI must be green before distributing a new ZIP. Avoid triggering multiple full JUCE builds for aesthetic tweaks; inspect the four actual screenshots and test the toggle interactions, presets, host automation, 32/64/128 frame routing before claiming parity.
+
+## Brushed-metal chassis & glass LCD — UI material milestone
+
+Requested from approved 1536x1024 visual reference: (1) brushed grey metal body; (2) black shiny glass scope; (3) matching black LCD meter panels; (4) recessed shadowed slider gutters as high as the metallic slider thumbs; (5) captions on the **left** of the toggle; (6) tighter knob block.
+
+Implemented as one grouped UI-only milestone, with a dedicated reusable `SurfacePaint.h` and existing `GraphPaint.h` meter rails. Full view uses a **cached** 900x765 brushed chassis and separate cached black display/grid. MINI's black glass meter bezel is cached. Original black knob asset remains; main knob component height drops 105->82. LCD enlarges; footer slides up, slider components shrink to 40px with a 26px recessed well. Native ToggleButton APVTS attachments and caption semantics unchanged.
+
+Check Windows CI smoke (actual JUCE graphics RGB contrast, bound checks, DEFAULT/MINIMUM/MINI/SIDECHAIN screenshots), confirm text legibility against grey steel, inspect graph as true black glass rather than dark grey, and test host sample rates/32–128 buffer/automation. This is visual refinement only, not Pro-C feature or sonic equivalence. Keep PR Draft until physical testing and pluginval.
+
+## Latest gunmetal slider-track + sliding-thumb milestone
+
+User explicitly requested combining the TWO preceding approved graphic assets into one physically convincing JUCE slider: fixed gunmetal horizontal track, independently movable upright thumb over it, and a red LED that tracks the parameter value INSIDE the rail. This is implemented as a **layered control**, not as one static composited picture. The user's earlier glowing thumb image supplies the red vertical slit in the thumb, while the central horizontal groove fills from left to current value dynamically. CMake compiles optimized transparent images into VST3 and Standalone; no external asset path. Integrated smoke verifies both resources, 3 rendered positions, LED off/on and thumb travel. All audio DSP is unchanged.
+
+After CI, inspect actual Windows 900×765, 860×700, MINI, SIDECHAIN screenshots. Toggle back and forth between 0%, 50%, 100% using Range/Mix/Link and HP/LP. Check that the track remains stationary, thumb is foremost, the red LED never spills outside the inset channel, full range and drag area work with mouse and host automation. PR remains Draft until host + physical device tests.
diff --git a/docs/PRD.md b/docs/PRD.md
new file mode 100644
index 0000000..34325e2
--- /dev/null
+++ b/docs/PRD.md
@@ -0,0 +1,26 @@
+# Product requirements
+
+ArSonComp is a lightweight live vocal, karaoke, podcast and mix-bus compressor, delivered as VST3 and standalone. The engine should also be reusable in ArSonMiX without GUI dependencies. Pro-C is the workflow/quality reference, not a basis for asserting sonic identity.
+
+## Initial acceptance
+
+- Mono/stereo host processing, optional mono/stereo external sidechain, zero added sample delay.
+- Useful dynamics controls, bounded range, soft knee, Peak/RMS, stereo link and filtered detector audition. Three genuinely different causal models with retained stable IDs and zero sample lookahead.
+- Dominant transfer/history display; separate IN/GR/OUT meters; compact, legible knobs, premium dark palette and usable model selector. Verify at minimum/default window sizes.
+- Presets with actual parameter values, A/B, host automation and state restoration.
+- No heap allocation/lock/wait in DSP; bounded metering and independent GUI lifetime.
+- DSP correctness tests, allocation guard, sanitizers, measured throughput, plugin state/editor smoke and Windows artifacts.
+
+## Release gate after initial build
+
+Listen with vocals, music, transients and low-frequency tones. Compare loudness-matched Pro-C references at identical settings, documenting differences. Verify in at least two Windows VST3 hosts, including external sidechain, bypass automation, save/reload, 32/64/128 sample buffers and editor close/reopen. Run pluginval, long-duration stress, and physical-device latency/dropout measurements. No statement of full Pro-C parity or production readiness before these gates.
+
+## Benchmark reference alignment — Pro-C 3, October 2026
+
+The current publicly documented FabFilter Pro-C 3 has 14 styles, optional analog Character, multiple-band detector EQ, Auto Threshold/Gain, surround and optional lookahead/oversampling (see https://www.fabfilter.com/help/pro-c). ArSonComp **does not claim parity** with these features: its three causal models, one-pole HP/LP detector filters and zero-added-sample live path are currently deliberate smaller-scope choices. Prioritize host routing/state/bypass reliability and matched listening before adding analog color or additional topologies. Avoid retrofitting lookahead/oversampling into the zero-latency default; an optional latency-incurring mode would require explicit host compensation and separate acceptance.
+
+## Milestone reconciliation — 2026-10-31
+
+The initial implementation acceptance is **met in automated testing** at code commit `7b340eb2`: C++17 causal DSP with zero added algorithmic samples, Windows VST3/Standalone packaging, APVTS state/preset/automation paths, external sidechain and bypass regressions, both Linux/Windows CI jobs green, and actual Windows GUI screenshots. The compact editor now defaults to **780×640** (minimum **740×585**, MINI height **330**). Hardware-style metal toggle/slider assets and black-glass LCD remain; control values are read from a **single footer label**, not floating popup/tooltip overlays.
+
+**Acceptance deliberately incomplete for production:** pluginval, two independent host applications, a real audio interface, long-session CPU/dropout measurement, 32/64/128 sample buffer tests, host project restore and sidechain automation in the field, DPI scaling, and reference listening. Merging code into `main` establishes a testable engineering baseline only, not a public production release or FabFilter parity.
diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md
new file mode 100644
index 0000000..584552b
--- /dev/null
+++ b/docs/VALIDATION.md
@@ -0,0 +1,93 @@
+# Validation record
+
+> **Latest verified baseline (2026-10-31):** Both Windows build/editor-smoke/benchmark/artifact and Linux engine-safety passed for source commit `7b340eb2ee5740df13b52b5bfcf984a3b66d0dd3`, [Actions #41202549812](https://github.com/masarray/arson-comp/actions/runs/41202549812). The Windows artifact includes full 780×640, minimum 740×585, sidechain 740×585, and MINI 780×330 actual JUCE screenshots. Static layout/asset/value-readout tests passed. Older pending-CI descriptions below are historical milestones, **not** the latest result. Real DAW/device/pluginval tests remain pending.\n
+
+Initial implementation, 2026-10-31.
+
+Local GCC 13.3 Release engine tests pass: static ratio and knee curves, monotonicity/continuity/range, attack time constants at 44.1/48/96/192 kHz, release time constant, hold duration and adaptive recovery, steady reduction, zero-delay unity impulse, bypass and dry transparency, arbitrary-block partition equivalence, external mono sidechain to stereo, linked/unlinked channels, disconnected sidechain, non-finite containment, zero allocations over 10,000 parameter-update/process blocks, bounded queue saturation and 100,000-frame threaded SPSC order.
+
+ASan/UBSan engine run passes with `ASAN_OPTIONS=detect_leaks=0`. LeakSanitizer cannot enumerate `/proc/.../task` in this local execution environment; full leak checking passed in the Linux CI job. It is not reported as locally passed.
+
+Local Release throughput example: ~94.9 ns/stereo frame (~0.456% of one 48 kHz real-time core budget), RMS + auto release + high-pass sidechain, 128-sample blocks, sustained sinusoidal input. This is a shared-environment microbenchmark, not a worst-case deadline guarantee, a Windows result or a comparison against Pro-C. Re-run `engine_bench` on the target machine.
+
+Windows MSVC Release VST3 and standalone compilation and engine tests passed in CI run 41132714813. The GUI-smoke script used an incorrect executable name; the correction registers the executable as a CTest target, avoiding hard-coded paths.
+
+Pending until evidence is recorded: editor lifecycle/state test and visual inspection, Windows host/pluginval/hardware tests, listening comparison, leak-check CI. No tested production-ready or Pro-C sonic-parity claim.
+
+## Control-path and GUI milestone (2026-10-31, pending CI)
+
+Source changes: avoid control-rate exponent evaluations for unchanged APVTS values; skip RMS square root on Peak-only samples without freezing the RMS state; preserve automation smoothing and arbitrary-block equivalence. Additional tests cover repeated no-op snapshots, rapid style/detector/filter/bypass/mix automation with no allocation, valid output, three-style 64-sample host-snapshot benchmarks and exact-sized 1040x680 / 920x620 editor snapshots plus 380px compact capture. The threshold line uses one begin/end host gesture per drag, including early editor teardown. No new DSP latency, worker or audio-thread lock.
+
+Current results must be recorded from the CI run for the commit which introduces this section, not inherited from prior runs. GUI captures are functional smoke evidence only until visually reviewed. Pluginval, long-running host stress, listening and Pro-C 3 comparison still pending. References: https://www.fabfilter.com/help/pro-c/using/overview ; https://www.fabfilter.com/help/pro-c/using/displays ; https://www.fabfilter.com/help/pro-c/using/oversampling .
+
+## Integrated-graph reference milestone (pending CI)
+
+Verify default 1120x760, minimum 960x670 and compact 380px Windows screenshot geometry; confirm accurate dark/red gradients, animated reduction/input/output history on a single canvas, red curved transfer law, dominant Threshold knob, stereo IN L/R and OUT L/R LED meters and GR meter. Engine checks 0.2/0.65 independent stereo input/output peaks and preserved aggregate maximum. Preset smoke must pass after correcting public static AudioProcessor XML helpers. No false lookahead knob, no added DSP samples. Host validation and DPI scaling remain release gates; screenshot smoke alone does not prove sonic parity.
+
+## Focused GUI milestone — acceptance
+
+- Assert 900×765 default, 860×700 minimum, 380px MINI and FULL roundtrip in Windows VST3 editor smoke.
+- Check no collision / no off-window bounds for model+preset+SAVE+OPEN, 7 main controls, 6 secondary controls and detector/AUTO/EXT SC/LISTEN group; verify labels and tooltip visual design.
+- Screenshot visual review: graph aspect and central prominence, legible 6 dB grid, restrained coral dissolving fill, stereo LED meters, large Threshold, full/mini readability.
+- UI 30 Hz timing and 100 Hz bounded queue; time-based meter easing only on GUI; fixed ring history paths reused across paints and recomputed only for new telemetry or resize. Confirm on host with audio that motion is smoother without extra DSP latency.
+- No engine code changed on this milestone; zero added sample contract preserved. Benchmark multiple editors/instances and measure CPU only from real device when available. pluginval / 150% DPI still pending.
+
+## Graph-edge dissolve — required validation
+
+- JUCE `ColourGradient::addColour` four-stop alpha unit test: transparent endpoints, full centre, mirror-like left/right falloffs; transfer retains nonzero edge alpha for readability.
+- Raster test: draw line using real JUCE ARGB `Graphics`, check centre alpha > 0.70 and both edge samples < 35% of centre; no bitmap masks or CPU blur.
+- Assert full/minimum/MINI editor snapshots, preset save/reload, automation ID stability, no overlap and independent stereo metering via existing tests.
+- Static segmented meter rails cached in resized image; repaint draws **only active** segments plus labels/values. Confirm no off-bars ghosting with host running then stopping and resizing.
+- No engine changes: existing Linux sanitizer suite proves zero additional DSP samples, bounded SPSC and no audio-thread allocation. Pending real-device CPU/latency/pluginval and 150% DPI.
+
+## Brushed-metal knob and control-page validation
+
+- Actual Windows screenshot, 900×765 and 860×700: check metallic beveled ring and subtle fine machined concentric grain, coral arc in recessed groove, legible indicator and editable text values. Confirm enlarged Threshold does not collide with Ratio/Release. Ensure no fake skeuomorphic gradients/glows dominate readability.
+- Verify FILE button opens Save/Open actions, .arsoncomp roundtrip remains valid and A/B/bypass remain visible. Hidden SAVE/OPEN controls must not render, but their callbacks remain functional through FILE.
+- Verify default DYNAMICS page shows Range, Hold, Mix, Link and AUTO and hides detector/HP/LP/EXT/LISTEN. Switch to SIDECHAIN and verify complementary visibility plus zero overlap, then restore; repeat at min 860×700 and MINI 380px.
+- CI emits a fourth SIDECHAIN screenshot, additional to default/minimum/MINI; use screenshot review to identify any actual clipping. Knob cache is allocated only on GUI thread, at most once per changed diameter per role; all animation/LED metering remains unchanged.
+- Pro-C-grade DSP parity, pluginval, multi-instance real CPU, host automation reliability and hardware 32/64/128 sample tests remain release gates.
+
+## Live host-signal and transport-stop acceptance
+
+- Windows `plugin_state_editor` now uses JUCE's *real bus layout*: stereo main + mono external sidechain at 32/64/128 frames. Verify after 1 s of main 0.05/0.025 and sidechain 1.0 that output is close to the predicted 15 dB reduction (threshold -20 dB, 4:1 hard knee), side input remains 1.0 and stereo ratio remains 2:1.
+- Toggle external-to-internal with unchanged sidechain bus: signal must recover to 0.05/0.025. Assert host bypass restores unchanged input after smoothing, ignores +12 dB Input/Makeup, and reports zero algorithmic sample latency.
+- Validate mono main, no external SC and 1:1 unity ratio, at 32 samples. No host-bus memory boundary crossing.
+- Engine regression checks UI-only 16-frame ring ageing: 6 frames first, exactly 10 remaining, no more writes after the ring is cleared. Playback must not display frozen GR history after host stops; physical latency/dropout validation is still pending.
+
+## Premium small-control render acceptance
+
+- Windows screenshots show coral value sector visibly **outside/behind** the black-metal dial at top 900×765 and minimum 860×700; dot appears near the face rim and no central white needle remains. Dynamic graph, stereo meters and threshold interaction unchanged.
+- No persistent value boxes on any of the 13 sliders. Hover provides the current numeric value and unit via a dark tooltip; dragging shows JUCE value popup. Double-click reset and APVTS host automation still function.
+- All previous checkbox surfaces must render as compact capsule switches. DYNAMICS AUTO and SIDECHAIN EXT/LISTEN captions sit underneath; header ACTIVE text must not overlap the switch and must change to BYPASS when bypassed.
+- Supplied source `PAN-SLIDER.png` is in `ArSonCompKnobAssets`; smoke asserts it decodes as 18×40 and contains transparent corners plus opaque center. Thumb is 11×22 in render.
+- All prior host bus integration failure branches now emit a numeric `HOST_BUS_INTEGRATION_FAILED` diagnostic. Failures are not suppressed; no claim of new Windows artifact until that test and engine contract both pass.
+
+## Premium black-glass / brushed-metal acceptance
+
+- Two rendered JUCE RGB canvases: brushed-metal brightness must be visibly above LCD black, and both glass and meter rail should remain near-black. Tests sample finished bitmaps **after** Graphics scope to catch Windows deferred rasterization.
+- Main knob controls are exactly 82px high (previously 105px) at both default and minimum size; transfer display gains height. Confirm accessible drag range, pointer dots, larger behind-dial coral arcs and tooltip values unchanged.
+- Full 900x765 and minimum 860x700 screenshot: charcoal-brushed metal chassis with subtle horizontal micrograin; full transfer/dynamics LCD is black glass with thin specular border and black LED IN/GR/OUT wells. The body is not filled with expensive per-frame noise or visual DSP.
+- Secondary sliders: a dark, 26px-deep shadowed inset holds the same original 22px metal thumb. Captions for AUTO, EXT SC, LISTEN and ACTIVE/BYPASS sit to the left of each toggle switch; no overlays or clips in full, compact or sidechain layout.
+- All prior engine_contract and plugin_state_editor regressions remain required. Confirm Windows CI success and actual screenshots; physical host validation remains separate.
+
+## Hardware fader / LED acceptance (2026-10-31)
+
+- Visual: gunmetal plate **stays fixed** while a narrower upright gunmetal thumb rides horizontally ABOVE it. At minimum the horizontal slot is dark; as any slider moves right, a soft coral-red light grows in the slot from its left end to the thumb, with the red thumb slit still visible. At maximum the entire slot behind the thumb is illuminated. Neither glow nor handle should bleed onto the gray brushed-steel chassis outside the plate.
+- GUI 900×765, minimum 860×700, SIDECHAIN 860×700, MINI 900×380: Range/Hold/Mix/Link and HP/LP each render the same plate and moving thumb. No labels/tabs collide.
+- Smoke: independent transparent PNGs must decode via built-in BinaryData at 340×57 / 58×124; actual JUCE L&F slider raster at min/mid/max must show an increase of red channel at x=61 along the groove and measurable pixel-change where the thumb moves. Existing preset, automation, stereo+mono sidechain, host bypass, 32/64/128 samples, sanitizer and zero DSP added latency tests remain mandatory.
+- Host/device latency and Pro-C audio parity are NOT implied by visual CI.
+
+## Reconciled final engineering-test gate — 2026-10-31
+
+| Gate | Evidence | Result |
+| --- | --- | --- |
+| Linux sanitizer/engine-safety | Actions #41202549812, engine-safety job | PASS |
+| Windows VST3/Standalone Release | Actions #41202549812, windows build job | PASS |
+| CTest engine_contract/plugin_state_editor | Same windows job (including 32/64/128 sidechain/host-bypass probes) | PASS |
+| Matched PNG resource decode and deterministic overlay | GUI smoke test plus Windows screenshot pack | PASS |
+| Full/minimum/SIDECHAIN/MINI visible layout | 780×640, 740×585, 740×585, 780×330 screenshots | PASS (static CI checks) |
+| No obstructing tooltip; LCD parameter-value readout | GUI editor state/value update check, `view.value.readout` | PASS (automated) |
+| Real host ASIO/WASAPI, long run, pluginval, Pro-C comparison | No physical test evidence | **PENDING** |
+
+This code is suitable to merge as an **engineering baseline**, not to label as physically validated. Avoid using legacy screenshots at 900×765 or 1120×760 for this milestone. Historical smoke assumptions about 82-px knobs, JUCE popup bubbles, or original slider thumb are superseded by 70-px primary component height, footer readout, and dual-image gunmetal track/thumb.
diff --git a/docs/WINDOWS-QUICKSTART.md b/docs/WINDOWS-QUICKSTART.md
new file mode 100644
index 0000000..00f3584
--- /dev/null
+++ b/docs/WINDOWS-QUICKSTART.md
@@ -0,0 +1,60 @@
+# ArSonComp Windows x64 — start here
+
+**Test build / PR #1 — not a production release.** This artifact is generated from the exact commit recorded in `BUILD-INFO.txt` and is validated by Linux engine tests + Windows build, state/editor smoke and benchmark CI. It has **zero added DSP sample latency**; host buffer, audio interface and driver latency still exist.
+
+## A. Fastest test: standalone
+
+Run `Standalone/ArSonComp.exe`. Select the input/output device in the standalone Audio Settings. For monitoring your microphone, enable your input channels and use a low, stable buffer size appropriate to your device. This build does **not** claim ASIO support; host audio-device options vary.
+
+## B. VST3 test in ArSonMiX or another DAW
+
+1. Copy the **entire** folder `Plugin/ArSonComp.vst3` to `C:\Program Files\Common Files\VST3\` (administrator permission may be needed).
+2. Restart or rescan VST3 in a compatible host.
+3. Insert ArSonComp on a track or bus. Start with ratio 2:1–4:1 and lower Threshold until you see approximately 3–6 dB gain reduction.
+4. Compare Clean, Feedback and Smooth at matched output loudness. Try MINI/FULL, drag the white threshold marker, and use SAVE/OPEN for your own `.arsoncomp` preset.
+5. Verify external sidechain routing only if your host exposes and connects the sidechain bus. Switch Listen SC off before normal use.
+
+## C. Quick test checklist
+
+- Vocal: listen for pumping, sibilance, level consistency and dry/wet behavior.
+- Bass: use low frequencies and aggressive attack to check distortion and filter interactions.
+- Transients: check drums with attack/hold/release; zero lookahead is not a true-peak limiter.
+- UI: switch MINI/FULL; resize to 740x585 and 780x640, then try a larger window. Confirm bottom LCD value readout, labels, metering, and HP/LP controls.
+- Project: save, close, reload; confirm host parameters, style, bypass and input/output routing.
+- For performance, use multiple instances in your host and compare CPU with plugin editors hidden/visible.
+
+## Included evidence
+
+`Screenshots/` has Windows editor smoke captures. `benchmark.txt` is a machine-dependent 48-kHz/64-frame microbenchmark and **not** a DAW dropout guarantee. `SHA256SUMS.txt` contains hashes of the executable plugin payloads.
+
+FabFilter Pro-C is an independent benchmark for workflow/quality only. No FabFilter code, UI asset or proprietary algorithm is included.
+
+### New full-graph GUI acceptance
+
+Check upper central transfer graph, red fading curve and live gain reduction line, left input stereo LED meters, right GR and output stereo LEDs, and enlarged Threshold knob. Check the default/minimum/MINI screenshots from this commit, not a previous ZIP. No lookahead is present in the zero-added-sample live signal path.
+
+### Compact responsive GUI and bottom-of-LCD value display
+
+The editor now defaults to **780×640**, with **740×585** minimum full size and **330px** high MINI. FULL restores the preceding expanded dimensions. The primary rotary row is shorter, Sidechain positions adapt to the editor width, and the actual meter/graph canvas retains useful space.
+
+Hover or drag **any** rotary knob or horizontal slider to show its name, exact value and unit in the **bottom centre of the black LCD**. The last focused value remains visible rather than flashing away. MINI uses the right-hand footer for the readout. There are **no overlay value bubbles or TooltipWindow**, so nothing obscures the controls. Double-click a knob or slider to restore its factory value. The JUCE APVTS host-automation attachments and audio DSP remain unchanged.
+
+### Two-sided dissolve, low-cost LED metering
+
+Use the Standalone EXE or VST3 from the **latest** matching Windows Actions artifact. With audio playing, confirm the red gain-reduction trace and gray input/output traces disappear gradually at **both ends** of the dynamics graph without abrupt vertical cutoffs, while remaining crisp in the middle. The curve marker and compressor settings must still work as before. Confirm meters decay smoothly and their unlit segments are visible at all levels. Graph rendering is GUI-only, with no lookahead or additional algorithmic audio samples. Measure CPU and crackles in your own host/driver at 32/64/128 sample buffers rather than treating CI synthetic numbers as real-device measurements.
+
+### Metal controls and decluttered header
+
+All primary knobs now mimic machined/brushed aluminium with a black recessed channel and a coral (not green) value sector. Hover any knob or slider to see its current value in the LCD footer; double-click to restore the default. Click **FILE** in the header to open Save/Open options for your .arsoncomp user presets; the previous separate SAVE/OPEN buttons are now intentionally removed. Switch the footer between **DYNAMICS** and **SIDECHAIN** for advanced detector filters and monitoring. Switching pages does not change or reset audio parameters. Compare all four screenshots (default, minimum, MINI, SIDECHAIN), then validate physically in Standalone or your VST3 host.
+
+### Live-host readiness checks (new)
+
+Run the supplied Standalone on your audio interface and load the complete VST3 in a DAW or ArSonMiX. Start with 48 kHz and a 128-sample host buffer; repeat at 64 then 32 samples where stable. Route a mono kick/mic into the VST3 external Sidechain bus on a stereo track: when **EXT SC** is selected, a strong detector signal must attenuate the main stereo channels while preserving their balance; switching it off must restore internal detection. Try host Bypass at +12 dB Input and Makeup, preset save/reopen, MINI/full, then stop transport and confirm the last dynamics trace clears rather than freezing. Real driver round-trip latency is separate from the plugin's zero additional algorithmic samples.
+
+### Hardware knob and gunmetal slider controls
+
+All rotary knobs retain their coral sector behind the black brushed-metal face and a small coral pointer dot near the rim. The numerical text boxes are removed. Horizontal Range/Hold/Mix/Link/HP/LP faders render a **stationary gunmetal rail**, coral-red recessed level and a **moving gunmetal thumb in front**. They use the same JUCE parameter controls as before, without changing audio behavior. AUTO/EXT SC/LISTEN and ACTIVE/BYPASS use compact left-caption toggles.
+
+### Premium brushed-metal and glass UI
+
+The updated full editor should now have a horizontally brushed grey metal background and a recessed jet-black LCD for the dynamics history/transfer graph and segmented IN/GR/OUT meters. The knob area is shorter, leaving more room for the screen. Range/Hold/Mix/Link/HP/LP rails have a deep shadowed well sized to the original metallic thumb; all toggle captions appear on the left of their switches, including ACTIVE/BYPASS in the header. Both DYNAMICS and SIDECHAIN pages, MINI, old presets/automation and all audio routes continue working. No plugin audio processing or added algorithmic sample delay has changed.
diff --git a/engine/Compressor.cpp b/engine/Compressor.cpp
new file mode 100644
index 0000000..6b3670c
--- /dev/null
+++ b/engine/Compressor.cpp
@@ -0,0 +1,123 @@
+#include "Compressor.h"
+namespace arson {
+namespace {
+float clean(float x) noexcept { return std::isfinite(x) ? std::clamp(x,-32.0f,32.0f) : 0.0f; }
+float flush(float x) noexcept { return std::abs(x)<1.0e-20f ? 0.0f : x; }
+// Coefficients are calculated on control updates, not in the sample loop.
+// Existing parameter ramps carry the one-pole coefficient for the two filters.
+float rampTarget(std::size_t index,float value,double fs) noexcept {
+ if(index==Input || index==Makeup) return dbToGain(value);
+ if(index==Highpass) return static_cast(std::exp(-6.28318530718*value/fs));
+ if(index==Lowpass) return static_cast(std::exp(-6.28318530718*std::min(value,fs*0.45)/fs));
+ return value;
+}
+}
+void Compressor::prepare(double rate,const Parameters& initial) noexcept {
+ fs=std::isfinite(rate) ? std::clamp(rate,8000.0,384000.0) : 48000;
+ rampLength=std::max(1,static_cast(fs*0.005));
+ meterPeriod=std::max(1,static_cast(fs*0.01));
+ hpState={}; lpState={}; rms={}; envelope={}; smoothEnvelope={}; previousGain={1.0f,1.0f}; holdRemaining={}; meter={}; meterCount=0;
+ rmsCoeff=static_cast(std::exp(-1.0/(0.01*fs)));
+ p=initial; p.sanitize();
+ for(std::size_t i=0;i20.01f ? 1.0f : 0.0f);
+ filterWet[1].reset(p[Lowpass]<19999.0f ? 1.0f : 0.0f);
+ attackCoeff=static_cast(std::exp(-1000.0/(p[Attack]*fs)));
+ releaseCoeff=static_cast(std::exp(-1000.0/(p[Release]*fs)));
+ slowReleaseCoeff=static_cast(std::exp(-1000.0/(p[Release]*4.0*fs)));
+ holdSamples=static_cast(p[Hold]*0.001*fs);
+}
+void Compressor::setParameters(Parameters next) noexcept {
+ next.sanitize();
+ if(next[Attack]!=p[Attack]) attackCoeff=static_cast(std::exp(-1000.0/(next[Attack]*fs)));
+ if(next[Release]!=p[Release]) {
+ releaseCoeff=static_cast(std::exp(-1000.0/(next[Release]*fs)));
+ slowReleaseCoeff=static_cast(std::exp(-1000.0/(next[Release]*4.0*fs)));
+ }
+ // Host snapshots arrive every audio block, usually without parameter
+ // changes. Coalesce all target calculations; avoid exp() when idle.
+ if(next[Hold]!=p[Hold]) holdSamples=static_cast(next[Hold]*0.001*fs);
+ for(std::size_t i=0;i20.01f ? 1.0f : 0.0f,rampLength);
+ if(next[Lowpass]!=p[Lowpass])
+ filterWet[1].set(next[Lowpass]<19999.0f ? 1.0f : 0.0f,rampLength);
+ p=next;
+}
+void Compressor::process(float* const* audio,int channels,int samples,const float* const* sc,int scChannels,MeterQueue* meters) noexcept {
+ if(!audio || channels<1 || channels>2 || samples<=0) return;
+ for(int n=0;n v{};
+ for(std::size_t i=0;i0) ? clean(sc[std::min(c,scChannels-1)][n]) : 0.0f;
+ const float internal=dry[c]*(1.0f-feedbackWeight*(1.0f-previousGain[c]));
+ float x=internal+(side-internal)*v[External];
+ hpState[c]=flush(hpCoeff*hpState[c]+(1-hpCoeff)*x);
+ x-=hpWet*hpState[c];
+ lpState[c]=flush(lpCoeff*lpState[c]+(1-lpCoeff)*x);
+ x+=(lpState[c]-x)*lpWet;
+ listen[c]=x;
+ rms[c]=flush(rmsCoeff*rms[c]+(1-rmsCoeff)*x*x);
+ // Crossfade detector modes to avoid a discontinuity on automation.
+ const float absLevel=std::abs(x);
+ const float rmsMix=v[Detector];
+ // Maintain RMS state when inactive for click-free detector
+ // switching, but skip sqrt() for the common Peak-only mode.
+ detected[c]=rmsMix<=0.0f ? absLevel
+ : absLevel+(std::sqrt(rms[c])-absLevel)*rmsMix;
+ }
+ const float linked=std::max(detected[0],detected[channels-1]);
+ for(int c=0;cenv) { env=target+attackCoeff*(env-target); holdRemaining[c]=holdSamples; }
+ else if(holdRemaining[c]>0) --holdRemaining[c];
+ else {
+ const float adaptive=std::clamp(env/24.0f,0.0f,1.0f)*v[AutoRelease];
+ const float coeff=releaseCoeff+(slowReleaseCoeff-releaseCoeff)*adaptive;
+ env=target+coeff*(env-target);
+ }
+ env=flush(env);
+ // Distinct cascaded reduction pole, active only in Smooth mode.
+ if(smoothWeight>0.0f) {
+ const float coeff=env>smoothEnvelope[c] ? attackCoeff : releaseCoeff;
+ smoothEnvelope[c]=flush(env+coeff*(smoothEnvelope[c]-env));
+ } else smoothEnvelope[c]=env;
+ const float effectiveEnv=env+(smoothEnvelope[c]-env)*smoothWeight;
+ const float attenuation=dbToGain(-effectiveEnv);
+ previousGain[c]=attenuation;
+ const float wet=dry[c]*attenuation*makeupGain;
+ float out=dry[c]+(wet-dry[c])*(v[Mix]*0.01f);
+ out+=(listen[c]-out)*v[Listen];
+ out=v[Bypass]>=1.0f ? original[c] : out+(original[c]-out)*v[Bypass];
+ audio[c][n]=out;
+ const float inPeak=std::abs(dry[c]),outPeak=std::abs(out);
+ meter.channels=channels;
+ meter.inputChannel[static_cast(c)]=
+ std::max(meter.inputChannel[static_cast(c)],inPeak);
+ meter.outputChannel[static_cast(c)]=
+ std::max(meter.outputChannel[static_cast(c)],outPeak);
+ meter.input=std::max(meter.input,inPeak);
+ meter.output=std::max(meter.output,outPeak);
+ meter.reduction=std::max(meter.reduction,effectiveEnv*(1-v[Bypass]));
+ }
+ if(++meterCount>=meterPeriod) {
+ if(meters) meters->push(meter);
+ meter={}; meterCount=0;
+ }
+ }
+}
+}
diff --git a/engine/Compressor.h b/engine/Compressor.h
new file mode 100644
index 0000000..004b2cd
--- /dev/null
+++ b/engine/Compressor.h
@@ -0,0 +1,35 @@
+#pragma once
+#include "Parameters.h"
+#include "MeterQueue.h"
+namespace arson {
+// Framework-free, audio-thread-owned state. Planar mono/stereo, arbitrary block size.
+class Compressor {
+public:
+ void prepare(double sampleRate, const Parameters& initial=Parameters{}) noexcept;
+ void setParameters(Parameters parameters) noexcept;
+ void process(float* const* audio, int channels, int samples,
+ const float* const* sidechain=nullptr, int sidechainChannels=0,
+ MeterQueue* meters=nullptr) noexcept;
+ static constexpr int latencySamples() noexcept { return 0; }
+private:
+ struct Ramp {
+ float current=0,target=0,step=0; int remaining=0;
+ void reset(float x) noexcept { current=target=x; remaining=0; step=0; }
+ void set(float x,int length) noexcept {
+ if(x==target) return;
+ target=x; remaining=length; step=(target-current)/static_cast(length);
+ }
+ float next() noexcept { if(remaining>0 && --remaining==0) current=target; else if(remaining>0) current+=step; return current; }
+ };
+ Parameters p;
+ std::array smooth{};
+ // Filter on/off is blended separately from cutoff coefficients to avoid endpoint steps.
+ std::array filterWet{};
+ std::array hpState{}, lpState{}, rms{}, envelope{}, smoothEnvelope{}, previousGain{1.0f,1.0f};
+ std::array holdRemaining{};
+ double fs=48000;
+ float attackCoeff=0,releaseCoeff=0,slowReleaseCoeff=0,rmsCoeff=0;
+ int rampLength=240, meterPeriod=480, meterCount=0,holdSamples=0;
+ MeterFrame meter{};
+};
+}
diff --git a/engine/MeterQueue.h b/engine/MeterQueue.h
new file mode 100644
index 0000000..9a44a5d
--- /dev/null
+++ b/engine/MeterQueue.h
@@ -0,0 +1,33 @@
+#pragma once
+#include
+#include
+#include
+namespace arson {
+struct MeterFrame {
+ // One producer, one consumer. Stereo peaks are actual per-channel
+ // values, not two duplicated bars derived from a mono maximum.
+ float input=0, output=0, reduction=0;
+ std::array inputChannel{}, outputChannel{};
+ int channels=1;
+};
+// One audio producer, one editor consumer. Full queue drops visualization only.
+class MeterQueue {
+public:
+ static_assert(std::atomic::is_always_lock_free);
+ bool push(MeterFrame frame) noexcept {
+ const auto w=write.load(std::memory_order_relaxed), next=(w+1)%capacity;
+ if (next==read.load(std::memory_order_acquire)) return false;
+ frames[w]=frame; write.store(next,std::memory_order_release); return true;
+ }
+ bool pop(MeterFrame& frame) noexcept {
+ const auto r=read.load(std::memory_order_relaxed);
+ if (r==write.load(std::memory_order_acquire)) return false;
+ frame=frames[r]; read.store((r+1)%capacity,std::memory_order_release); return true;
+ }
+ static constexpr std::uint32_t capacity=512;
+private:
+ std::array frames{};
+ alignas(64) std::atomic write{0};
+ alignas(64) std::atomic read{0};
+};
+}
diff --git a/engine/Parameters.h b/engine/Parameters.h
new file mode 100644
index 0000000..b67c5fb
--- /dev/null
+++ b/engine/Parameters.h
@@ -0,0 +1,55 @@
+#pragma once
+#include
+#include
+#include
+#include
+
+namespace arson {
+enum Param : std::size_t { Threshold, Ratio, Attack, Release, Knee, Range, Hold,
+ Makeup, Mix, Input, Link, Highpass, Lowpass, Detector, AutoRelease, External, Listen, Bypass, Style, Count };
+struct Spec { const char* id; const char* name; const char* unit; float min, max, initial, skew; };
+inline constexpr std::array specs {{
+ {"threshold", "Threshold", " dB", -60, 0, -18, 1},
+ {"ratio", "Ratio", ":1", 1, 20, 4, 0.45f},
+ {"attack", "Attack", " ms", 0.05f, 250, 10, 0.3f},
+ {"release", "Release", " ms", 10, 2000, 150, 0.35f},
+ {"knee", "Knee", " dB", 0, 48, 6, 1},
+ {"range", "Range", " dB", 0, 60, 36, 1},
+ {"hold", "Hold", " ms", 0, 500, 0, 0.5f},
+ {"makeup", "Makeup", " dB", -24, 24, 0, 1},
+ {"mix", "Mix", " %", 0, 100, 100, 1},
+ {"input", "Input", " dB", -24, 24, 0, 1},
+ {"link", "Stereo link", " %", 0, 100, 100, 1},
+ {"highpass", "SC high-pass", " Hz", 20, 1000, 20, 0.35f},
+ {"lowpass", "SC low-pass", " Hz", 1000, 20000, 20000, 0.4f},
+ {"detector", "Detector", "", 0, 1, 0, 1},
+ {"autoRelease", "Auto release", "", 0, 1, 0, 1},
+ {"external", "External SC", "", 0, 1, 0, 1},
+ {"listen", "SC listen", "", 0, 1, 0, 1},
+ {"bypass", "Bypass", "", 0, 1, 0, 1},
+ {"style", "Compression model", "", 0, 2, 0, 1}
+}};
+struct Parameters {
+ std::array value{};
+ Parameters() noexcept { for (std::size_t i=0; i=Detector) v=std::round(v);
+ }
+ }
+};
+inline float gainToDb(float gain) noexcept { return 20.0f*std::log10(std::max(gain,1.0e-6f)); }
+inline float dbToGain(float db) noexcept { return std::exp(db*0.1151292546497023f); }
+// Positive gain reduction; C1-continuous at both soft-knee boundaries.
+inline float reduction(float db,float threshold,float ratio,float knee,float range) noexcept {
+ const float x=db-threshold, slope=1.0f-1.0f/ratio;
+ float gr=0;
+ if (knee<=0) gr=std::max(0.0f,x)*slope;
+ else if (x>=knee*0.5f) gr=x*slope;
+ else if (x>-knee*0.5f) { const float t=x+knee*0.5f; gr=slope*t*t/(2*knee); }
+ return std::min(gr,range);
+}
+}
diff --git a/plugin/Editor.cpp b/plugin/Editor.cpp
new file mode 100644
index 0000000..b6b5d5d
--- /dev/null
+++ b/plugin/Editor.cpp
@@ -0,0 +1,998 @@
+#include "Editor.h"
+#include "PresetIO.h"
+#include "GraphPaint.h"
+#include "SurfacePaint.h"
+#include "GraphHistory.h"
+#include "BinaryData.h"
+#include
+#include
+
+namespace {
+const juce::Colour bg{0xff101315}, panel{0xff14191c},
+ line{0xff343c41}, text{0xffe3e6e5}, muted{0xff9ea6a7},
+ accent{0xffdf5860}, accentBright{0xfff4797d}, green{0xff83cfa1},
+ yellow{0xffe9c978};
+
+float clamp01(float x) noexcept { return juce::jlimit(0.0f,1.0f,x); }
+float dbFraction(float x) noexcept { return clamp01((x+60.0f)/60.0f); }
+// Visual ballistics only: no effect on detector, gain or audio latency.
+float approachVisual(float current,float target,double elapsedSeconds,
+ double riseSeconds,double fallSeconds) noexcept {
+ const double tau=target>current ? riseSeconds : fallSeconds;
+ const float alpha=static_cast(1.0-std::exp(-elapsedSeconds/tau));
+ return current+alpha*(target-current);
+}
+float graphY(const juce::Rectangle& p,float db) noexcept {
+ return p.getBottom()-dbFraction(db)*p.getHeight();
+}
+juce::String levelText(float v) {
+ return v<=-100.0f ? juce::String("-inf") : juce::String(v,1);
+}
+}
+
+// All painting belongs to JUCE's message thread. No GUI object or
+// gradient/path/cache construction is reachable from processBlock.
+CompLook::CompLook() {
+ // Decode the single bundled brushed-metal photo on the message thread.
+ // It is never decoded, resized or accessed by the audio callback.
+ sourceFace=juce::ImageFileFormat::loadFrom(
+ BinaryData::black_brushed_knob_jpg,
+ static_cast(BinaryData::black_brushed_knob_jpgSize));
+ jassert(sourceFace.isValid());
+ // Decode state sprites once on the GUI thread, never from processBlock().
+ toggleOn=juce::ImageFileFormat::loadFrom(
+ BinaryData::arson_toggle_on_png,
+ static_cast(BinaryData::arson_toggle_on_pngSize));
+ toggleOff=juce::ImageFileFormat::loadFrom(
+ BinaryData::arson_toggle_off_png,
+ static_cast(BinaryData::arson_toggle_off_pngSize));
+ jassert(toggleOn.isValid() && toggleOff.isValid());
+ jassert(toggleOn.getBounds()==toggleOff.getBounds());
+ // Two light-weight, transparent gunmetal assets are decoded once,
+ // exclusively on the GUI thread; no file I/O or decoding in paint().
+ sliderTrack=juce::ImageFileFormat::loadFrom(
+ BinaryData::gunmetal_slider_track_png,
+ static_cast(BinaryData::gunmetal_slider_track_pngSize));
+ sliderThumb=juce::ImageFileFormat::loadFrom(
+ BinaryData::gunmetal_slider_thumb_red_png,
+ static_cast(BinaryData::gunmetal_slider_thumb_red_pngSize));
+ jassert(sliderTrack.isValid() && sliderThumb.isValid());
+ if(sliderTrack.isValid()) {
+ constexpr int cap=37;
+ const int width=sliderTrack.getWidth(),height=sliderTrack.getHeight();
+ sliderCapLeft=sliderTrack.getClippedImage({0,0,cap,height});
+ sliderCentre=sliderTrack.getClippedImage({cap,0,width-2*cap,height});
+ sliderCapRight=sliderTrack.getClippedImage({width-cap,0,cap,height});
+ }
+ setColour(juce::Slider::textBoxTextColourId,text);
+ setColour(juce::Slider::textBoxBackgroundColourId,juce::Colour{0xff111417});
+ setColour(juce::Slider::textBoxOutlineColourId,juce::Colour{0xff31383e});
+ setColour(juce::ComboBox::backgroundColourId,juce::Colour{0xff181d22});
+ setColour(juce::ComboBox::textColourId,text);
+ setColour(juce::ComboBox::outlineColourId,juce::Colour{0xff374047});
+ setColour(juce::PopupMenu::backgroundColourId,juce::Colour{0xff161b20});
+ setColour(juce::PopupMenu::textColourId,text);
+ setColour(juce::PopupMenu::highlightedBackgroundColourId,juce::Colour{0xff602b32});
+ setColour(juce::TextButton::buttonColourId,juce::Colour{0xff1a1f24});
+ setColour(juce::TextButton::textColourOffId,text);
+ setColour(juce::ToggleButton::textColourId,text);
+ setColour(juce::ToggleButton::tickColourId,accent);
+ setColour(juce::Label::textColourId,muted);
+}
+juce::Label* CompLook::createSliderTextBox(juce::Slider& s) {
+ auto* label=juce::LookAndFeel_V4::createSliderTextBox(s);
+ label->setFont(juce::FontOptions(12.0f));
+ label->setColour(juce::Label::outlineColourId,juce::Colour{0xff323a40});
+ label->setColour(juce::Label::textColourId,text);
+ label->setColour(juce::Label::backgroundColourId,juce::Colour{0xff101419});
+ label->setColour(juce::TextEditor::backgroundColourId,juce::Colour{0xff101419});
+ label->setColour(juce::TextEditor::textColourId,text);
+ label->setColour(juce::TextEditor::outlineColourId,line);
+ label->setColour(juce::TextEditor::focusedOutlineColourId,accent);
+ return label;
+}
+const juce::Image& CompLook::knobFace(int diameter,bool primary) {
+ auto& slot=faces[primary?1:0];
+ if(slot.pixels==diameter && slot.face.isValid())return slot.face;
+ slot.pixels=diameter;
+ slot.face=juce::Image(juce::Image::ARGB,diameter,diameter,true);
+ if(sourceFace.isValid()) {
+ // One-time circular alpha mask + high-quality scale at each dial size.
+ // The compressed JPEG is bundled with the binary; JPEG pixels outside
+ // the circular metal face never appear against the editor background.
+ juce::Graphics g(slot.face);
+ juce::Path circularClip;
+ constexpr float inset=1.25f;
+ const float size=static_cast(diameter)-2.0f*inset;
+ circularClip.addEllipse(inset,inset,size,size);
+ g.reduceClipRegion(circularClip);
+ g.setImageResamplingQuality(juce::Graphics::highResamplingQuality);
+ g.drawImageWithin(sourceFace,0,0,diameter,diameter,
+ juce::RectanglePlacement::stretchToFit);
+ }
+ return slot.face;
+}
+void CompLook::drawRotarySlider(juce::Graphics& g,int x,int y,int w,int h,
+ float pos,float start,float end,juce::Slider& slider) {
+ const bool primary=slider.getName()=="Threshold";
+ const float r=std::max(13.0f,std::min(
+ static_cast(w)*(primary?0.400f:0.385f),
+ static_cast(h)*(primary?0.400f:0.385f)));
+ const int pixels=juce::jmax(28,static_cast(std::ceil(r*2.0f+7.0f)));
+ const float cx=x+w*0.5f,cy=y+h*0.50f;
+ const float angle=start+clamp01(pos)*(end-start);
+ const float bodyRadius=pixels*0.5f;
+ // Draw the level RING FIRST. Its radius is larger than the black metal
+ // photograph, so the dial occludes the inner arc naturally, as a physical
+ // knob would. Nothing gets painted on top of the metal except the dot.
+ const float trackRadius=bodyRadius+2.2f;
+ juce::Path inactive,active;
+ inactive.addCentredArc(cx,cy,trackRadius,trackRadius,0.0f,start,end,true);
+ active.addCentredArc(cx,cy,trackRadius,trackRadius,0.0f,start,angle,true);
+ g.setColour(juce::Colour{0xff42474b}.withAlpha(0.92f));
+ g.strokePath(inactive,juce::PathStrokeType(5.2f,
+ juce::PathStrokeType::curved,juce::PathStrokeType::rounded));
+ g.setColour(accentBright.withAlpha(0.98f));
+ g.strokePath(active,juce::PathStrokeType(primary?5.2f:4.7f,
+ juce::PathStrokeType::curved,juce::PathStrokeType::rounded));
+ // Cached source face never gets recomputed during drag or telemetry paint.
+ const auto& face=knobFace(pixels,primary);
+ g.drawImageAt(face,juce::roundToInt(cx-bodyRadius),
+ juce::roundToInt(cy-bodyRadius));
+ // Red positioning dot at 79% of the actual knob radius, near the rim.
+ // A tiny dark bezel keeps it readable on specular metal highlights.
+ const float dotRadius=bodyRadius*0.79f;
+ const float dx=cx+std::sin(angle)*dotRadius;
+ const float dy=cy-std::cos(angle)*dotRadius;
+ g.setColour(juce::Colour{0xff0a0e11}.withAlpha(0.88f));
+ g.fillEllipse(dx-4.0f,dy-4.0f,8.0f,8.0f);
+ g.setColour(accentBright);
+ g.fillEllipse(dx-2.75f,dy-2.75f,5.5f,5.5f);
+ g.setColour(juce::Colours::white.withAlpha(0.40f));
+ g.fillEllipse(dx-1.25f,dy-1.6f,1.5f,1.5f);
+}
+void CompLook::drawLinearSlider(juce::Graphics& g,int x,int y,int w,int h,
+ float pos,float,float,
+ const juce::Slider::SliderStyle,juce::Slider&) {
+ const float cy=static_cast(y)+static_cast(h)*0.50f;
+ const float plateX=static_cast(x)+2.0f;
+ const float plateW=static_cast(w)-4.0f;
+ constexpr float plateH=30.0f;
+ // Photo plate is stationary. Nine-slice horizontally (3 segments)
+ // preserves realistic endcaps at both the short and 170px SC sliders.
+ if(sliderTrack.isValid()) {
+ constexpr float dstCap=18.0f;
+ const float top=cy-plateH*0.5f;
+ const float midW=juce::jmax(0.0f,plateW-2.0f*dstCap);
+ g.setImageResamplingQuality(juce::Graphics::highResamplingQuality);
+ // JUCE 8's Graphics::drawImage takes a target Rectangle and optional
+ // RectanglePlacement, NOT a source Rectangle. Preclip these three
+ // views once in CompLook constructor, never inside paint().
+ g.drawImage(sliderCapLeft,
+ juce::Rectangle{plateX,top,dstCap,plateH});
+ g.drawImage(sliderCentre,
+ juce::Rectangle{plateX+dstCap,top,midW,plateH});
+ g.drawImage(sliderCapRight,
+ juce::Rectangle{plateX+plateW-dstCap,top,dstCap,plateH});
+ } else {
+ g.setColour(juce::Colour{0xff282d31});
+ g.fillRoundedRectangle(plateX,cy-14.0f,plateW,28.0f,7.0f);
+ }
+
+ // Use the same travel limits for the bright level and moving thumb.
+ // The LED is INSIDE the dark photo slot, not a red slider drawn
+ // over the brushed metal. At minimum it is genuinely extinguished.
+ const float left=static_cast(x)+21.0f;
+ const float right=static_cast(x+w)-21.0f;
+ const float cx=juce::jlimit(left,right,pos);
+ if(cx>left+0.3f) {
+ juce::Graphics::ScopedSaveState scope(g);
+ juce::Path slot;
+ slot.addRoundedRectangle(left,cy-4.0f,right-left,8.0f,3.2f);
+ g.reduceClipRegion(slot);
+ g.setColour(juce::Colour{0xff922731}.withAlpha(0.40f));
+ g.fillRoundedRectangle(left,cy-4.0f,cx-left,8.0f,3.5f);
+ g.setGradientFill(juce::ColourGradient(
+ juce::Colour{0xffff6774}.withAlpha(0.98f),left,cy-2.6f,
+ juce::Colour{0xffa62038}.withAlpha(0.90f),left,cy+3.5f,false));
+ g.fillRoundedRectangle(left,cy-2.8f,cx-left,5.6f,2.8f);
+ g.setColour(juce::Colour{0xffff9197}.withAlpha(0.55f));
+ g.fillRect(left,cy-0.7f,cx-left,1.4f);
+ }
+ // The thumb is the FRONT layer. Only its x position moves with the
+ // JUCE slider value; the chassis, glass and audio thread never move.
+ if(sliderThumb.isValid()) {
+ g.setImageResamplingQuality(juce::Graphics::highResamplingQuality);
+ g.drawImage(sliderThumb,
+ juce::Rectangle{cx-9.0f,cy-18.5f,18.0f,37.0f});
+ } else {
+ g.setColour(juce::Colour{0xffa8afb1});
+ g.fillRoundedRectangle(cx-8.0f,cy-17.0f,16.0f,34.0f,4.0f);
+ }
+}
+void CompLook::drawToggleButton(juce::Graphics& g,juce::ToggleButton& button,
+ bool highlighted,bool down) {
+ const bool bypassControl=button.getButtonText()=="Bypass";
+ // In the DSP, bypass=1 means processing OFF. All other controls use
+ // the natural mapping: parameter=1 means this feature is ON.
+ const bool active=bypassControl?!button.getToggleState():button.getToggleState();
+ constexpr float trackW=56.0f,trackH=23.0f;
+ const float tx=static_cast(button.getWidth())-trackW-4.0f;
+ const float ty=(static_cast(button.getHeight())-trackH)*0.5f;
+ const auto track=juce::Rectangle{tx,ty,trackW,trackH};
+ const auto& sprite=active?toggleOn:toggleOff;
+ if(sprite.isValid()) {
+ g.setImageResamplingQuality(juce::Graphics::highResamplingQuality);
+ g.drawImage(sprite,track);
+ } else {
+ // Keep all four toggles legible even if binary data is missing.
+ g.setColour(active?juce::Colour{0xff4aaf61}:juce::Colour{0xffa83439});
+ g.fillRoundedRectangle(track,trackH*0.5f);
+ }
+ // The sprite already says ON/OFF; the adjacent caption identifies
+ // the affected compressor function without repeating that state.
+ const juce::String caption=bypassControl
+ ? (active?"ACTIVE":"BYPASS") : button.getButtonText();
+ g.setColour(juce::Colour{0xffe3e6e5});
+ g.setFont(juce::FontOptions(9.4f));
+ g.drawText(caption,0,0,juce::jmax(0,static_cast(tx)-5),
+ button.getHeight(),juce::Justification::centredRight,false);
+ if(highlighted||down) {
+ g.setColour(juce::Colours::white.withAlpha(down?0.28f:0.10f));
+ g.drawRoundedRectangle(track.reduced(1.0f),trackH*0.5f,0.7f);
+ }
+}
+Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.snapshot()) {
+ setLookAndFeel(&look);
+ setOpaque(true);
+ const std::array bars{{arson::Range,arson::Hold,arson::Mix,
+ arson::Link,arson::Highpass,arson::Lowpass}};
+ for(std::size_t i=0;i(p.state,spec.id,k);
+ }
+ style.addItemList({"Clean","Feedback","Smooth"},1);
+ style.setComponentID("view.model");
+ addAndMakeVisible(style);
+ styleAttachment=std::make_unique(
+ p.state,"style",style);
+ presets.addItemList({"Default","Vocal | gentle","Vocal | level",
+ "Mix bus | glue","Drums | punch","Podcast | steady"},1);
+ presets.setComponentID("view.presets");
+ presets.onChange=[this] {applyPreset(presets.getSelectedId());};
+ addAndMakeVisible(presets);
+ detector.addItemList({"Peak","RMS"},1);
+ detector.setComponentID("view.detector");
+ addAndMakeVisible(detector);
+ detectorAttachment=std::make_unique(
+ p.state,"detector",detector);
+ juce::ToggleButton* toggles[]{&autoRelease,&external,&listen,&bypass};
+ const char* toggleIds[]{"autoRelease","external","listen","bypass"};
+ for(std::size_t i=0;i<4;++i) {
+ addAndMakeVisible(*toggles[i]);
+ buttons[i]=std::make_unique(p.state,toggleIds[i],*toggles[i]);
+ }
+ autoRelease.setComponentID("view.auto");
+ external.setComponentID("view.external");
+ listen.setComponentID("view.listen");
+ autoRelease.setButtonText("AUTO");
+ external.setButtonText("EXT SC");
+ listen.setButtonText("LISTEN");
+ compare.setComponentID("view.compare");
+ bypass.setComponentID("view.bypass");
+ compare.onClick=[this] {
+ const auto current=processor.snapshot();
+ for(std::size_t i=0;i(
+ "Save ArSonComp preset",
+ juce::File::getSpecialLocation(juce::File::userDocumentsDirectory)
+ .getChildFile("ArSonComp-Preset.arsoncomp"),"*.arsoncomp");
+ juce::Component::SafePointer safe(this);
+ presetChooser->launchAsync(juce::FileBrowserComponent::saveMode |
+ juce::FileBrowserComponent::canSelectFiles |
+ juce::FileBrowserComponent::warnAboutOverwriting,
+ [safe](const juce::FileChooser& chooser) {
+ if(auto* editor=safe.getComponent()) {
+ auto file=chooser.getResult();
+ if(file==juce::File{})return;
+ if(!file.hasFileExtension(".arsoncomp"))
+ file=file.withFileExtension(".arsoncomp");
+ if(!arson::preset::save(editor->processor,file))
+ juce::AlertWindow::showMessageBoxAsync(
+ juce::MessageBoxIconType::WarningIcon,
+ "Save failed","Could not write the selected preset.");
+ }
+ });
+ };
+ loadPreset.onClick=[this] {
+ presetChooser=std::make_unique(
+ "Open ArSonComp preset",
+ juce::File::getSpecialLocation(juce::File::userDocumentsDirectory),"*.arsoncomp");
+ juce::Component::SafePointer safe(this);
+ presetChooser->launchAsync(juce::FileBrowserComponent::openMode |
+ juce::FileBrowserComponent::canSelectFiles,
+ [safe](const juce::FileChooser& chooser) {
+ if(auto* editor=safe.getComponent()) {
+ const auto file=chooser.getResult();
+ if(file==juce::File{})return;
+ if(!arson::preset::load(editor->processor,file)) {
+ juce::AlertWindow::showMessageBoxAsync(
+ juce::MessageBoxIconType::WarningIcon,
+ "Preset rejected","This is not a compatible ArSonComp preset.");
+ return;
+ }
+ editor->presetSnapshot=editor->processor.snapshot();
+ editor->presets.setSelectedId(0,juce::dontSendNotification);
+ editor->presets.setText(file.getFileNameWithoutExtension(),juce::dontSendNotification);
+ editor->cachedCurveKey[0]=999;
+ editor->repaint();
+ }
+ });
+ };
+ // Preset file operations stay accessible through one small FILE menu.
+ // Legacy controls remain attached for host-independent smoke tests,
+ // but are not painted in the crowded toolbar.
+ addChildComponent(savePreset);
+ addChildComponent(loadPreset);
+ fileMenu.setComponentID("view.file");
+ fileMenu.onClick=[this] {
+ juce::PopupMenu menu;
+ menu.addItem(1,"Save preset...");
+ menu.addItem(2,"Open preset...");
+ juce::Component::SafePointer safe(this);
+ menu.showMenuAsync(juce::PopupMenu::Options().withTargetComponent(&fileMenu),
+ [safe](int item) {
+ if(auto* editor=safe.getComponent()) {
+ if(item==1 && editor->savePreset.onClick)editor->savePreset.onClick();
+ else if(item==2 && editor->loadPreset.onClick)editor->loadPreset.onClick();
+ }
+ });
+ };
+ addAndMakeVisible(fileMenu);
+ dynamicsTab.setComponentID("view.dynamics.tab");
+ sidechainTab.setComponentID("view.sidechain.tab");
+ dynamicsTab.onClick=[this]{sidechainPanel=false;syncPanelVisibility();};
+ sidechainTab.onClick=[this]{sidechainPanel=true;syncPanelVisibility();};
+ addAndMakeVisible(dynamicsTab);
+ addAndMakeVisible(sidechainTab);
+ compact.setComponentID("view.compact");
+ compact.onClick=[this] {
+ compactMode=!compactMode;
+ if(compactMode) {
+ expandedWidth=getWidth();expandedHeight=getHeight();
+ setResizeLimits(740,330,1200,330);
+ compact.setButtonText("FULL");
+ setSize(expandedWidth,330);
+ } else {
+ setResizeLimits(740,585,1200,965);
+ compact.setButtonText("MINI");
+ setSize(expandedWidth,expandedHeight);
+ }
+ };
+ addAndMakeVisible(compact);
+ hoverReadout.setComponentID("view.value.readout");
+ hoverReadout.setFont(juce::FontOptions(11.0f));
+ hoverReadout.setColour(juce::Label::textColourId,accentBright);
+ hoverReadout.setJustificationType(juce::Justification::centred);
+ hoverReadout.setInterceptsMouseClicks(false,false);
+ addAndMakeVisible(hoverReadout);
+ updateHoverReadout(hoveredParameter);
+ arson::MeterFrame discard;
+ for(std::uint32_t i=0;iendChangeGesture();
+ setLookAndFeel(nullptr);
+}
+void Editor::setValue(std::size_t i,float value) {
+ if(auto* parameter=processor.state.getParameter(arson::specs[i].id)) {
+ parameter->beginChangeGesture();
+ parameter->setValueNotifyingHost(parameter->convertTo0to1(value));
+ parameter->endChangeGesture();
+ }
+}
+void Editor::applyPreset(int id) {
+ if(id<1)return;
+ arson::Parameters p;
+ if(id==2) {p.value[arson::Ratio]=2.5f;p.value[arson::Attack]=15;
+ p.value[arson::Release]=180;p.value[arson::Knee]=12;p.value[arson::Style]=2;}
+ if(id==3) {p.value[arson::Threshold]=-24;p.value[arson::Ratio]=3;
+ p.value[arson::Detector]=1;p.value[arson::AutoRelease]=1;
+ p.value[arson::Highpass]=100;p.value[arson::Style]=1;}
+ if(id==4) {p.value[arson::Ratio]=2;p.value[arson::Attack]=30;
+ p.value[arson::Release]=250;p.value[arson::Knee]=12;
+ p.value[arson::Range]=6;p.value[arson::Highpass]=80;p.value[arson::Style]=2;}
+ if(id==5) {p.value[arson::Ratio]=5;p.value[arson::Attack]=25;
+ p.value[arson::Release]=80;p.value[arson::Knee]=3;p.value[arson::Mix]=75;}
+ if(id==6) {p.value[arson::Threshold]=-24;p.value[arson::Ratio]=4;
+ p.value[arson::Attack]=5;p.value[arson::Release]=180;
+ p.value[arson::Knee]=12;p.value[arson::Highpass]=100;
+ p.value[arson::AutoRelease]=1;p.value[arson::Style]=2;}
+ presetSnapshot=p;
+ for(std::size_t i=0;i Editor::plotBounds() const noexcept {
+ if(compactMode || display.isEmpty())return {};
+ return {static_cast(display.getX()+82),
+ static_cast(display.getY()+30),
+ static_cast(display.getWidth()-206),
+ static_cast(display.getHeight()-60)};
+}
+void Editor::syncPanelVisibility() {
+ constexpr std::array mainControls{
+ arson::Range,arson::Hold,arson::Mix,arson::Link};
+ constexpr std::array sideControls{
+ arson::Highpass,arson::Lowpass};
+ for(auto i:mainControls) {
+ knobs[i].setVisible(!sidechainPanel);
+ labels[i].setVisible(!sidechainPanel);
+ }
+ for(auto i:sideControls) {
+ knobs[i].setVisible(sidechainPanel);
+ labels[i].setVisible(sidechainPanel);
+ }
+ autoRelease.setVisible(!sidechainPanel);
+ detector.setVisible(sidechainPanel);
+ external.setVisible(sidechainPanel);
+ listen.setVisible(sidechainPanel);
+ dynamicsTab.setColour(juce::TextButton::buttonColourId,
+ sidechainPanel?juce::Colour{0xff1b2025}:juce::Colour{0xff413037});
+ sidechainTab.setColour(juce::TextButton::buttonColourId,
+ sidechainPanel?juce::Colour{0xff413037}:juce::Colour{0xff1b2025});
+ repaint(0,compactMode?177:getHeight()-108,getWidth(),106);
+}
+void Editor::resized() {
+ const int w=getWidth(),h=getHeight();
+ // The utility menu replaces two permanent buttons. Presets and model
+ // have measurable reserved space at both 860 and 900 pixel layouts.
+ compact.setBounds(147,21,45,28);
+ style.setBounds(198,20,125,30);
+ presets.setBounds(333,20,w-580,30);
+ compare.setBounds(w-237,20,49,30);
+ fileMenu.setBounds(w-180,20,57,30);
+ bypass.setBounds(w-115,21,105,28);
+ // Compact responsive hardware chassis; LCD still has its own display.
+ display=compactMode?juce::Rectangle{}:
+ juce::Rectangle{8,70,w-16,h-268};
+ const int mainY=compactMode?68:display.getBottom()+5;
+ const int cell=(w-28)/7;
+ constexpr std::array main{arson::Input,arson::Attack,
+ arson::Release,arson::Threshold,arson::Ratio,arson::Knee,arson::Makeup};
+ for(std::size_t k=0;k(k)*cell;
+ labels[i].setBounds(x,mainY+3,cell,17);
+ knobs[i].setBounds(x+3,mainY+20,cell-6,70);
+ }
+
+ const int bottomY=compactMode?166:h-92;
+ dynamicsTab.setBounds(16,bottomY+1,92,23);
+ sidechainTab.setBounds(114,bottomY+1,94,23);
+ // Main tab: four comfortable controls, plus a dedicated AUTO control.
+ const int slot=(w-190)/4;
+ constexpr std::array dynamics{arson::Range,arson::Hold,
+ arson::Mix,arson::Link};
+ for(std::size_t k=0;k(k)*slot;
+ labels[i].setBounds(x,bottomY+25,slot-10,15);
+ knobs[i].setBounds(x+5,bottomY+38,slot-18,40);
+ }
+ autoRelease.setBounds(w-153,bottomY+42,139,28);
+
+ // Sidechain tab: only detector-specific controls are painted.
+ constexpr std::array filters{arson::Highpass,arson::Lowpass};
+ // Responsive five-column sidechain panel, no fixed overflow positions.
+ const int available=w-32;
+ const int filterSlot=juce::jlimit(136,174,available*23/100);
+ const int detW=juce::jlimit(92,108,available*14/100);
+ const int extW=juce::jlimit(108,118,available*17/100);
+ const int listenW=juce::jlimit(105,118,available*16/100);
+ const int filterStart=16;
+ for(std::size_t k=0;k(k)*filterSlot;
+ labels[i].setBounds(x,bottomY+25,filterSlot-8,15);
+ knobs[i].setBounds(x+2,bottomY+38,filterSlot-8,40);
+ }
+ const int detX=filterStart+filterSlot*2+8;
+ detector.setBounds(detX,bottomY+43,detW,27);
+ external.setBounds(detX+detW+8,bottomY+42,extW,30);
+ listen.setBounds(detX+detW+extW+16,bottomY+42,listenW,30);
+ const int readoutW=juce::jmin(254,w-40);
+ hoverReadout.setBounds(compactMode?w-readoutW-14:
+ display.getCentreX()-readoutW/2,
+ compactMode?h-21:display.getBottom()-27,readoutW,18);
+ // Old file buttons are intentionally non-visible.
+ savePreset.setBounds(0,0,0,0);
+ loadPreset.setBounds(0,0,0,0);
+ // Generate the brushed metal once on resize, not at 30Hz in paint().
+ metalSurface=juce::Image(juce::Image::RGB,w,h,true);
+ {
+ juce::Graphics chassis(metalSurface);
+ arson::ui::paintBrushedChassis(chassis,w,h);
+ // MINI meter glass is a static bezel; paint only live bar data
+ // above this cached surface during normal timer repaints.
+ if(compactMode) arson::ui::paintInsetGlass(chassis,
+ {13.0f,258.0f,static_cast(w-26),47.0f});
+ }
+ if(compactMode){grid=juce::Image();return;}
+
+ cachedCurveWidth=-1;
+ grid=juce::Image(juce::Image::RGB,display.getWidth(),display.getHeight(),true);
+ juce::Graphics g(grid);
+ const float width=static_cast(display.getWidth());
+ const float height=static_cast(display.getHeight());
+ // Independent black glass LCD covers both graph and IN/GR/OUT meter
+ // cavities. All glass effects are baked into this cached grid bitmap.
+ arson::ui::paintInsetGlass(g,{0.0f,0.0f,width,height});
+ const auto plot=plotBounds().translated(-static_cast(display.getX()),
+ -static_cast(display.getY()));
+ g.setGradientFill(juce::ColourGradient(juce::Colour{0xff070b0d},
+ plot.getX(),plot.getY(),juce::Colour{0xff020506},
+ plot.getRight(),plot.getBottom(),false));
+ g.fillRect(plot);
+ // A very faint diagonal reflection, not an opaque gray graph panel.
+ g.setGradientFill(juce::ColourGradient(
+ juce::Colours::white.withAlpha(0.034f),plot.getX(),plot.getY(),
+ juce::Colours::transparentWhite,plot.getCentreX(),plot.getBottom(),false));
+ g.fillRect(plot);
+ const float bottom=plot.getBottom(),left=plot.getX(),right=plot.getRight();
+ for(int db=-60;db<=0;db+=6) {
+ const float yy=graphY(plot,static_cast(db));
+ g.setColour(juce::Colour{0xff58616a}.withAlpha(db%12==0?0.18f:0.07f));
+ g.drawHorizontalLine(static_cast(yy),left,right);
+ if(db%12==0) {
+ g.setColour(muted.withAlpha(0.62f));
+ g.setFont(juce::FontOptions(9.0f));
+ g.drawText(juce::String(db),static_cast(left)-37,
+ static_cast(yy)-8,31,17,juce::Justification::centredRight);
+ }
+ }
+ for(int db=-60;db<=0;db+=10) {
+ const float xx=left+(static_cast(db+60)/60.0f)*plot.getWidth();
+ g.setColour(juce::Colour{0xff64707a}.withAlpha(db%20==0?0.18f:0.08f));
+ g.drawVerticalLine(static_cast(xx),plot.getY(),bottom);
+ }
+ g.setColour(juce::Colour{0xff51585f}.withAlpha(0.52f));
+ g.drawRect(plot,0.8f);
+ g.setColour(juce::Colour{0xff454b50}.withAlpha(0.75f));
+ g.drawVerticalLine(static_cast(left)-45,18.0f,height-20.0f);
+ g.drawVerticalLine(static_cast(right)+12,18.0f,height-20.0f);
+ const float x0=plot.getX(),x1=plot.getRight();
+ edgeFades[0]=arson::ui::makeEdgeFade(juce::Colours::white,x0,x1,0.19f);
+ edgeFades[1]=arson::ui::makeEdgeFade(juce::Colour{0xffd8d9d8},x0,x1,0.52f);
+ edgeFades[2]=arson::ui::makeEdgeFade(accentBright,x0,x1,0.91f);
+ edgeFades[3]=arson::ui::makeEdgeFade(accentBright,x0,x1,0.97f,0.18f);
+ edgeFades[4]=arson::ui::makeEdgeFade(accent,x0,x1,0.14f,0.10f);
+ edgeFades[5]=arson::ui::makeEdgeFade(accent,x0,x1,0.105f);
+ arson::ui::paintMeterRail(g,{14.0f,plot.getY(),33.0f,plot.getHeight()},false);
+ arson::ui::paintMeterRail(g,{width-110.0f,plot.getY(),34.0f,plot.getHeight()},true);
+ arson::ui::paintMeterRail(g,{width-61.0f,plot.getY(),42.0f,plot.getHeight()},false);
+ rebuildHistoryPaths();
+}
+void Editor::timerCallback() {
+ if(!isShowing())return;
+ if(presets.getSelectedId()>0) {
+ const auto current=processor.snapshot();
+ for(std::size_t i=0;i0.001f) {
+ presets.setSelectedId(0,juce::dontSendNotification);
+ presets.setText("Custom",juce::dontSendNotification);
+ break;
+ }
+ }
+ arson::MeterFrame frame;
+ float in=0,out=0,reduction=0;
+ std::array inPeaks{},outPeaks{};
+ int received=0;
+ // Coalesce the bounded SPSC queue exactly once per GUI tick.
+ while(received(arson::MeterQueue::capacity) &&
+ processor.meters.pop(frame)) {
+ history[head]=frame;
+ head=(head+1)%history.size();
+ ++received;
+ in=std::max(in,frame.input);
+ out=std::max(out,frame.output);
+ reduction=std::max(reduction,frame.reduction);
+ currentChannels=frame.channels;
+ for(std::size_t i=0;i<2;++i) {
+ inPeaks[i]=std::max(inPeaks[i],frame.inputChannel[i]);
+ outPeaks[i]=std::max(outPeaks[i],frame.outputChannel[i]);
+ }
+ }
+ // Time-based visual smoothing: attack remains responsive (~18 ms) while
+ // falloff is calm (~210 ms). No change to real detector or DSP latency.
+ const double now=juce::Time::getMillisecondCounterHiRes();
+ const double elapsed=lastUiTickMs>0.0 ?
+ std::clamp((now-lastUiTickMs)*0.001,0.008,0.120):1.0/30.0;
+ lastUiTickMs=now;
+ inputDb=approachVisual(inputDb,arson::gainToDb(in),elapsed,0.018,0.210);
+ outputDb=approachVisual(outputDb,arson::gainToDb(out),elapsed,0.018,0.210);
+ gr=approachVisual(gr,reduction,elapsed,0.022,0.185);
+ for(std::size_t i=0;i<2;++i) {
+ inChannelDb[i]=approachVisual(inChannelDb[i],
+ arson::gainToDb(inPeaks[i]),elapsed,0.018,0.210);
+ outChannelDb[i]=approachVisual(outChannelDb[i],
+ arson::gainToDb(outPeaks[i]),elapsed,0.018,0.210);
+ }
+ // A stopped host produces no meter frames. Without a bounded idle
+ // drain, the last four seconds of trace remain frozen forever.
+ // Advance at the original 100-Hz history rate using GUI time only.
+ std::size_t aged=0;
+ if(received>0) {
+ lastTelemetryMs=now;
+ idleHistoryFrames=0;
+ } else if(lastTelemetryMs>0.0 && now-lastTelemetryMs>150.0) {
+ aged=arson::ui::ageStoppedHistory(history,head,idleHistoryFrames,
+ std::max(1,static_cast(std::round(elapsed*100.0))));
+ }
+ if(!compactMode && (received>0 || aged>0))rebuildHistoryPaths();
+ if(compactMode)repaint(14,298,getWidth()-28,57);
+ else repaint(display);
+}
+
+void Editor::rebuildHistoryPaths() {
+ inputHistory.clear();
+ outputHistory.clear();
+ reductionHistory.clear();
+ reductionArea.clear();
+ const auto plot=plotBounds().translated(-static_cast(display.getX()),
+ -static_cast(display.getY()));
+ if(plot.isEmpty())return;
+ float inY=plot.getBottom(),outY=plot.getBottom(),grY=plot.getY();
+ constexpr float inputEase=0.52f, outputEase=0.52f, grEase=0.42f;
+ for(std::size_t i=0;i(i)/
+ static_cast(history.size()-1);
+ const float targetIn=graphY(plot,arson::gainToDb(f.input));
+ const float targetOut=graphY(plot,arson::gainToDb(f.output));
+ const float targetGr=plot.getY()+clamp01(f.reduction/30.0f)*plot.getHeight()*0.40f;
+ if(i==0){inY=targetIn;outY=targetOut;grY=targetGr;}
+ else {
+ inY+=(targetIn-inY)*inputEase;
+ outY+=(targetOut-outY)*outputEase;
+ grY+=(targetGr-grY)*grEase;
+ }
+ if(i==0) {
+ inputHistory.startNewSubPath(x,inY);
+ outputHistory.startNewSubPath(x,outY);
+ reductionHistory.startNewSubPath(x,grY);
+ reductionArea.startNewSubPath(x,plot.getY());
+ reductionArea.lineTo(x,grY);
+ } else {
+ inputHistory.lineTo(x,inY);
+ outputHistory.lineTo(x,outY);
+ reductionHistory.lineTo(x,grY);
+ reductionArea.lineTo(x,grY);
+ }
+ }
+ reductionArea.lineTo(plot.getRight(),plot.getY());
+ reductionArea.closeSubPath();
+}
+void Editor::paint(juce::Graphics& g) {
+ if(metalSurface.isValid())g.drawImageAt(metalSurface,0,0);
+ else g.fillAll(juce::Colour{0xff454a4d});
+ // Soft satin chassis divisions remain visible over fine brushed grain.
+ g.setColour(juce::Colours::black.withAlpha(0.22f));
+ g.fillRect(0,0,getWidth(),68);
+ g.setColour(juce::Colours::white.withAlpha(0.12f));
+ g.drawHorizontalLine(1,0.0f,static_cast(getWidth()));
+ g.setColour(juce::Colours::black.withAlpha(0.58f));
+ g.drawHorizontalLine(67,0.0f,static_cast(getWidth()));
+ g.setFont(juce::FontOptions(17.5f));
+ g.setColour(text);
+ g.drawText("ArSon",16,11,73,28,juce::Justification::centredLeft);
+ g.setColour(accent);
+ g.drawText("Comp",84,11,61,28,juce::Justification::centredLeft);
+ g.fillRoundedRectangle(17.0f,49.0f,37.0f,2.0f,1.0f);
+ g.setColour(text.withAlpha(0.73f));
+ g.setFont(juce::FontOptions(9.0f));
+ g.drawText("MODEL",198,5,84,13,juce::Justification::left);
+ g.drawText("PRESET",333,5,88,13,juce::Justification::left);
+
+ const int mainY=compactMode?68:display.getBottom()+5;
+ const int bottomY=compactMode?166:getHeight()-92;
+ g.setColour(juce::Colours::black.withAlpha(0.105f));
+ g.fillRect(8,mainY,getWidth()-16,bottomY-mainY);
+ g.setColour(juce::Colours::black.withAlpha(0.40f));
+ g.drawHorizontalLine(mainY,12.0f,static_cast(getWidth()-12));
+ g.drawHorizontalLine(bottomY,12.0f,static_cast(getWidth()-12));
+ g.setColour(juce::Colours::white.withAlpha(0.09f));
+ g.drawHorizontalLine(mainY+1,12.0f,static_cast(getWidth()-12));
+ g.drawHorizontalLine(bottomY+1,12.0f,static_cast(getWidth()-12));
+ const int cell=(getWidth()-28)/7;
+ for(int i=1;i<7;++i) {
+ g.setColour(juce::Colours::black.withAlpha(0.15f));
+ const float x=14.0f+static_cast(i*cell);
+ g.drawVerticalLine(static_cast(x),static_cast(mainY+17),
+ static_cast(mainY+90));
+ }
+ g.setColour(accent.withAlpha(0.68f));
+ g.fillRoundedRectangle(sidechainPanel?115.0f:17.0f,
+ static_cast(bottomY+22),sidechainPanel?91.0f:88.0f,1.8f,1.0f);
+ if(!compactMode) {
+ if(grid.isValid())g.drawImageAt(grid,display.getX(),display.getY());
+ drawDisplay(g);
+ } else paintCompactMeters(g);
+ g.setColour(text.withAlpha(0.66f));
+ g.setFont(juce::FontOptions(9.0f));
+ g.drawText("0 SAMPLES ADDED / REALTIME DSP",
+ 14,getHeight()-18,232,14,juce::Justification::left);
+}
+void Editor::refreshTransfer(const arson::Parameters& p,juce::Rectangle plot) {
+ const std::array key{{p[arson::Threshold],p[arson::Ratio],
+ p[arson::Knee],p[arson::Range]}};
+ if(key==cachedCurveKey && plot.getWidth()==cachedCurveWidth)return;
+ cachedCurveKey=key;
+ cachedCurveWidth=plot.getWidth();
+ transferCurve.clear();
+ transferShade.clear();
+ const int steps=std::max(100,static_cast(plot.getWidth()));
+ for(int i=0;i<=steps;++i) {
+ const float db=-60.0f+60.0f*static_cast(i)/steps;
+ const float y=graphY(plot,db-arson::reduction(db,key[0],key[1],key[2],key[3]));
+ const float x=plot.getX()+plot.getWidth()*static_cast(i)/steps;
+ if(i==0){transferCurve.startNewSubPath(x,y);transferShade.startNewSubPath(x,y);}
+ else {transferCurve.lineTo(x,y);transferShade.lineTo(x,y);}
+ }
+ transferShade.lineTo(plot.getRight(),plot.getBottom());
+ transferShade.closeSubPath();
+}
+void Editor::drawMeter(juce::Graphics& g,juce::Rectangle bounds,
+ float dB1,float dB2,const juce::String& title,bool gainReduction) {
+ const auto x=bounds.getX(),y=bounds.getY(),h=bounds.getHeight();
+ g.setColour(muted);
+ g.setFont(juce::FontOptions(10.0f));
+ g.drawText(title,static_cast(x)-3,static_cast(y)-22,
+ static_cast(bounds.getWidth())+6,18,juce::Justification::centred);
+ // Cached dark LED rails are already part of Editor::grid.
+ // Draw only the illuminated pixels, no 46x redraw of dark segments.
+ const int bars=gainReduction?1:2;
+ const float bw=bars==1?13.0f:9.0f;
+ const float spacing=3.0f;
+ const float total=bw*bars+spacing*(bars-1);
+ const float start=x+(bounds.getWidth()-total)*0.5f;
+ constexpr int segments=46;
+ const float segmentH=h/static_cast(segments);
+ for(int c=0;c(std::ceil(fraction*static_cast(segments))));
+ const float bx=start+c*(bw+spacing);
+ for(int step=0;step(step+1)/segments>0.90f?
+ juce::Colour{0xffff5c63}:
+ (static_cast(step+1)/segments>0.71f?
+ yellow:green));
+ g.setColour(colour);
+ g.fillRect(bx,yy,bw,std::max(1.0f,segmentH-1.2f));
+ }
+ }
+ g.setFont(juce::FontOptions(11.0f));
+ g.setColour(text);
+ g.drawText(levelText(dB1),static_cast(x)-10,static_cast(y+h+6),
+ static_cast(bounds.getWidth())+20,18,juce::Justification::centred);
+}
+void Editor::drawDisplay(juce::Graphics& g) {
+ juce::Graphics::ScopedSaveState save(g);
+ g.reduceClipRegion(display);
+ g.setOrigin(display.getPosition());
+ const auto plot=plotBounds().translated(-static_cast(display.getX()),
+ -static_cast(display.getY()));
+ if(plot.isEmpty())return;
+ const auto p=processor.snapshot();
+ const float w=static_cast(display.getWidth()),h=static_cast(display.getHeight());
+ refreshTransfer(p,plot);
+ g.setFont(juce::FontOptions(10.0f));
+ g.setColour(muted);
+ g.drawText("DYNAMICS / 4.0 s",static_cast(plot.getX())+7,8,185,17,
+ juce::Justification::left);
+ g.setColour(accent.withAlpha(0.82f));
+ g.drawText("TRANSFER / DRAG THRESHOLD",static_cast(plot.getRight())-225,8,219,17,
+ juce::Justification::centredRight);
+
+ // Graph and metering share a -60 to 0 dBFS scale. The transfer line is a
+ // real response curve; the animated lines are real per-block telemetry.
+ // The two data types never claim to share an x-axis: static transfer uses
+ // input level on x, dynamic history uses time.
+ g.setGradientFill(juce::ColourGradient(accent.withAlpha(0.14f),
+ plot.getX(),plot.getY()+plot.getHeight()*0.28f,
+ accent.withAlpha(0.005f),plot.getX(),plot.getBottom(),false));
+ g.fillPath(transferShade);
+ g.setGradientFill(edgeFades[4]);
+ g.strokePath(transferCurve,juce::PathStrokeType(6.0f));
+ g.setGradientFill(edgeFades[3]);
+ g.strokePath(transferCurve,juce::PathStrokeType(2.1f));
+
+ const float mx=plot.getX()+dbFraction(p[arson::Threshold])*plot.getWidth();
+ const float my=graphY(plot,p[arson::Threshold]-
+ arson::reduction(p[arson::Threshold],p[arson::Threshold],
+ p[arson::Ratio],p[arson::Knee],p[arson::Range]));
+ g.setColour(accent.withAlpha(0.28f));
+ g.drawVerticalLine(static_cast(mx),plot.getY(),plot.getBottom());
+ g.setColour(accent.withAlpha(0.24f));
+ g.fillEllipse(mx-9,my-9,18,18);
+ g.setColour(juce::Colours::white);
+ g.fillEllipse(mx-4.0f,my-4.0f,8.0f,8.0f);
+
+ // These 400-point paths are computed once when fresh telemetry arrives,
+ // never rebuilt by repaint or a host redraw. All buffers live on GUI.
+ g.setGradientFill(edgeFades[5]);
+ g.fillPath(reductionArea);
+ g.setGradientFill(edgeFades[0]);
+ g.strokePath(inputHistory,juce::PathStrokeType(1.05f));
+ g.setGradientFill(edgeFades[1]);
+ g.strokePath(outputHistory,juce::PathStrokeType(1.1f));
+ g.setGradientFill(edgeFades[2]);
+ g.strokePath(reductionHistory,juce::PathStrokeType(1.55f));
+
+ drawMeter(g,{14.0f,plot.getY(),33.0f,plot.getHeight()},
+ inChannelDb[0],inChannelDb[1],"IN",false);
+ drawMeter(g,{w-110.0f,plot.getY(),34.0f,plot.getHeight()},
+ gr,gr,"GR",true);
+ drawMeter(g,{w-61.0f,plot.getY(),42.0f,plot.getHeight()},
+ outChannelDb[0],outChannelDb[1],"OUT",false);
+ g.setColour(muted.withAlpha(0.88f));
+ g.setFont(juce::FontOptions(9.0f));
+ g.drawText("-60 dB",static_cast(plot.getX()),
+ static_cast(h)-27,60,15,juce::Justification::left);
+ g.drawText("0 dBFS",static_cast(plot.getRight())-60,
+ static_cast(h)-27,60,15,juce::Justification::right);
+ if(p[arson::Listen]>0.5f || p[arson::Bypass]>0.5f) {
+ g.setFont(juce::FontOptions(11.0f));
+ g.setColour(accentBright);
+ g.drawText(p[arson::Bypass]>0.5f?"BYPASSED":"SIDECHAIN MONITOR",
+ static_cast(plot.getCentreX())-95,8,190,19,juce::Justification::centred);
+ }
+}
+void Editor::paintCompactMeters(juce::Graphics& g) {
+ // The black LCD bezel and glass are baked into metalSurface on resize.
+ const float values[]{inputDb,gr,outputDb};
+ const char* labelsText[]{"INPUT","GAIN REDUCTION","OUTPUT"};
+ const int segment=(getWidth()-42)/3;
+ for(int i=0;i<3;++i) {
+ const float x=20.0f+static_cast(i*segment);
+ g.setColour(muted);g.setFont(juce::FontOptions(10.0f));
+ g.drawText(labelsText[i],static_cast(x),261,109,16,juce::Justification::left);
+ g.setColour(text);g.setFont(juce::FontOptions(11.0f));
+ g.drawText(levelText(values[i])+" dB",static_cast(x)+segment-85,261,78,16,
+ juce::Justification::centredRight);
+ g.setColour(line);
+ const float bw=static_cast(segment-16), y=289.0f;
+ g.fillRoundedRectangle(x,y,bw,6.0f,3.0f);
+ const float filled=i==1?clamp01(values[i]/30.0f):dbFraction(values[i]);
+ g.setColour(i==1?accent:green);
+ if(filled>0.0f)g.fillRoundedRectangle(x,y,bw*filled,6.0f,3.0f);
+ }
+}
+void Editor::updateHoverReadout(std::size_t index) {
+ if(index>=knobs.size())return;
+ const auto& spec=arson::specs[index];
+ const int digits=(index==arson::Attack || index==arson::Ratio)?2:
+ ((index==arson::Highpass || index==arson::Lowpass ||
+ index==arson::Mix || index==arson::Link || index==arson::Hold)?0:1);
+ const juce::String value=juce::String(spec.name).toUpperCase()+" "+
+ juce::String(knobs[index].getValue(),digits)+juce::String(spec.unit);
+ if(hoverReadout.getText()!=value)
+ hoverReadout.setText(value,juce::dontSendNotification);
+}
+bool Editor::focusHoveredSlider(const juce::MouseEvent& event) {
+ for(std::size_t i=0;i16.0f ||
+ std::abs(event.position.y-my)>18.0f)return;
+ if(auto* parameter=processor.state.getParameter("threshold")) {
+ thresholdDragging=true;
+ parameter->beginChangeGesture();
+ mouseDrag(event);
+ }
+}
+void Editor::mouseDrag(const juce::MouseEvent& event) {
+ if(focusHoveredSlider(event))return;
+ if(!thresholdDragging)return;
+ const auto plot=plotBounds();
+ const float threshold=-60.0f+60.0f*clamp01(
+ (event.position.x-plot.getX())/plot.getWidth());
+ if(auto* parameter=processor.state.getParameter("threshold"))
+ parameter->setValueNotifyingHost(parameter->convertTo0to1(threshold));
+ hoveredParameter=arson::Threshold;
+ updateHoverReadout(hoveredParameter);
+ repaint(display);
+}
+void Editor::mouseUp(const juce::MouseEvent&) {
+ if(!thresholdDragging)return;
+ thresholdDragging=false;
+ if(auto* parameter=processor.state.getParameter("threshold"))
+ parameter->endChangeGesture();
+ setMouseCursor(juce::MouseCursor::NormalCursor);
+}
+void Editor::mouseMove(const juce::MouseEvent& event) {
+ if(focusHoveredSlider(event))return;
+ if(compactMode || !plotBounds().contains(event.position)) {
+ setMouseCursor(juce::MouseCursor::NormalCursor);
+ return;
+ }
+ const auto p=processor.snapshot();
+ const auto plot=plotBounds();
+ const float mx=plot.getX()+dbFraction(p[arson::Threshold])*plot.getWidth();
+ const float my=graphY(plot,p[arson::Threshold]-
+ arson::reduction(p[arson::Threshold],p[arson::Threshold],
+ p[arson::Ratio],p[arson::Knee],p[arson::Range]));
+ const bool active=std::abs(event.position.x-mx)<=16.0f &&
+ std::abs(event.position.y-my)<=18.0f;
+ setMouseCursor(active?juce::MouseCursor::PointingHandCursor:
+ juce::MouseCursor::NormalCursor);
+}
diff --git a/plugin/Editor.h b/plugin/Editor.h
new file mode 100644
index 0000000..b3339ed
--- /dev/null
+++ b/plugin/Editor.h
@@ -0,0 +1,84 @@
+#pragma once
+#include "Processor.h"
+#include
+#include
+class CompLook final : public juce::LookAndFeel_V4 {
+public:
+ CompLook();
+ juce::Label* createSliderTextBox(juce::Slider&) override;
+ void drawRotarySlider(juce::Graphics&,int,int,int,int,float,float,float,juce::Slider&) override;
+ void drawLinearSlider(juce::Graphics&,int,int,int,int,float,float,float,
+ const juce::Slider::SliderStyle,juce::Slider&) override;
+ void drawToggleButton(juce::Graphics&,juce::ToggleButton&,bool,bool) override;
+private:
+ struct FaceCache { int pixels=0; juce::Image face; };
+ std::array faces; // normal + oversized Threshold only
+ juce::Image sourceFace; // decoded once on GUI initialization
+ juce::Image toggleOn, toggleOff; // matched, predecoded state sprites
+ juce::Image sliderTrack, sliderThumb; // layered photographic gunmetal assets, decoded once
+ juce::Image sliderCapLeft, sliderCentre, sliderCapRight; // pre-clipped once; no per-paint allocations
+ const juce::Image& knobFace(int diameter,bool primary);
+};
+class Editor final : public juce::AudioProcessorEditor, private juce::Timer {
+public:
+ explicit Editor(Processor&);
+ ~Editor() override;
+ void paint(juce::Graphics&) override;
+ void resized() override;
+ void mouseDown(const juce::MouseEvent&) override;
+ void mouseDrag(const juce::MouseEvent&) override;
+ void mouseUp(const juce::MouseEvent&) override;
+ void mouseMove(const juce::MouseEvent&) override;
+ void mouseEnter(const juce::MouseEvent&) override;
+private:
+ void timerCallback() override;
+ void applyPreset(int);
+ void setValue(std::size_t,float);
+ void drawDisplay(juce::Graphics&);
+ juce::Rectangle plotBounds() const noexcept;
+ void refreshTransfer(const arson::Parameters&,juce::Rectangle);
+ void drawMeter(juce::Graphics&,juce::Rectangle,float,float,
+ const juce::String&,bool);
+ void paintCompactMeters(juce::Graphics&);
+ void rebuildHistoryPaths();
+ void syncPanelVisibility();
+ void updateHoverReadout(std::size_t);
+ bool focusHoveredSlider(const juce::MouseEvent&);
+ Processor& processor;
+ CompLook look;
+ std::array knobs;
+ std::array labels;
+ juce::Label hoverReadout;
+ std::size_t hoveredParameter=arson::Threshold;
+ using SliderAttachment=juce::AudioProcessorValueTreeState::SliderAttachment;
+ using ButtonAttachment=juce::AudioProcessorValueTreeState::ButtonAttachment;
+ std::array,arson::Detector> attachments;
+ juce::ComboBox presets,detector,style;
+ juce::TextButton compare{"A/B"},compact{"MINI"},savePreset{"SAVE"},loadPreset{"OPEN"};
+ juce::TextButton fileMenu{"FILE"},dynamicsTab{"DYNAMICS"},sidechainTab{"SIDECHAIN"};
+ juce::ToggleButton autoRelease{"Auto release"},external{"External SC"},listen{"Listen SC"},bypass{"Bypass"};
+ std::array,4> buttons;
+ std::unique_ptr detectorAttachment,styleAttachment;
+ std::unique_ptr presetChooser;
+ arson::Parameters alternate, presetSnapshot;
+ bool alternateActive=false;
+ bool compactMode=false,thresholdDragging=false,sidechainPanel=false;
+ int expandedWidth=780,expandedHeight=640;
+ std::array history{};
+ std::size_t head=0;
+ float inputDb=-120,outputDb=-120,gr=0;
+ double lastUiTickMs=0.0,lastTelemetryMs=0.0;
+ std::size_t idleHistoryFrames=0;
+ std::array inChannelDb{{-120.0f,-120.0f}},outChannelDb{{-120.0f,-120.0f}};
+ int currentChannels=2;
+ juce::Rectangle display;
+ juce::Image grid,metalSurface; // cached full chassis and black glass LCD
+ juce::Path transferCurve,transferShade;
+ juce::Path inputHistory,outputHistory,reductionHistory,reductionArea;
+ // Six cached horizontal gradient brushes: input, output, GR, transfer,
+ // transfer glow and reduction-area fade. Built only on full-view resize.
+ std::array edgeFades;
+ std::array cachedCurveKey{{999,999,999,999}};
+ float cachedCurveWidth=-1;
+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Editor)
+};
diff --git a/plugin/GraphHistory.h b/plugin/GraphHistory.h
new file mode 100644
index 0000000..46f5019
--- /dev/null
+++ b/plugin/GraphHistory.h
@@ -0,0 +1,25 @@
+#pragma once
+#include "../engine/MeterQueue.h"
+#include
+#include
+#include
+
+namespace arson::ui {
+// Silence visually ages only the GUI's bounded history, not any audio data.
+// Ring producer = JUCE message thread; never used by DSP thread.
+template
+std::size_t ageStoppedHistory(std::array& frames,
+ std::size_t& head,std::size_t& injected,
+ int requested) noexcept {
+ static_assert(N>0);
+ const auto available=N-std::min(N,injected);
+ const auto count=std::min(available,
+ static_cast(std::max(0,requested)));
+ for(std::size_t i=0;i
+#include
+
+namespace arson::ui {
+// A four-stop horizontal opacity envelope. Same RGB at every stop avoids
+// muddy colour mixing, and keeps line edges organically dissolved.
+// Only called on the message thread on component resize, never during audio.
+inline juce::ColourGradient makeEdgeFade(juce::Colour colour,float x0,float x1,
+ float opacity,float edgeOpacity=0.0f) {
+ const float visible=juce::jlimit(0.0f,1.0f,opacity);
+ const float edge=visible*juce::jlimit(0.0f,1.0f,edgeOpacity);
+ juce::ColourGradient gradient(colour.withAlpha(edge),x0,0.0f,
+ colour.withAlpha(edge),x1,0.0f,false);
+ gradient.addColour(0.135,colour.withAlpha(visible));
+ gradient.addColour(0.865,colour.withAlpha(visible));
+ return gradient;
+}
+
+// Static segmented meter rails go in Editor's cached grid image, not its
+// 30Hz paint path. Active LEDs alone are painted over the rails at runtime.
+inline void paintMeterRail(juce::Graphics& g,juce::Rectangle bounds,
+ bool gainReduction) {
+ // Inset black-glass meter LCD with its own bezel, cached with the
+ // main scope. Only illuminated LED segments are painted per UI tick.
+ const auto well=bounds.expanded(4.0f,3.0f);
+ g.setColour(juce::Colours::black.withAlpha(0.68f));
+ g.fillRoundedRectangle(well.translated(0.0f,1.0f),3.5f);
+ g.setGradientFill(juce::ColourGradient(juce::Colour{0xff030608},
+ well.getX(),well.getY(),juce::Colour{0xff131a1d},
+ well.getRight(),well.getBottom(),false));
+ g.fillRoundedRectangle(well,3.5f);
+ g.setColour(juce::Colour{0xff788185}.withAlpha(0.20f));
+ g.drawRoundedRectangle(well,3.5f,0.7f);
+ const int bars=gainReduction?1:2;
+ const float bw=bars==1?13.0f:9.0f;
+ const float spacing=3.0f, total=bw*bars+spacing*(bars-1);
+ const float start=bounds.getX()+(bounds.getWidth()-total)*0.5f;
+ constexpr int segments=46;
+ const float segmentH=bounds.getHeight()/static_cast(segments);
+ for(int channel=0;channel
+
+// UI-thread-only file I/O. Never called from processBlock.
+// Use the same versioned host-state schema for project and user preset recall.
+namespace arson::preset {
+inline bool save(Processor& processor, const juce::File& file) {
+ juce::MemoryBlock bytes;
+ processor.getStateInformation(bytes);
+ auto xml=juce::AudioProcessor::getXmlFromBinary(bytes.getData(),static_cast(bytes.getSize()));
+ return xml!=nullptr && file.hasFileExtension(".arsoncomp") && xml->writeTo(file);
+}
+inline bool load(Processor& processor, const juce::File& file) {
+ if(!file.existsAsFile() || !file.hasFileExtension(".arsoncomp")
+ || file.getSize()>1024*1024) return false;
+ auto xml=juce::XmlDocument::parse(file);
+ if(!xml || !xml->hasTagName("ArSonCompState")
+ || xml->getIntAttribute("schema",1)!=1) return false;
+ juce::MemoryBlock bytes;
+ juce::AudioProcessor::copyXmlToBinary(*xml,bytes);
+ processor.setStateInformation(bytes.getData(),static_cast(bytes.getSize()));
+ return true;
+}
+}
diff --git a/plugin/Processor.cpp b/plugin/Processor.cpp
new file mode 100644
index 0000000..06301f3
--- /dev/null
+++ b/plugin/Processor.cpp
@@ -0,0 +1,79 @@
+#include "Processor.h"
+#include "Editor.h"
+juce::AudioProcessorValueTreeState::ParameterLayout Processor::layout() {
+ juce::AudioProcessorValueTreeState::ParameterLayout result;
+ for(std::size_t i=0;i(id,s.name,juce::StringArray{"Clean","Feedback","Smooth"},0));
+ else if(i==arson::Detector) result.add(std::make_unique(id,s.name,juce::StringArray{"Peak","RMS"},0));
+ else if(i>arson::Detector) result.add(std::make_unique(id,s.name,s.initial>0.5f));
+ else result.add(std::make_unique(id,s.name,
+ juce::NormalisableRange{s.min,s.max,0.0f,s.skew},s.initial,
+ juce::AudioParameterFloatAttributes{}.withLabel(s.unit).withStringFromValueFunction(
+ [i](float value,int) {
+ if(i==arson::Highpass || i==arson::Lowpass) return juce::String(juce::roundToInt(value));
+ const int decimals=(i==arson::Ratio || (i==arson::Attack && value<10)) ? 2 : 1;
+ return juce::String(value,decimals);
+ })));
+ }
+ return result;
+}
+Processor::Processor() : AudioProcessor(BusesProperties()
+ .withInput("Input",juce::AudioChannelSet::stereo(),true)
+ .withInput("Sidechain",juce::AudioChannelSet::stereo(),false)
+ .withOutput("Output",juce::AudioChannelSet::stereo(),true)),
+ state(*this,nullptr,"ArSonCompState",layout()) {
+ static_assert(std::atomic::is_always_lock_free);
+ for(std::size_t i=0;iload(std::memory_order_relaxed);
+ return p;
+}
+void Processor::prepareToPlay(double rate,int) { engine.prepare(rate,snapshot()); setLatencySamples(0); }
+bool Processor::isBusesLayoutSupported(const BusesLayout& b) const {
+ const auto main=b.getMainInputChannelSet();
+ if(main!=b.getMainOutputChannelSet() || (main!=juce::AudioChannelSet::mono() && main!=juce::AudioChannelSet::stereo())) return false;
+ const auto side=b.getChannelSet(true,1);
+ return side.isDisabled() || side==juce::AudioChannelSet::mono() || side==juce::AudioChannelSet::stereo();
+}
+void Processor::run(juce::AudioBuffer& buffer,bool hostBypass) {
+ juce::ScopedNoDenormals noDenormals;
+ auto p=snapshot(); if(hostBypass) p.value[arson::Bypass]=1;
+ engine.setParameters(p);
+ auto main=getBusBuffer(buffer,false,0);
+ auto side=getBusBuffer(buffer,true,1);
+ engine.process(main.getArrayOfWritePointers(),main.getNumChannels(),main.getNumSamples(),
+ side.getArrayOfReadPointers(),side.getNumChannels(),&meters);
+}
+void Processor::processBlock(juce::AudioBuffer& b,juce::MidiBuffer&) { run(b,false); }
+void Processor::processBlockBypassed(juce::AudioBuffer& b,juce::MidiBuffer&) { run(b,true); }
+juce::AudioProcessorParameter* Processor::getBypassParameter() const { return state.getParameter("bypass"); }
+juce::AudioProcessorEditor* Processor::createEditor() { return new Editor(*this); }
+void Processor::getStateInformation(juce::MemoryBlock& dest) {
+ auto copy=state.copyState(); copy.setProperty("schema",1,nullptr);
+ if(auto xml=copy.createXml()) copyXmlToBinary(*xml,dest);
+}
+void Processor::setStateInformation(const void* data,int size) {
+ if(size<=0 || size>1024*1024) return;
+ if(auto xml=getXmlFromBinary(data,size)) {
+ auto incoming=juce::ValueTree::fromXml(*xml);
+ if(!incoming.hasType("ArSonCompState") || static_cast(incoming.getProperty("schema",1))!=1) return;
+ // Rebuild known parameter values; reject unknown IDs and non-finite payloads.
+ auto safe=state.copyState();
+ for(int i=0;i(source.getProperty("value"));
+ if(std::isfinite(value)) child.setProperty("value",std::clamp(value,arson::specs[j].min,arson::specs[j].max),nullptr);
+ }
+ }
+ state.replaceState(safe);
+ }
+}
+juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() { return new Processor(); }
diff --git a/plugin/Processor.h b/plugin/Processor.h
new file mode 100644
index 0000000..3f6704b
--- /dev/null
+++ b/plugin/Processor.h
@@ -0,0 +1,35 @@
+#pragma once
+#include
+#include "Compressor.h"
+class Processor final : public juce::AudioProcessor {
+public:
+ Processor();
+ void prepareToPlay(double,int) override;
+ void releaseResources() override {}
+ bool isBusesLayoutSupported(const BusesLayout&) const override;
+ void processBlock(juce::AudioBuffer&,juce::MidiBuffer&) override;
+ void processBlockBypassed(juce::AudioBuffer&,juce::MidiBuffer&) override;
+ juce::AudioProcessorParameter* getBypassParameter() const override;
+ juce::AudioProcessorEditor* createEditor() override;
+ bool hasEditor() const override { return true; }
+ const juce::String getName() const override { return "ArSonComp"; }
+ bool acceptsMidi() const override { return false; }
+ bool producesMidi() const override { return false; }
+ double getTailLengthSeconds() const override { return 0; }
+ int getNumPrograms() override { return 1; }
+ int getCurrentProgram() override { return 0; }
+ void setCurrentProgram(int) override {}
+ const juce::String getProgramName(int) override { return "Default"; }
+ void changeProgramName(int,const juce::String&) override {}
+ void getStateInformation(juce::MemoryBlock&) override;
+ void setStateInformation(const void*,int) override;
+ arson::Parameters snapshot() const noexcept;
+ juce::AudioProcessorValueTreeState state;
+ arson::MeterQueue meters;
+private:
+ static juce::AudioProcessorValueTreeState::ParameterLayout layout();
+ void run(juce::AudioBuffer&,bool hostBypass);
+ std::array*,arson::Count> raw{};
+ arson::Compressor engine;
+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Processor)
+};
diff --git a/plugin/SurfacePaint.h b/plugin/SurfacePaint.h
new file mode 100644
index 0000000..e48035c
--- /dev/null
+++ b/plugin/SurfacePaint.h
@@ -0,0 +1,51 @@
+#pragma once
+#include
+#include
+#include
+
+namespace arson::ui {
+// Resizable brushed gunmetal chassis, painted ONCE into Editor::metalSurface
+// when the plugin dimensions change. No noise, blur, bitmap IO or shader in
+// timerCallback / audio callback. Deterministic scan lines avoid RNG state.
+inline void paintBrushedChassis(juce::Graphics& g, int width, int height) {
+ const float w=static_cast(width),h=static_cast(height);
+ const juce::Colour light{0xff65696b}, dark{0xff383c40};
+ g.setGradientFill(juce::ColourGradient(light,0.0f,0.0f,
+ dark,w,h,false));
+ g.fillRect(0.0f,0.0f,w,h);
+ g.setGradientFill(juce::ColourGradient(
+ juce::Colours::white.withAlpha(0.09f),w*0.16f,0.0f,
+ juce::Colours::black.withAlpha(0.08f),w*0.88f,0.0f,false));
+ g.fillRect(0.0f,0.0f,w,h);
+ // Fine horizontally brushed metal grain. Baked into a single image.
+ for(int y=0;y(y)*2654435761u+1013904223u;
+ const float a=0.026f+static_cast((k>>25)&15u)/1400.0f;
+ g.setColour((k&1u)?juce::Colours::white.withAlpha(a):
+ juce::Colours::black.withAlpha(a*1.45f));
+ g.drawHorizontalLine(y,0.0f,w);
+ }
+ g.setColour(juce::Colours::white.withAlpha(0.085f));
+ g.drawHorizontalLine(1,0.0f,w);
+ g.setColour(juce::Colours::black.withAlpha(0.32f));
+ g.drawHorizontalLine(height-2,0.0f,w);
+}
+
+inline void paintInsetGlass(juce::Graphics& g,juce::Rectangle bounds) {
+ const auto r=bounds.reduced(1.5f);
+ g.setColour(juce::Colours::black.withAlpha(0.58f));
+ g.fillRoundedRectangle(r.translated(0.0f,2.0f),6.0f);
+ g.setColour(juce::Colour{0xff101316});
+ g.fillRoundedRectangle(r,6.0f);
+ g.setGradientFill(juce::ColourGradient(juce::Colour{0xff0d1114},
+ r.getX(),r.getY(),juce::Colour{0xff030607},r.getRight(),r.getBottom(),false));
+ g.fillRoundedRectangle(r.reduced(2.5f),4.8f);
+ g.setColour(juce::Colours::black.withAlpha(0.76f));
+ g.drawRoundedRectangle(r.reduced(1.0f),5.7f,2.1f);
+ g.setColour(juce::Colour{0xff8a9295}.withAlpha(0.42f));
+ g.drawRoundedRectangle(r,6.0f,0.9f);
+ g.setColour(juce::Colours::white.withAlpha(0.08f));
+ g.drawLine(r.getX()+7.0f,r.getY()+3.0f,
+ r.getRight()-7.0f,r.getY()+3.0f,0.8f);
+}
+} // namespace arson::ui
diff --git a/tests/Benchmark.cpp b/tests/Benchmark.cpp
new file mode 100644
index 0000000..d54e34d
--- /dev/null
+++ b/tests/Benchmark.cpp
@@ -0,0 +1,47 @@
+#include "Compressor.h"
+#include
+#include
+#include
+
+// Compare the three causal styles under the same 48-kHz host workload.
+// Each 64-frame block receives an unchanged parameter snapshot, matching
+// how JUCE/APVTS is used during ordinary playback.
+int main() {
+ constexpr int block=64,iterations=50000;
+ float left[block]{},right[block]{},source[block]{};
+ for(int i=0;i(model);
+ p.value[arson::Detector]=1;
+ p.value[arson::AutoRelease]=1;
+ p.value[arson::Highpass]=100;
+ arson::Compressor c;c.prepare(48000,p);
+ arson::MeterQueue q;
+ // Warm up once before timing.
+ for(int j=0;j<128;++j) {
+ for(int i=0;i(
+ std::chrono::steady_clock::now()-start).count();
+ const double frames=static_cast(iterations)*block;
+ checksum+=left[block-1];
+ std::cout<<(model==0?"Clean":model==1?"Feedback":"Smooth")
+ <<" | 48 kHz, stereo, 64 frames/block, RMS/Auto/HP,"
+ <<" host parameter snapshot each block: "
+ <
+#include
+#include
+#include
+#include
+#include
+#include
+std::atomic allocations{0};
+void* operator new(std::size_t n) { allocations.fetch_add(1); if(auto* p=std::malloc(n ? n : 1)) return p; throw std::bad_alloc{}; }
+void* operator new[](std::size_t n) { return ::operator new(n); }
+void operator delete(void* p) noexcept { std::free(p); }
+void operator delete[](void* p) noexcept { std::free(p); }
+void operator delete(void* p,std::size_t) noexcept { std::free(p); }
+void operator delete[](void* p,std::size_t) noexcept { std::free(p); }
+int checks=0;
+void require(bool ok,const char* message) { ++checks;if(!ok) {std::cerr<<"FAIL: "< history{};
+ for(auto& f:history){ f.input=0.5f;f.output=0.25f;f.reduction=6.0f; }
+ std::size_t head=0,aged=0;
+ require(ui::ageStoppedHistory(history,head,aged,6)==6,
+ "first idle graph frame batch");
+ require(head==6 && aged==6 && history[5].input==0,
+ "idle frames written in ring order");
+ require(ui::ageStoppedHistory(history,head,aged,30)==10,
+ "idle frame write capped to ring");
+ require(head==0 && aged==16,"idle graph ring bounded");
+ for(const auto& frame:history)
+ require(frame.input==0 && frame.output==0 && frame.reduction==0,
+ "stopped transport clears frozen history");
+ require(ui::ageStoppedHistory(history,head,aged,30)==0,
+ "silent history stops rebuilding when empty");
+ }
+ require(near(reduction(0,-20,4,0,60),15),"4:1 static curve");
+ require(near(reduction(-20,-20,4,8,60),0.75f),"soft-knee midpoint");
+ require(near(reduction(0,-20,4,0,6),6),"range limit");
+ for(float knee : {0.0f,6.0f,48.0f}) {
+ float previous=-1;
+ for(int i=0;i<=1200;++i) {
+ const float x=-90+i*0.1f,gr=reduction(x,-20,4,knee,36);
+ require(gr>=previous-1e-5f && gr>=0 && gr<=36,"monotonic bounded curve");previous=gr;
+ }
+ for(float boundary : {-20-knee/2,-20+knee/2}) require(std::abs(reduction(boundary-0.0001f,-20,4,knee,36)-reduction(boundary+0.0001f,-20,4,knee,36))<0.001f,"knee continuity");
+ }
+ for(double rate : {44100.0,48000.0,96000.0,192000.0}) {
+ Compressor c; Parameters p;p.value[Threshold]=-20;p.value[Knee]=0;p.value[Attack]=10;
+ c.prepare(rate,p);const int samples=static_cast(rate*0.01);
+ std::vector data(static_cast(samples),1);float* ptr[]{data.data()};
+ c.process(ptr,1,samples);
+ require(near(-gainToDb(data.back()),15*(1-std::exp(-1.0f)),0.02f),"attack time constant across sample rates");
+ data.assign(static_cast(rate),1);ptr[0]=data.data();c.process(ptr,1,static_cast(data.size()));
+ require(near(-gainToDb(data.back()),15,0.02f),"steady compression");
+ }
+ {
+ Compressor c;Parameters p;p.value[Ratio]=1;c.prepare(48000,p);
+ float a[]{1,0,0,0},b[]{0.5f,0,0,0};float* ptr[]{a,b};c.process(ptr,2,4);
+ require(a[0]==1 && b[0]==0.5f && a[1]==0,"impulse no sample delay and unity ratio");
+ }
+ {
+ Compressor c; Parameters p;p.value[Bypass]=1;p.value[Input]=12;p.value[Makeup]=12;c.prepare(48000,p);
+ float a[]{0.123f,-0.4f,0,0.9f};float* ptr[]{a};c.process(ptr,1,4);
+ require(near(a[0],0.123f)&&near(a[1],-0.4f)&&near(a[3],0.9f),"bypass ignores input and makeup");
+ p.value[Bypass]=0;p.value[Input]=0;p.value[Mix]=0;c.prepare(48000,p);
+ float b[]{0.123f,-0.4f};ptr[0]=b;c.process(ptr,1,2);require(b[0]==0.123f && b[1]==-0.4f,"dry mix transparency");
+ }
+ {
+ constexpr int count=8192;std::vector whole(count),split(count);
+ for(int i=0;i a(count,0.05f),b(count,0.025f),side(count,1);
+ float* ptr[]{a.data(),b.data()};const float* sc[]{side.data()};Compressor c;Parameters p;p.value[External]=1;p.value[Threshold]=-20;p.value[Knee]=0;c.prepare(48000,p);
+ c.process(ptr,2,count,sc,1);
+ require(near(a.back()/0.05f,dbToGain(-15),0.001f),"external mono sidechain drives stereo");
+ require(near(a.back(),2*b.back()),"stereo image preserved at full link");
+ c.prepare(48000,p);a.assign(count,0.05f);b.assign(count,0.025f);c.process(ptr,2,count);
+ require(near(a.back(),0.05f),"disconnected external sidechain is silent");
+ p.value[External]=0;p.value[Link]=0;c.prepare(48000,p);a.assign(count,1);b.assign(count,0.01f);c.process(ptr,2,count);
+ require(near(b.back(),0.01f),"unlinked low channel uncompressed");
+ }
+ {
+ // Live filter endpoint and source changes must not create one-sample
+ // steps in Listen SC. Compare the same waveform against an untouched
+ // engine rather than comparing unrelated consecutive waveform samples.
+ const auto transitionStep=[](Param control,float target) {
+ constexpr int n=4096;
+ Parameters p;p.value[Listen]=1;
+ Compressor changed,reference;changed.prepare(48000,p);reference.prepare(48000,p);
+ std::vector a(n),b(n),side(n,-0.25f);
+ for(int i=0;i audio(1024,0.25f),side(1024,-0.25f);
+ float* ap[]{audio.data()};const float* sp[]{side.data()};
+ c.process(ap,1,1024,sp,1);
+ p.value[External]=1;c.setParameters(p);
+ std::fill(audio.begin(),audio.end(),0.25f);
+ c.process(ap,1,1024,sp,1);
+ require(near(audio.back(),-0.25f,0.001f),"sidechain source reaches requested signal after ramp");
+ }
+ {
+ // Three model topologies must produce measurably different transients.
+ const auto sampleAt=[](int model,int length) {
+ Parameters p;p.value[Style]=static_cast(model);
+ p.value[Threshold]=-24;p.value[Ratio]=8;p.value[Attack]=10;
+ p.value[Release]=250;p.value[Knee]=0;
+ Compressor c;c.prepare(48000,p);
+ std::vector a(static_cast(length),1.0f);
+ float* ptr[]{a.data()};c.process(ptr,1,length);return a.back();
+ };
+ const float clean=sampleAt(0,480),feedback=sampleAt(1,480),smooth=sampleAt(2,480);
+ require(feedback>clean+0.02f,"feedback differs from feedforward");
+ require(smooth>clean+0.02f,"dual-pole differs from feedforward");
+ for(float model : {0.0f,1.0f,2.0f}) {
+ Parameters p;p.value[Style]=model;p.value[Threshold]=-25;
+ Compressor a,b;a.prepare(48000,p);b.prepare(48000,p);
+ std::vector whole(4096),split(4096);
+ for(int i=0;i<4096;++i)whole[i]=split[i]=0.7f*std::sin(i*0.14f);
+ float* one[]{whole.data()};a.process(one,1,4096);
+ for(int offset=0;offset<4096;) {
+ const int n=std::min(43,4096-offset);
+ float* part[]{split.data()+offset};b.process(part,1,n);offset+=n;
+ }
+ require(whole==split,"style block partition invariance");
+ }
+ }
+ {
+ // No-op parameter snapshots must preserve ongoing ramps; a host
+ // may re-send unchanged values every 32 samples.
+ Parameters p;p.value[Threshold]=-10;
+ Compressor a,b;a.prepare(48000);b.prepare(48000);
+ a.setParameters(p);b.setParameters(p);
+ std::vector continuous(4096,0.6f),fragmented(4096,0.6f);
+ float* cp[]{continuous.data()};a.process(cp,1,4096);
+ for(int offset=0;offset<4096;offset+=32) {
+ b.setParameters(p);
+ float* fp[]{fragmented.data()+offset};b.process(fp,1,32);
+ }
+ require(continuous==fragmented,"redundant host snapshots preserve sample ramps");
+
+ // Continuous automation with all three models, detector modes,
+ // sidechain filters, bypass and dry/wet must not allocate.
+ Compressor c;c.prepare(48000);
+ float left[64]{},right[64]{};float* audio[]{left,right};
+ const auto before=allocations.load();
+ for(int block=0;block<4000;++block) {
+ Parameters q;
+ q.value[Style]=static_cast(block%3);
+ q.value[Threshold]=-40.0f+static_cast(block%30);
+ q.value[Highpass]=20.0f+static_cast(block%400);
+ q.value[Lowpass]=1000.0f+static_cast(block%12000);
+ q.value[Detector]=static_cast(block%2);
+ q.value[Mix]=static_cast(block%101);
+ q.value[Bypass]=static_cast(block%2);
+ c.setParameters(q);
+ for(int i=0;i<64;++i) {left[i]=0.4f;right[i]=-0.3f;}
+ c.process(audio,2,64);
+ for(int i=0;i<64;++i)require(std::isfinite(left[i])&&std::isfinite(right[i]),"automated output finite");
+ }
+ require(allocations.load()==before,"multi-model automation never allocates");
+ }
+ {
+ Compressor c;Parameters p;for(auto& v:p.value)v=std::numeric_limits::quiet_NaN();c.prepare(0,p);
+ float a[]{std::numeric_limits