diff --git a/AGENTS.md b/AGENTS.md index 75f63e7..4899372 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,3 +19,9 @@ - Default FULL 704x520, minimum 660x490; MINI remains 330 high. Do not increase default GUI size without measuring element collision and user workflow. - Header has no decorative separator rules. Only MODEL and PRESET need small captions; buttons self-label. Maintain >=4.5:1 contrast between static captions and their dark metal background, using the shared palette contract. - Inspect screenshots from compiled JUCE at default/minimum, MINI and SIDECHAIN; preserve readable controls, meters, telemetry, preset and APVTS bindings. GUI changes must never modify engine DSP or latency. + +## M5 original factory bank contract +- New ArSonComp preset content, not a reproduction of FabFilter proprietary .ffp files/settings or proprietary DSP. +- Catalog browser supports real categories/search/tags/description/favorites without consuming additional permanent GUI space. +- Loading a factory program never changes External SC, Listen or Bypass; factory values are sanitized against the canonical parameter table. +- UI favorites persistence is strictly on the message thread, never in DSP. Test every program for finite output, safe bounds and host parameter recall, plus browser screenshot. diff --git a/docs/FACTORY-PRESETS.md b/docs/FACTORY-PRESETS.md new file mode 100644 index 0000000..196faca --- /dev/null +++ b/docs/FACTORY-PRESETS.md @@ -0,0 +1,83 @@ +# ArSonComp Factory Bank v2 — Original presets with calibrated starting makeup + +46 original purpose-built compressor starting points in 10 categories. Every factory program now includes a positive **makeup gain** intended to make the effect audible rather than sounding merely quieter than bypass. + +## Clean +- **Neutral Start** — A balanced starting point. Adjust Threshold for the desired gain reduction. +- **Transparent Control** — Low-ratio, wide-knee compression for natural level regulation. +- **Peak Catch** — Fast peak containment with limited reduction; not a true-peak limiter. +- **Parallel Control** — Parallel compression that retains part of the unprocessed dynamics. + +## Vocals +- **Natural Vocal** — Gentle vocal leveling that preserves breath and consonants. +- **Forward Lead** — Assertive lead vocal control without an excessively fast attack. +- **Broadcast Voice** — Consistent spoken-word loudness with program-dependent release. +- **Intimate Vocal** — Soft program leveling for quiet intimate performances. +- **Rock Lead** — Firm vocal dynamics for dense guitar-driven arrangements. +- **Backing Blend** — Gentle glue for stacked backing vocals and harmonies. + +## Drums +- **Kick Weight** — Maintain kick impact while smoothing excessive body resonance. +- **Snare Snap** — Retain snare crack with a medium attack and lively release. +- **Parallel Smash** — Dense parallel drum energy, dry/wet blended for punch. +- **Room Pump** — Pronounced room-compressor movement for deliberate effect. +- **Drum Bus Glue** — Moderate drum-bus cohesion with transient headroom. +- **Percussion Tame** — Control uneven percussion peaks without flattening expression. + +## Bass +- **Steady Bass** — Control low-note variation and sustain with smooth recovery. +- **Bass Attack** — Preserve front-edge impact with medium attack and release. +- **Synth Bass Control** — Dense synth bass level containment with a smooth knee. +- **Slap Peak Tame** — Control slap and pop spikes while retaining some articulation. + +## Guitar +- **Acoustic Gentle** — Smooth acoustic strumming dynamics without pumping. +- **Electric Rhythm** — Subtle rhythm guitar leveling for consistent mixing. +- **Lead Sustain** — Extend lead-line sustain with more assertive compression. +- **Clean Picking** — Keep picked notes even and articulate. + +## Piano +- **Piano Natural** — Very gentle dynamics for exposed acoustic piano. +- **Pop Piano** — Even pop piano levels while keeping chord attacks lively. +- **Electric Keys** — Controlled sustain for modern electric keyboards. +- **Percussive Keys** — Let piano transients speak through moderate attack. + +## Mixbus +- **Gentle Glue** — 2:1 stereo bus glue with conservative reduction. +- **Forward Mix** — Tighter mix cohesion without crushing the transients. +- **Parallel Mix** — Blend denser bus energy underneath the original. +- **Smooth Program** — Smooth overall dynamic movement for changing material. + +## Mastering +- **Gentle Program** — Subtle final program control; start with only 1–2 dB reduction. +- **Dynamic Preserve** — Protect program transients and limit gain reduction. +- **Density Lift** — Moderate parallel density; not a brickwall limiter. +- **Slow Program** — Slow RMS-based envelope for wide program changes. + +## Special +- **Rhythmic Pump** — Audible rhythmic compression for electronic sources. +- **Hard Clamp** — Aggressive peak reduction; reduce input if distortion appears. +- **Slow Breathing** — Slow rise and recovery for dramatic ambience. +- **NY Parallel** — Dense parallel compression for energetic drums. + +## Live & Broadcast +- **Live Speech** — Low-latency microphone dynamics. No added plugin samples. +- **Live Vocal** — Performance vocal control with conservative artifacts. +- **Podcast Voice** — Natural spoken-word consistency; monitor for pumping. +- **Streaming Bus** — Gentle stereo bus level management for online streaming. +- **Stage Instrument** — Transient-preserving compression for a stage instrument. +- **Radio Presenter** — Firm broadcast speech dynamics with smooth release. + +This bank draws inspiration from the **workflow** of modern professional compressor browsers (categorized presets, search, favorites and descriptions). It is not an import or reproduction of any FabFilter factory .ffp files, DSP algorithms, settings or branding. The styles and settings target ArSonComp's independent Clean, Feedback and Smooth compressor engine. + +IMPORTANT: presets are starting points. Threshold and gain reduction depend on incoming source level. All presets leave external SC, listen, and bypass OFF to prevent unexpected silent/misrouted live audio. Preset loading preserves the current live routing/safety switches. No new DSP latency or audio-thread allocations. + +Reference: https://www.fabfilter.com/help/pro-c/presets/loadingpresets + +## Preset loudness / makeup calibration (October 2026) + +Every factory program receives a deterministic, fixed **starting Makeup gain**, calculated when the static factory bank is initialized (never on the audio thread): estimate static reduction for a reference **−18 dBFS peak** using the exact knee/range/ratio transfer law, weight it by the preset's Mix, then add a modest intentional audible lift. Vocal and live programs allow up to 6 dB, general instruments/buses up to 5.8 dB, mastering up to 3.2 dB, and deliberately aggressive special effects up to 8 dB. Neutral Start now contains real gentle 2.5:1 / −24 dB compression, instead of factory defaults with almost no reference-level gain reduction. + +This is **not** automatic loudness measurement, adaptive normalization, peak limiting, or a guarantee that louder means better. Incoming material with hot peaks can clip later in the DAW or audio interface when makeup is enabled. Reduce Makeup or Input to maintain at least ~3–6 dB of useful monitoring headroom; compare bypass at matched loudness before making critical mix/master decisions. Vocal, karaoke and broadcast presets favor an audible immediately useful lift, whereas mastering deliberately remains conservative. Source level and playing style still affect actual gain reduction. + +Automated smoke checks require all 46 programs to have positive makeup, meaningful static compression at a −12 dBFS peak reference and finite audio below 0 dBFS for a modest nominal test input; these are *bounds*, not a guarantee of no clipping on arbitrary signals. No DSP/latency/host parameter ID or preset schema change. Future calibrated reference WAV and perceptual ABX testing remain pending. diff --git a/docs/GUI-PERFORMANCE.md b/docs/GUI-PERFORMANCE.md index 4709952..3be57d4 100644 --- a/docs/GUI-PERFORMANCE.md +++ b/docs/GUI-PERFORMANCE.md @@ -20,3 +20,7 @@ Technical reference: JUCE developer ADC 2025 session on component hierarchy, opa ## M4 compact and legible isolated LCD Keep the optimized opaque LCD child and idle-repaint coalescing with the new default 704×520 and minimum 660×490. MINI remains 330px high with a 47px meter well. Captions have higher contrast, separator rules are removed, and the new geometry is covered by actual JUCE visual smoke tests. CI CPU timing is not real-device XRUN proof. + +## Compact second pass + +Default window reduced from **704×520 to 612×500** (~16% less screen area); minimum 580×480. The seven main knobs are drawn in 62px-high controls while preserving per-control labels, mouse hit targets and the light gunmetal slider rails. All 5 SIDECHAIN elements reflow inside minimum width with 8px gaps. The isolated opaque LCD and idle repaint coalescing remain unchanged; audio DSP does not depend on window size. diff --git a/docs/WINDOWS-QUICKSTART.md b/docs/WINDOWS-QUICKSTART.md index 8646c80..179c3f1 100644 --- a/docs/WINDOWS-QUICKSTART.md +++ b/docs/WINDOWS-QUICKSTART.md @@ -72,3 +72,17 @@ For MAONO PS22, install the official [PS22 Windows driver and routing tool](http **Isolate the fault before claiming a fix:** (A) PS22 direct monitor (analog baseline, no ArSonComp), (B) unprocessed Windows/DAW input/output, (C) VST3 or Standalone with compressor host-bypassed, (D) compressor active with identical gain and routing. If A has crackles suspect input/cable/hardware; if B/C also crackle suspect driver, buffer, USB or operating-system scheduling; if only D crackles investigate DSP/automation and capture a digital audio recording. A single Task Manager CPU/GPU/memory snapshot is not an xrun measurement. Report driver name, sample rate, buffer, whether Standalone or VST3, and whether bypass removes crackles. A real audio-device test is required. `ARSON_WINDOWS_ASIO=OFF` can be used by downstream builders who cannot accept the Steinberg ASIO SDK's third-party licensing terms; review distribution compliance before a public release. Enabling ASIO does **not** ensure zero hardware latency or prevent all crackles. + +### M5 original factory presets and browser + +The preset dropdown includes **46 original ArSonComp factory starting points** in ten categories: Clean, Vocals, Drums, Bass, Guitar, Piano, Mixbus, Mastering, Special, and Live & Broadcast. Choose **SEARCH / BROWSE PRESETS...** at the top or FILE → Browse factory bank to open the compact in-plugin browser without resizing the editor. + +Search matches name, category, tags and description. Pick a row to see its purpose and author. APPLY auditions without closing; double-click applies and closes; keyboard arrows and Enter apply, Escape closes. STAR/UNSTAR stores stable favorite IDs in the user application data directory, and FAVORITES filters the list. Use the bank's preset list directly for faster navigation. + +Presets are designed for ArSonComp's independent three compressor models, **not** imported FabFilter .ffp programs or claims of matching proprietary factory sounds. Each preset preserves the current External SC, Listen and Bypass switches, so recall never silently changes live routing. Threshold and amount of reduction always depend on the input's actual level; tune to source and loudness-match listening comparisons. FILE Save/Open continues to support the existing .arsoncomp user preset format. + +## Smaller factory-browser GUI (2026-10-31) + +New default FULL window **612×500**, minimum **580×480**; MINI height **320**, retaining the live meter well. Header is a single compact responsive row (100px brand, smaller model/actions, usable preset field). Main rotary controls retain a 62px drag target, and SIDECHAIN HP/LP/detector/EXT/LISTEN widths are calculated from available space to avoid clipping at minimum width. The categorized 46-preset browser remains a transient overlay, not a permanent wide side panel. + +Factory programs now include purpose-specific Makeup starting gain, generally stronger for vocals/live and gentler for mastering. The goal is a noticeable first impression **without silently bypassing dynamics**, not guaranteed louder-is-better or universal headroom safety. Watch the output meter, adjust Input/Makeup and compare Bypass at matched loudness. diff --git a/plugin/Editor.cpp b/plugin/Editor.cpp index f32c003..abf7b7a 100644 --- a/plugin/Editor.cpp +++ b/plugin/Editor.cpp @@ -1,5 +1,6 @@ #include "Editor.h" #include "PresetIO.h" +#include "FactoryPresetBank.h" #include "GraphPaint.h" #include "SurfacePaint.h" #include "GraphHistory.h" @@ -346,11 +347,46 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn 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); + // The header stays small; factory bank is ordered into real categories. + // Search / favorites / details live in a transient overlay, not in toolbar. presets.setComponentID("view.presets"); - presets.onChange=[this] {applyPreset(presets.getSelectedId());}; + presets.addItem("SEARCH / BROWSE PRESETS...",1000); + const auto& bank=arson::preset::factoryBank(); + juce::String lastCategory; + for(std::size_t i=0;i(i)+1); + } + presets.onChange=[this] { + const int id=presets.getSelectedId(); + if(id==1000) { + // Opening and dismissing a browser must NOT lose the currently + // loaded preset title (or a user-restored custom name). + presets.setSelectedId(0,juce::dontSendNotification); + presets.setText(currentPresetTitle,juce::dontSendNotification); + // Open after the native combo popup has completed its selection + // event, so the host cannot immediately reclaim focus/z-order. + // When rendered offscreen (JUCE smoke/headless host), no + // desktop popup exists to dismiss; open synchronously. Real + // visible hosts keep the deferred call to avoid popup z-order. + if(!isShowing()) { + openPresetBrowser(); + } else { + juce::Component::SafePointer safe(this); + juce::MessageManager::callAsync([safe] { + if(auto* editor=safe.getComponent()) + editor->openPresetBrowser(); + }); + } + } else if(id>0) applyPreset(id); + }; addAndMakeVisible(presets); + presetBrowser.setComponentID("view.preset.browser"); + addChildComponent(presetBrowser); detector.addItemList({"Peak","RMS"},1); detector.setComponentID("view.detector"); addAndMakeVisible(detector); @@ -375,8 +411,9 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn for(std::size_t i=0;ipresetSnapshot=editor->processor.snapshot(); editor->presets.setSelectedId(0,juce::dontSendNotification); - editor->presets.setText(file.getFileNameWithoutExtension(),juce::dontSendNotification); + editor->currentPresetTitle=file.getFileNameWithoutExtension(); + editor->presets.setText(editor->currentPresetTitle,juce::dontSendNotification); editor->cachedCurveKey[0]=999; editor->repaint(); } @@ -438,12 +476,15 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn juce::PopupMenu menu; menu.addItem(1,"Save preset..."); menu.addItem(2,"Open preset..."); + menu.addSeparator(); + menu.addItem(3,"Browse factory bank..."); 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(); + else if(item==3)editor->openPresetBrowser(); } }); }; @@ -485,8 +526,9 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn updateHoverReadout(hoveredParameter); arson::MeterFrame discard; for(std::uint32_t i=0;i=0)favorites[static_cast(index)]=true; + } + } + favoritesOnly.onClick=[this] { + showOnlyFavorites=!showOnlyFavorites; + favoritesOnly.setButtonText(showOnlyFavorites?"ALL":"FAVORITES"); + rebuildFilter(); + }; + star.onClick=[this] { + const int row=resultList.getSelectedRow(); + if(row<0 || static_cast(row)>=matches.size())return; + const auto i=static_cast(matches[static_cast(row)]); + favorites[i]=!favorites[i]; + persistFavorites(); + if(showOnlyFavorites && !favorites[i])rebuildFilter(); + else {resultList.repaint();showDetails();} + }; + use.onClick=[this]{applySelected(false);}; + close.onClick=[this]{setVisible(false);}; + rebuildFilter(); +} +Editor::PresetBrowser::~PresetBrowser(){resultList.setModel(nullptr);} +void Editor::PresetBrowser::open() { + search.clear(); + showOnlyFavorites=false; + favoritesOnly.setButtonText("FAVORITES"); + rebuildFilter(); + setVisible(true); + toFront(true); + search.grabKeyboardFocus(); +} +void Editor::PresetBrowser::persistFavorites() const { + const auto file=juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory) + .getChildFile("ArSonAudio/ArSonComp/favorites.txt"); + if(file.getParentDirectory().createDirectory().failed())return; + juce::String data; + const auto& bank=arson::preset::factoryBank(); + for(std::size_t i=0;i(i)); + } + resultList.updateContent(); + if(!matches.empty())resultList.selectRow(0); + else resultList.deselectAllRows(); + subheading.setText(juce::String(matches.size())+" of "+ + juce::String(bank.size())+" presets",juce::dontSendNotification); + showDetails(); +} +int Editor::PresetBrowser::getNumRows(){return static_cast(matches.size());} +void Editor::PresetBrowser::paintListBoxItem(int row,juce::Graphics& g, + int width,int height,bool selected) { + if(row<0||static_cast(row)>=matches.size())return; + const auto index=static_cast(matches[static_cast(row)]); + const auto& p=arson::preset::factoryBank()[index]; + if(selected)g.fillAll(juce::Colour{0xff344b56}); + else if(row%2==0)g.fillAll(juce::Colour{0xff172025}); + g.setFont(juce::FontOptions(10.5f)); + g.setColour(juce::Colour{0xffb9c5cb}); + g.drawText(p.category,9,0,93,height,juce::Justification::centredLeft,true); + g.setColour(juce::Colour{0xffeef2f3}); + g.setFont(juce::FontOptions(11.0f)); + g.drawText(p.name,106,0,juce::jmax(0,width-130),height, + juce::Justification::centredLeft,true); + if(favorites[index]){ + g.setColour(juce::Colour{0xffedc579}); + g.drawText("*",width-21,0,15,height,juce::Justification::centred); + } +} +void Editor::PresetBrowser::selectedRowsChanged(int){showDetails();} +void Editor::PresetBrowser::showDetails(){ + const int row=resultList.getSelectedRow(); + if(row<0||static_cast(row)>=matches.size()){ + detail.setText("No matching presets",false); + star.setEnabled(false);use.setEnabled(false);return; + } + const auto i=static_cast(matches[static_cast(row)]); + const auto& p=arson::preset::factoryBank()[i]; + detail.setText(juce::String(p.name)+"\n"+p.category+ + " | ArSon Audio\n\n"+p.description+ + "\n\nTags: "+p.tags+ + "\n\nStart here; adjust threshold for the source level.",false); + star.setButtonText(favorites[i]?"UNSTAR":"STAR"); + star.setEnabled(true);use.setEnabled(true); +} +void Editor::PresetBrowser::applySelected(bool closeAfter){ + const int row=resultList.getSelectedRow(); + if(row<0||static_cast(row)>=matches.size())return; + owner.applyPreset(matches[static_cast(row)]+1); + if(closeAfter)setVisible(false); +} +void Editor::PresetBrowser::listBoxItemDoubleClicked(int row,const juce::MouseEvent&) { + if(row>=0&&static_cast(row)beginChangeGesture(); @@ -540,25 +755,26 @@ void Editor::setValue(std::size_t i,float value) { } } 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(id)>bank.size())return; + const auto& p=bank[static_cast(id)-1]; + // Keep the safety-critical live routing/bypass state unchanged. These + // user switches must never be set merely by auditioning a factory sound. + for(std::size_t i=0;i{12,61,getWidth()-24, + juce::jmax(220,getHeight()-73)}); + presetBrowser.open(); } juce::Rectangle Editor::plotBounds() const noexcept { if(compactMode || display.isEmpty())return {}; @@ -597,6 +813,7 @@ void Editor::resized() { compact.setBounds(header.mini); style.setBounds(header.model); presets.setBounds(header.preset); + presetBrowser.setBounds(12,61,w-24,juce::jmax(220,h-73)); compare.setBounds(header.compare); fileMenu.setBounds(header.file); bypass.setBounds(header.bypass); @@ -611,7 +828,7 @@ void Editor::resized() { 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); + knobs[i].setBounds(x+3,mainY+20,cell-6,62); } const int bottomY=compactMode?166: @@ -633,10 +850,12 @@ void Editor::resized() { 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); + // Allocate all SIDECHAIN columns inside the 580px minimum width. + const int usable=available-3*8; + const int filterSlot=usable*23/100; + const int detW=usable*17/100; + const int extW=usable*19/100; + const int listenW=usable-2*filterSlot-detW-extW; const int filterStart=16; for(std::size_t k=0;k(k)*filterSlot; @@ -728,8 +947,9 @@ void Editor::timerCallback() { for(std::size_t i=0;i0.001f) { + currentPresetTitle="Custom"; presets.setSelectedId(0,juce::dontSendNotification); - presets.setText("Custom",juce::dontSendNotification); + presets.setText(currentPresetTitle,juce::dontSendNotification); break; } } diff --git a/plugin/Editor.h b/plugin/Editor.h index 783be7c..a8e2f91 100644 --- a/plugin/Editor.h +++ b/plugin/Editor.h @@ -1,5 +1,7 @@ #pragma once #include "Processor.h" +#include "FactoryPresetBank.h" +#include #include #include class CompLook final : public juce::LookAndFeel_V4 { @@ -35,6 +37,37 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { void mouseMove(const juce::MouseEvent&) override; void mouseEnter(const juce::MouseEvent&) override; private: + // Compact multi-category audition/search browser on the message thread. + // Owns only GUI state and a bounded factory index; never touches DSP. + class PresetBrowser final : public juce::Component, + private juce::ListBoxModel, + private juce::KeyListener { + public: + explicit PresetBrowser(Editor&); + ~PresetBrowser() override; + void paint(juce::Graphics&) override; + void resized() override; + void open(); + int getNumRows() override; + void paintListBoxItem(int,juce::Graphics&,int,int,bool) override; + void selectedRowsChanged(int) override; + void listBoxItemDoubleClicked(int,const juce::MouseEvent&) override; + bool keyPressed(const juce::KeyPress&,juce::Component*) override; + private: + void rebuildFilter(); + void showDetails(); + void applySelected(bool closeAfter); + void persistFavorites() const; + Editor& owner; + juce::TextEditor search,detail; + juce::Label heading,subheading; + juce::ListBox resultList; + juce::TextButton favoritesOnly{"FAVORITES"}, + star{"STAR"},use{"APPLY"},close{"CLOSE"}; + std::vector matches; + std::vector favorites; + bool showOnlyFavorites=false; + }; class GraphCanvas final : public juce::Component { public: explicit GraphCanvas(Editor& p) : owner(p) { @@ -51,6 +84,7 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { }; void timerCallback() override; void applyPreset(int); + void openPresetBrowser(); void setValue(std::size_t,float); void drawDisplay(juce::Graphics&); juce::Rectangle plotBounds() const noexcept; @@ -67,6 +101,7 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { std::array knobs; std::array labels; GraphCanvas graphCanvas{*this}; + PresetBrowser presetBrowser{*this}; juce::Label hoverReadout; std::size_t hoveredParameter=arson::Threshold; using SliderAttachment=juce::AudioProcessorValueTreeState::SliderAttachment; @@ -80,9 +115,10 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { std::unique_ptr detectorAttachment,styleAttachment; std::unique_ptr presetChooser; arson::Parameters alternate, presetSnapshot; + juce::String currentPresetTitle{"Custom / restored"}; bool alternateActive=false; bool compactMode=false,thresholdDragging=false,sidechainPanel=false; - int expandedWidth=704,expandedHeight=520; + int expandedWidth=612,expandedHeight=500; std::array history{}; std::size_t head=0; float inputDb=-120,outputDb=-120,gr=0; diff --git a/plugin/FactoryPresetBank.h b/plugin/FactoryPresetBank.h new file mode 100644 index 0000000..41fdd2b --- /dev/null +++ b/plugin/FactoryPresetBank.h @@ -0,0 +1,104 @@ +#pragma once +#include "Parameters.h" +#include +#include +#include +#include + +namespace arson::preset { +struct FactoryPreset { + const char* id; + const char* category; + const char* name; + const char* tags; + const char* description; + Parameters settings; +}; +inline FactoryPreset make(const char* id,const char* group,const char* name, + const char* tags,const char* description, + std::initializer_list> changes) { + FactoryPreset v{id,group,name,tags,description,Parameters{}}; + for(const auto& entry:changes)v.settings.value[entry.first]=entry.second; + // Factory programs must never silently turn on external sidechain, + // monitoring or bypass (surprising silent/misrouted live audio). + v.settings.value[External]=0.0f; + v.settings.value[Listen]=0.0f; + v.settings.value[Bypass]=0.0f; + // Factory makeup is an intentional *starting* compensation, not + // automatic loudness normalization and never a limiter. For a nominal + // -18 dBFS reference, estimate static GR with the actual compressor + // transfer law, scale by wet mix, and add a conservative audible lift. + // All work happens once when the factory catalog is first built on + // the message thread, not in the audio callback. + const std::string_view category(group); + const bool mastering=category=="Mastering"; + const bool voice=category=="Vocals" || category=="Live & Broadcast"; + const bool effects=category=="Special"; + const float referenceGr=reduction(-18.0f,v.settings[Threshold], + v.settings[Ratio],v.settings[Knee],v.settings[Range]); + const float wet=v.settings[Mix]*0.01f; + const float lift=mastering ? 0.85f : voice ? 1.55f : effects ? 1.30f : 1.35f; + const float maximum=mastering ? 3.2f : effects ? 8.0f : voice ? 6.0f : 5.8f; + v.settings.value[Makeup]=std::clamp(lift + 0.82f*referenceGr*wet, + lift,maximum); + v.settings.sanitize(); + return v; +} +inline const std::vector& factoryBank() { + static const std::vector bank={ + make("neutral-start","Clean","Neutral Start","clean neutral transparent","A clear, audible starter with moderate leveling and compensated output.", {{Threshold,-24.0f},{Ratio,2.5f},{Attack,16.0f},{Release,170.0f},{Knee,10.0f},{Range,12.0f}}), + make("smooth-transparent","Clean","Transparent Control","clean smooth subtle","Low-ratio, wide-knee compression for natural level regulation.", {{Threshold,-21.0f}, {Ratio,1.8f}, {Attack,28.0f}, {Release,240.0f}, {Knee,18.0f}, {Range,12.0f}, {Style,2.0f}}), + make("peak-catcher","Clean","Peak Catch","clean peaks transient","Fast peak containment with limited reduction; not a true-peak limiter.", {{Threshold,-16.0f}, {Ratio,5.0f}, {Attack,1.5f}, {Release,75.0f}, {Knee,3.0f}, {Range,10.0f}, {Detector,0.0f}}), + make("parallel-preserve","Clean","Parallel Control","parallel clean transient","Parallel compression that retains part of the unprocessed dynamics.", {{Threshold,-25.0f}, {Ratio,5.0f}, {Attack,12.0f}, {Release,140.0f}, {Knee,8.0f}, {Mix,50.0f}, {Range,18.0f}}), + make("vocal-natural","Vocals","Natural Vocal","vocal singer smooth","Gentle vocal leveling that preserves breath and consonants.", {{Threshold,-25.0f}, {Ratio,2.4f}, {Attack,13.0f}, {Release,150.0f}, {Knee,12.0f}, {Range,10.0f}, {Style,2.0f}, {AutoRelease,1.0f}}), + make("vocal-forward","Vocals","Forward Lead","vocal lead presence","Assertive lead vocal control without an excessively fast attack.", {{Threshold,-28.0f}, {Ratio,3.5f}, {Attack,7.0f}, {Release,110.0f}, {Knee,9.0f}, {Range,16.0f}, {Highpass,95.0f}, {Style,0.0f}}), + make("vocal-broadcast","Vocals","Broadcast Voice","vocal podcast speech","Consistent spoken-word loudness with program-dependent release.", {{Threshold,-30.0f}, {Ratio,3.2f}, {Attack,4.0f}, {Release,180.0f}, {Knee,10.0f}, {Range,16.0f}, {Detector,1.0f}, {AutoRelease,1.0f}, {Highpass,90.0f}, {Style,2.0f}}), + make("vocal-intimate","Vocals","Intimate Vocal","vocal intimate soft","Soft program leveling for quiet intimate performances.", {{Threshold,-29.0f}, {Ratio,2.2f}, {Attack,18.0f}, {Release,250.0f}, {Knee,20.0f}, {Range,9.0f}, {Detector,1.0f}, {Style,2.0f}}), + make("vocal-rock","Vocals","Rock Lead","vocal rock firm","Firm vocal dynamics for dense guitar-driven arrangements.", {{Threshold,-25.0f}, {Ratio,4.5f}, {Attack,5.0f}, {Release,90.0f}, {Knee,6.0f}, {Range,20.0f}, {Highpass,110.0f}, {Style,1.0f}}), + make("vocal-backing","Vocals","Backing Blend","vocal harmony bus","Gentle glue for stacked backing vocals and harmonies.", {{Threshold,-23.0f}, {Ratio,2.5f}, {Attack,23.0f}, {Release,220.0f}, {Knee,13.0f}, {Range,10.0f}, {Style,2.0f}, {Link,100.0f}}), + make("drum-kick","Drums","Kick Weight","drums kick body","Maintain kick impact while smoothing excessive body resonance.", {{Threshold,-20.0f}, {Ratio,4.0f}, {Attack,20.0f}, {Release,95.0f}, {Knee,5.0f}, {Range,14.0f}, {Highpass,35.0f}, {Style,1.0f}}), + make("drum-snare","Drums","Snare Snap","drums snare attack","Retain snare crack with a medium attack and lively release.", {{Threshold,-22.0f}, {Ratio,4.0f}, {Attack,16.0f}, {Release,85.0f}, {Knee,4.0f}, {Range,15.0f}, {Style,0.0f}}), + make("drum-parallel","Drums","Parallel Smash","drums parallel heavy","Dense parallel drum energy, dry/wet blended for punch.", {{Threshold,-34.0f}, {Ratio,9.0f}, {Attack,3.0f}, {Release,65.0f}, {Knee,5.0f}, {Range,30.0f}, {Mix,45.0f}, {Style,1.0f}}), + make("drum-room","Drums","Room Pump","drums room character","Pronounced room-compressor movement for deliberate effect.", {{Threshold,-31.0f}, {Ratio,6.0f}, {Attack,8.0f}, {Release,170.0f}, {Knee,4.0f}, {Range,24.0f}, {Style,1.0f}}), + make("drum-bus","Drums","Drum Bus Glue","drums bus glue","Moderate drum-bus cohesion with transient headroom.", {{Threshold,-21.0f}, {Ratio,2.5f}, {Attack,28.0f}, {Release,140.0f}, {Knee,7.0f}, {Range,10.0f}, {Link,90.0f}, {Style,0.0f}}), + make("drum-perc","Drums","Percussion Tame","drums percussion peak","Control uneven percussion peaks without flattening expression.", {{Threshold,-23.0f}, {Ratio,3.3f}, {Attack,4.0f}, {Release,110.0f}, {Knee,10.0f}, {Range,12.0f}, {Style,2.0f}}), + make("bass-steady","Bass","Steady Bass","bass controlled even","Control low-note variation and sustain with smooth recovery.", {{Threshold,-25.0f}, {Ratio,3.5f}, {Attack,16.0f}, {Release,180.0f}, {Knee,10.0f}, {Range,14.0f}, {Detector,1.0f}, {Style,2.0f}}), + make("bass-punch","Bass","Bass Attack","bass attack punch","Preserve front-edge impact with medium attack and release.", {{Threshold,-21.0f}, {Ratio,4.0f}, {Attack,25.0f}, {Release,125.0f}, {Knee,6.0f}, {Range,16.0f}, {Style,0.0f}}), + make("bass-synth","Bass","Synth Bass Control","bass synth electronic","Dense synth bass level containment with a smooth knee.", {{Threshold,-28.0f}, {Ratio,4.5f}, {Attack,9.0f}, {Release,160.0f}, {Knee,12.0f}, {Range,20.0f}, {Detector,1.0f}, {Style,2.0f}}), + make("bass-slap","Bass","Slap Peak Tame","bass slap transient","Control slap and pop spikes while retaining some articulation.", {{Threshold,-20.0f}, {Ratio,5.0f}, {Attack,3.0f}, {Release,90.0f}, {Knee,4.0f}, {Range,14.0f}, {Style,0.0f}}), + make("guitar-acoustic","Guitar","Acoustic Gentle","guitar acoustic natural","Smooth acoustic strumming dynamics without pumping.", {{Threshold,-24.0f}, {Ratio,2.1f}, {Attack,23.0f}, {Release,180.0f}, {Knee,15.0f}, {Range,10.0f}, {Style,2.0f}}), + make("guitar-electric","Guitar","Electric Rhythm","guitar electric rhythm","Subtle rhythm guitar leveling for consistent mixing.", {{Threshold,-22.0f}, {Ratio,2.7f}, {Attack,15.0f}, {Release,135.0f}, {Knee,9.0f}, {Range,10.0f}, {Style,0.0f}}), + make("guitar-lead","Guitar","Lead Sustain","guitar solo sustain","Extend lead-line sustain with more assertive compression.", {{Threshold,-28.0f}, {Ratio,4.0f}, {Attack,6.0f}, {Release,220.0f}, {Knee,8.0f}, {Range,19.0f}, {Style,1.0f}}), + make("guitar-clean","Guitar","Clean Picking","guitar clean fingerstyle","Keep picked notes even and articulate.", {{Threshold,-26.0f}, {Ratio,2.8f}, {Attack,11.0f}, {Release,150.0f}, {Knee,14.0f}, {Range,12.0f}, {Style,2.0f}}), + make("piano-classical","Piano","Piano Natural","piano classical transparent","Very gentle dynamics for exposed acoustic piano.", {{Threshold,-19.0f}, {Ratio,1.6f}, {Attack,37.0f}, {Release,310.0f}, {Knee,22.0f}, {Range,7.0f}, {Style,2.0f}}), + make("piano-pop","Piano","Pop Piano","piano pop even","Even pop piano levels while keeping chord attacks lively.", {{Threshold,-25.0f}, {Ratio,2.5f}, {Attack,20.0f}, {Release,180.0f}, {Knee,12.0f}, {Range,12.0f}, {Style,0.0f}}), + make("piano-keys","Piano","Electric Keys","piano keys electric","Controlled sustain for modern electric keyboards.", {{Threshold,-27.0f}, {Ratio,3.0f}, {Attack,12.0f}, {Release,195.0f}, {Knee,11.0f}, {Range,14.0f}, {Style,2.0f}}), + make("piano-percussive","Piano","Percussive Keys","piano keyboard transient","Let piano transients speak through moderate attack.", {{Threshold,-20.0f}, {Ratio,3.0f}, {Attack,31.0f}, {Release,125.0f}, {Knee,8.0f}, {Range,12.0f}, {Style,0.0f}}), + make("mix-glue","Mixbus","Gentle Glue","mixbus stereo glue","2:1 stereo bus glue with conservative reduction.", {{Threshold,-18.0f}, {Ratio,2.0f}, {Attack,30.0f}, {Release,260.0f}, {Knee,13.0f}, {Range,6.0f}, {Link,100.0f}, {Style,2.0f}}), + make("mix-forward","Mixbus","Forward Mix","mixbus pop rock","Tighter mix cohesion without crushing the transients.", {{Threshold,-21.0f}, {Ratio,2.5f}, {Attack,22.0f}, {Release,180.0f}, {Knee,9.0f}, {Range,9.0f}, {Link,100.0f}, {Style,1.0f}}), + make("mix-parallel","Mixbus","Parallel Mix","mixbus parallel energy","Blend denser bus energy underneath the original.", {{Threshold,-27.0f}, {Ratio,4.0f}, {Attack,14.0f}, {Release,140.0f}, {Knee,8.0f}, {Range,16.0f}, {Mix,55.0f}, {Link,100.0f}}), + make("mix-smooth","Mixbus","Smooth Program","mixbus smooth balance","Smooth overall dynamic movement for changing material.", {{Threshold,-20.0f}, {Ratio,1.7f}, {Attack,37.0f}, {Release,350.0f}, {Knee,20.0f}, {Range,6.0f}, {Detector,1.0f}, {AutoRelease,1.0f}, {Style,2.0f}}), + make("master-gentle","Mastering","Gentle Program","mastering transparent low-gr","Subtle final program control; start with only 1–2 dB reduction.", {{Threshold,-15.0f}, {Ratio,1.4f}, {Attack,45.0f}, {Release,450.0f}, {Knee,24.0f}, {Range,4.0f}, {Style,2.0f}, {Link,100.0f}}), + make("master-dynamic","Mastering","Dynamic Preserve","mastering transient preserve","Protect program transients and limit gain reduction.", {{Threshold,-17.0f}, {Ratio,1.7f}, {Attack,55.0f}, {Release,340.0f}, {Knee,15.0f}, {Range,5.0f}, {Style,0.0f}, {Link,100.0f}}), + make("master-density","Mastering","Density Lift","mastering parallel density","Moderate parallel density; not a brickwall limiter.", {{Threshold,-22.0f}, {Ratio,2.6f}, {Attack,26.0f}, {Release,290.0f}, {Knee,14.0f}, {Range,8.0f}, {Mix,65.0f}, {Style,2.0f}}), + make("master-smooth","Mastering","Slow Program","mastering rms long","Slow RMS-based envelope for wide program changes.", {{Threshold,-17.0f}, {Ratio,1.5f}, {Attack,65.0f}, {Release,600.0f}, {Knee,22.0f}, {Range,5.0f}, {Detector,1.0f}, {AutoRelease,1.0f}, {Style,2.0f}}), + make("special-pumping","Special","Rhythmic Pump","effect electronic pumping","Audible rhythmic compression for electronic sources.", {{Threshold,-34.0f}, {Ratio,7.0f}, {Attack,1.0f}, {Release,300.0f}, {Knee,2.0f}, {Range,26.0f}, {Style,1.0f}}), + make("special-crush","Special","Hard Clamp","effect aggressive hard","Aggressive peak reduction; reduce input if distortion appears.", {{Threshold,-35.0f}, {Ratio,12.0f}, {Attack,0.3f}, {Release,60.0f}, {Knee,0.0f}, {Range,35.0f}, {Style,0.0f}}), + make("special-movement","Special","Slow Breathing","effect evolving ambient","Slow rise and recovery for dramatic ambience.", {{Threshold,-30.0f}, {Ratio,4.0f}, {Attack,150.0f}, {Release,950.0f}, {Knee,20.0f}, {Range,22.0f}, {Style,2.0f}}), + make("special-ny-parallel","Special","NY Parallel","effect drums ny","Dense parallel compression for energetic drums.", {{Threshold,-31.0f}, {Ratio,7.0f}, {Attack,5.0f}, {Release,95.0f}, {Knee,7.0f}, {Range,25.0f}, {Mix,35.0f}, {Style,1.0f}}), + make("live-speech","Live & Broadcast","Live Speech","live speech mic low-latency","Low-latency microphone dynamics. No added plugin samples.", {{Threshold,-24.0f}, {Ratio,3.0f}, {Attack,8.0f}, {Release,140.0f}, {Knee,12.0f}, {Range,12.0f}, {Highpass,110.0f}, {Style,2.0f}, {AutoRelease,1.0f}}), + make("live-vocal","Live & Broadcast","Live Vocal","live vocal karaoke mic","Performance vocal control with conservative artifacts.", {{Threshold,-24.0f}, {Ratio,3.0f}, {Attack,12.0f}, {Release,150.0f}, {Knee,10.0f}, {Range,14.0f}, {Highpass,100.0f}, {Style,2.0f}, {AutoRelease,1.0f}}), + make("live-podcast","Live & Broadcast","Podcast Voice","broadcast podcast conversation","Natural spoken-word consistency; monitor for pumping.", {{Threshold,-29.0f}, {Ratio,3.5f}, {Attack,5.0f}, {Release,200.0f}, {Knee,12.0f}, {Range,16.0f}, {Detector,1.0f}, {AutoRelease,1.0f}, {Highpass,95.0f}, {Style,2.0f}}), + make("live-stream","Live & Broadcast","Streaming Bus","broadcast stream stereo","Gentle stereo bus level management for online streaming.", {{Threshold,-20.0f}, {Ratio,2.1f}, {Attack,25.0f}, {Release,230.0f}, {Knee,15.0f}, {Range,9.0f}, {Style,2.0f}, {Link,100.0f}}), + make("live-instrument","Live & Broadcast","Stage Instrument","live instrument guitar","Transient-preserving compression for a stage instrument.", {{Threshold,-23.0f}, {Ratio,3.0f}, {Attack,20.0f}, {Release,135.0f}, {Knee,8.0f}, {Range,13.0f}, {Style,0.0f}}), + make("live-radio","Live & Broadcast","Radio Presenter","broadcast radio voice","Firm broadcast speech dynamics with smooth release.", {{Threshold,-30.0f}, {Ratio,4.0f}, {Attack,4.0f}, {Release,210.0f}, {Knee,14.0f}, {Range,20.0f}, {Detector,1.0f}, {Highpass,120.0f}, {AutoRelease,1.0f}, {Style,2.0f}}) + }; + return bank; +} +inline int findFactoryId(std::string_view id) { + const auto& presets=factoryBank(); + for(std::size_t i=0;i(i); + return -1; +} +} // namespace arson::preset diff --git a/plugin/HeaderLayout.h b/plugin/HeaderLayout.h index 92b3b9f..c9b1e4a 100644 --- a/plugin/HeaderLayout.h +++ b/plugin/HeaderLayout.h @@ -7,13 +7,15 @@ namespace arson::ui { // Keep actual controls comfortably sized; remove blank canvas before scaling // text/knobs down. Reused by the editor renderer and the Windows smoke tests. struct EditorMetrics { - static constexpr int minWidth=660, minHeight=490; - static constexpr int defaultWidth=704, defaultHeight=520; - static constexpr int maxWidth=1040, maxHeight=780; - static constexpr int miniHeight=330; // preserve MINI meter readability + // Dense-but-usable hardware UI: 612px default instead of 704px. + // Main knobs keep a 62px drawing/drag target and readable 11px captions. + static constexpr int minWidth=580, minHeight=480; + static constexpr int defaultWidth=612, defaultHeight=500; + static constexpr int maxWidth=1000, maxHeight=760; + static constexpr int miniHeight=320; static constexpr int headerHeight=62, displayTop=64; - static constexpr int displayBottomReserve=260; - static constexpr int bottomControlsReserve=92; + static constexpr int displayBottomReserve=254; + static constexpr int bottomControlsReserve=86; static constexpr juce::uint32 captionRgb=0xffd9e0e3; static constexpr juce::uint32 controlCaptionRgb=0xffe4e9ec; static constexpr juce::uint32 headerBackgroundRgb=0xff292d30; @@ -24,19 +26,21 @@ struct HeaderLayout { juce::Rectangle logo,mini,model,preset,compare,file,bypass; static HeaderLayout calculate(int width) noexcept { - constexpr int inset=12,gap=8; - constexpr int logoW=126,miniW=42,modelW=96,compareW=40,fileW=44,bypassW=110; + // One-row responsive grid with a compact logo and right-anchored + // actions, so long preset names remain accessible via the browser. + constexpr int inset=10,gap=6; + constexpr int logoW=88,miniW=50,modelW=86; + constexpr int compareW=38,fileW=38,bypassW=100; constexpr int fixed=logoW+miniW+modelW+compareW+fileW+bypassW; const int available=width-2*inset-6*gap-fixed; - const int presetW=juce::jlimit(124,154,available); + const int presetW=juce::jlimit(124,148,available); constexpr int top=22,height=27; HeaderLayout h; int x=inset; - h.logo={x,17,logoW,29};x+=logoW+gap; + h.logo={x,17,logoW,28};x+=logoW+gap; h.mini={x,top,miniW,height};x+=miniW+gap; h.model={x,top,modelW,height};x+=modelW+gap; h.preset={x,top,presetW,height}; - // Reserve the right actions; extra width becomes breathing room. h.bypass={width-inset-bypassW,top,bypassW,height}; h.file={h.bypass.getX()-gap-fileW,top,fileW,height}; h.compare={h.file.getX()-gap-compareW,top,compareW,height}; diff --git a/tests/PluginSmoke.cpp b/tests/PluginSmoke.cpp index ea469ce..52c2613 100644 --- a/tests/PluginSmoke.cpp +++ b/tests/PluginSmoke.cpp @@ -2,6 +2,7 @@ #include "../plugin/Editor.h" #include "../plugin/HeaderLayout.h" #include "../plugin/PresetIO.h" +#include "../plugin/FactoryPresetBank.h" #include "../plugin/GraphPaint.h" #include "../plugin/SurfacePaint.h" #include "BinaryData.h" @@ -11,7 +12,9 @@ #include #include #include -int main(int argc,char** argv) { +#include +#include +static int runSmoke(int argc,char** argv) { juce::ScopedJuceInitialiser_GUI gui; #if JUCE_WINDOWS // The standalone must offer native low-latency ASIO (e.g. Maono PS22) @@ -386,6 +389,59 @@ int main(int argc,char** argv) { return 51; } } + // All 46 original factory programs: unique IDs, safe bounds, finite DSP. + { + const auto& bank=arson::preset::factoryBank(); + if(bank.size()!=46)return 73; + std::set ids,categories; + for(const auto& entry:bank) { + if(!ids.insert(entry.id).second || !entry.category[0] || + !entry.name[0] || !entry.description[0])return 74; + categories.insert(entry.category); + auto normalized=entry.settings; + normalized.sanitize(); + if(normalized.value!=entry.settings.value || + entry.settings[arson::External]!=0 || + entry.settings[arson::Listen]!=0 || + entry.settings[arson::Bypass]!=0)return 75; + if(arson::preset::findFactoryId(entry.id)<0)return 76; + // Factory compensation must be positive, effective and bounded. + if(entry.settings[arson::Makeup]<0.84f || + entry.settings[arson::Makeup]>8.01f || + arson::reduction(-12.0f,entry.settings[arson::Threshold], + entry.settings[arson::Ratio],entry.settings[arson::Knee], + entry.settings[arson::Range])<0.25f)return 82; + { + arson::Compressor calibrated; + calibrated.prepare(48000.0,entry.settings); + std::array testL{},testR{}; + float* ab[]{testL.data(),testR.data()}; + float peak=0.0f; + for(int block=0;block<80;++block) { + for(int i=0;i<128;++i) { + testL[i]=0.18f*std::sin((block*128+i)*0.051f); + testR[i]=0.14f*std::cos((block*128+i)*0.073f); + } + calibrated.process(ab,2,128); + for(int i=0;i<128;++i) + peak=std::max(peak,std::max(std::abs(testL[i]),std::abs(testR[i]))); + } + if(!std::isfinite(peak) || peak>0.95f)return 83; + } + arson::Compressor engine; + engine.prepare(48000.0,entry.settings); + std::array left{},right{}; + for(int i=0;i<128;++i) { + left[i]=0.34f*std::sin(i*0.091f); + right[i]=0.22f*std::cos(i*0.11f); + } + float* audio[]{left.data(),right.data()}; + engine.process(audio,2,128); + for(int i=0;i<128;++i) + if(!std::isfinite(left[i])||!std::isfinite(right[i]))return 77; + } + if(categories.size()!=10)return 78; + } Processor processor;processor.prepareToPlay(48000,128); if(processor.getLatencySamples()!=0) return 1; auto* parameter=processor.state.getParameter("threshold");parameter->setValueNotifyingHost(parameter->convertTo0to1(-27)); @@ -433,15 +489,15 @@ int main(int argc,char** argv) { return 66; } // Header invariants for minimum, default, legacy and maximum widths. - for(const int width : {660,704,780,1040}) { + for(const int width : {580,612,704,1000}) { const auto h=arson::ui::HeaderLayout::calculate(width); const std::array,7> fields{ h.logo,h.mini,h.model,h.preset,h.compare,h.file,h.bypass}; - if(h.preset.getWidth()<124||h.preset.getWidth()>154|| - h.bypass.getRight()!=width-12||h.logo.getX()!=12)return 62; + if(h.preset.getWidth()<124||h.preset.getWidth()>148|| + h.bypass.getRight()!=width-10||h.logo.getX()!=10)return 62; for(std::size_t i=1;iwidth-12 || + if(fields[i].getX()-fields[i-1].getRight()<6 || + fields[i].getRight()>width-10 || fields[i].getWidth()<=0)return 63; if(fields[i].getY()!=22||fields[i].getHeight()!=27)return 64; } @@ -454,9 +510,9 @@ int main(int argc,char** argv) { return 68; if(!editor->findChildWithID("preset.save") || !editor->findChildWithID("preset.load")) return 18; - editor->setSize(iteration%2 ? 660 : 704,iteration%2 ? 490 : 520); - if(editor->getWidth()!=(iteration%2 ? 660 : 704) || - editor->getHeight()!=(iteration%2 ? 490 : 520))return 9; + editor->setSize(iteration%2 ? 580 : 612,iteration%2 ? 480 : 500); + if(editor->getWidth()!=(iteration%2 ? 580 : 612) || + editor->getHeight()!=(iteration%2 ? 480 : 500))return 9; auto* threshold=editor->findChildWithID("param.threshold"); auto* input=editor->findChildWithID("param.input"); auto* ratio=editor->findChildWithID("param.ratio"); @@ -489,8 +545,8 @@ int main(int argc,char** argv) { if(threshold->getBounds().intersects(ratio->getBounds()))return 20; // New compact primary knob row: height budget for larger black LCD // without collapsing control interaction areas at minimum size. - if(threshold->getHeight()!=70 || input->getHeight()!=70 || - attack->getHeight()!=70 || ratio->getHeight()!=70) { + if(threshold->getHeight()!=62 || input->getHeight()!=62 || + attack->getHeight()!=62 || ratio->getHeight()!=62) { std::cerr<<"COMPACT_KNOB_HEIGHT_52 "<getHeight() <<", "<getHeight()<<", "<getHeight() <<", "<getHeight()<<'\n'; @@ -594,10 +650,6 @@ int main(int argc,char** argv) { } processor.processBlock(buffer,midi); } - if(iteration==0) { - juce::Timer::callAfterDelay(120,[]{juce::MessageManager::getInstance()->stopDispatchLoop();}); - juce::MessageManager::getInstance()->runDispatchLoop(); - } if(iteration==1 && argc>1) { // Use the populated signal history and active desktop renderer // for a useful visual review of the Sidechain page. @@ -616,15 +668,76 @@ int main(int argc,char** argv) { return 31; mainTab->onClick(); } + // Exercise asynchronous ComboBox->browser opening in the FIRST + // JUCE dispatch loop. A previous stopDispatchLoop() may leave a + // native Windows quit event pending; restarting the loop is not a + // reliable test of the browser and produces a false failure 80. + // The first loop also drives meter animation for GUI snapshots. + // Search browser is a genuine in-plugin overlay with rich metadata. + if(iteration==0) { + auto* combo=dynamic_cast( + editor->findChildWithID("view.presets")); + auto* browser=editor->findChildWithID("view.preset.browser"); + if(!combo||!browser||browser->isVisible())return 79; + // Programmatic selection does not reproduce a native menu + // click on every JUCE host. Invoke the real installed callback + // explicitly to test the application command deterministically. + combo->setSelectedId(1000,juce::dontSendNotification); + if(!combo->onChange)return 84; + combo->onChange(); + // The browser opens asynchronously after the ComboBox closes. + if(!browser->isVisible()) { + juce::Timer::callAfterDelay(120,[]{ + juce::MessageManager::getInstance()->stopDispatchLoop(); + }); + juce::MessageManager::getInstance()->runDispatchLoop(); + } + if(!browser->isVisible()||browser->getWidth()<500 || + browser->getHeight()<220) { + std::cerr<<"PRESET_BROWSER_80 visible="<isVisible() + <<" bounds="<getBounds().toString() + <<" comboId="<getSelectedId() + <<" comboText="<getText()<<'\n'; + return 80; + } + if(argc>1) { + const auto image=editor->createComponentSnapshot(editor->getLocalBounds()); + auto target=juce::File(juce::String::fromUTF8(argv[1])); + target=target.getSiblingFile( + target.getFileNameWithoutExtension()+"-browser.png"); + auto stream=target.createOutputStream(); + if(!stream||!juce::PNGImageFormat{}.writeImageToStream(image,*stream)) + return 81; + } + browser->setVisible(false); + // Live routing, monitoring and bypass survive preset audition. + auto* ext=processor.state.getParameter("external"); + auto* listen=processor.state.getParameter("listen"); + auto* bypass=processor.state.getParameter("bypass"); + if(!ext||!listen||!bypass)return 82; + ext->setValueNotifyingHost(ext->convertTo0to1(1.0f)); + listen->setValueNotifyingHost(listen->convertTo0to1(1.0f)); + bypass->setValueNotifyingHost(bypass->convertTo0to1(1.0f)); + combo->setSelectedId(46,juce::sendNotificationSync); + if(processor.snapshot()[arson::External]!=1.0f || + processor.snapshot()[arson::Listen]!=1.0f || + processor.snapshot()[arson::Bypass]!=1.0f || + std::abs(processor.snapshot()[arson::Ratio]- + arson::preset::factoryBank()[45].settings[arson::Ratio])>0.01f) + return 83; + ext->setValueNotifyingHost(0.0f); + listen->setValueNotifyingHost(0.0f); + bypass->setValueNotifyingHost(0.0f); + } // Verify the real MINI/FULL UI transformation on the message thread. if(iteration==2) { auto* mini=dynamic_cast(editor->findChildWithID("view.compact")); if(!mini || !mini->onClick)return 10; mini->onClick(); - if(editor->getHeight()!=330)return 11; + if(editor->getHeight()!=320)return 11; if(canvas->getBounds()!=juce::Rectangle{13,258,editor->getWidth()-26,47})return 71; auto compactImage=editor->createComponentSnapshot(editor->getLocalBounds()); - if(compactImage.isNull() || compactImage.getHeight()!=330)return 12; + if(compactImage.isNull() || compactImage.getHeight()!=320)return 12; if(argc>1) { juce::File file(juce::String::fromUTF8(argv[1])); file=file.getSiblingFile(file.getFileNameWithoutExtension()+"-compact.png"); @@ -632,7 +745,7 @@ int main(int argc,char** argv) { if(!stream || !juce::PNGImageFormat{}.writeImageToStream(compactImage,*stream))return 13; } mini->onClick(); - if(editor->getHeight()!=520)return 14; + if(editor->getHeight()!=500)return 14; if(canvas->getBounds()!=juce::Rectangle{8, arson::ui::EditorMetrics::displayTop,editor->getWidth()-16, editor->getHeight()-arson::ui::EditorMetrics::displayBottomReserve})return 72; @@ -644,4 +757,11 @@ int main(int argc,char** argv) { file.deleteFile();auto stream=file.createOutputStream();if(!stream || !juce::PNGImageFormat{}.writeImageToStream(image,*stream))return 4;} } processor.releaseResources();std::cout<<"PASS: state round-trip, audio, zero latency, editor resize/reopen/render\n"; + return 0; +} + +int main(int argc,char** argv) { + const int result=runSmoke(argc,argv); + if(result!=0)std::cerr<<"PLUGIN_SMOKE_FAILURE_CODE "<