refactor(source): move every implementation into its module directory

- 36 files move into the module whose AGENTS.md already claimed them:
  Engine/, Synth/, Modulation/, Params/, Plugin/, GUI/, EffectUnits/, Resources/
- Source/engine, modulation, params, plugin and synth become Engine,
  Modulation, Params, Plugin and Synth, matching the directories that already
  hold code
- ExactCompare.h stays at the Source/ root as the one shared header
- SERUMALT_INCLUDE_DIRS adds one include directory per module, so the 31
  parent-relative includes become plain names with no path prefix
- the module AGENTS.md files list owned files instead of describing a move
  that had not happened, and README.md and AGENTS.md describe the real tree

Verified: the harness passes CTest, the Linux VST3 and Standalone link, the
Windows cross-build passes its module checks, each configure exposes only its
own targets, no first-party warning line appears, and the generated Windows
manifest is unchanged.
This commit is contained in:
biggy committed 2026-10-06 09:17:49 +02:00
1 parent facd5c5b5e
commit 4b0db50271
70 files changed
+115 -111

No files matched your search

+23 -15
View File
@@ -83,23 +83,31 @@ extra files. Never edit generated CMakeCache.txt files. The checked-in
## Current source layout ## Current source layout
`CMakeLists.txt` owns the explicit `SERUMALT_SOURCES` list and shared target setup. `CMakeLists.txt` owns the explicit `SERUMALT_SOURCES` list, the module include
`cmake/Plugin.cmake` owns production formats and MinGW link flags; directories and shared target setup. `cmake/Plugin.cmake` owns production formats
`cmake/Harness.cmake` owns the console harness and CTest registration. and MinGW link flags; `cmake/Harness.cmake` owns the console harness and CTest
The harness compiles the same processor/editor sources independently of the plugin. registration. The harness compiles the same processor/editor sources independently
of the plugin.
Most C++ files still live directly under `Source/`. Existing implementation Every implementation lives in a module directory under `Source/`, and the
subdirectories are `EffectUnits/`, `GUI/`, `Presets/`, `Resources/`, and `Tests/`. `AGENTS.md` in that directory owns its rules:
`FXProcessor`, `PluginEditor`, `Resources`, and `RAVEButton` remain at the source root.
`RAVEButton.{h,cpp}` defines `RaveController`.
The lowercase `Source/engine`, `modulation`, `params`, `plugin`, and `synth` - `Engine/` the voice pool, LFOs, wavetable library, FX rack, matrix and macros.
directories currently hold guidance, not relocated implementations. Consult their - `Synth/` wavetables, oscillators, filters, envelopes, LFOs and the voice.
`AGENTS.md` files when editing the related root-level sources. Consult the matching - `Modulation/` the modulation matrix, macros, and `RAVEButton`, which defines
`AGENTS.md` when editing an existing implementation subdirectory. `RaveController`.
`docs/AUDIT_REPORT.md` is a historical audit and proposed refactor, not a pending - `Params/` parameter IDs, indexed groups, enums and unit mappings.
instruction to move files. Update the explicit source list and includes only when - `Plugin/` the JUCE `AudioProcessor` boundary.
an actual source move is part of the requested task. - `GUI/` the editor with its controls and previews.
- `EffectUnits/` the effect rack and the effect units.
- `Presets/`, `Resources/` and `Tests/`, as their names suggest.
`Source/ExactCompare.h` is the one shared header, and several modules include it.
`SERUMALT_INCLUDE_DIRS` lists one include directory per module, so a source names a
header without a path prefix. No two headers share a basename; check that before
adding one. `docs/AUDIT_REPORT.md` is a historical audit and proposed refactor, not
a pending instruction. Update `SERUMALT_SOURCES` and `SERUMALT_INCLUDE_DIRS` when
files move.
## Style and ownership ## Style and ownership
+34 -18
View File
@@ -19,24 +19,24 @@ endif()
add_subdirectory("${JUCE_ROOT}" "${CMAKE_CURRENT_BINARY_DIR}/third_party/JUCE") add_subdirectory("${JUCE_ROOT}" "${CMAKE_CURRENT_BINARY_DIR}/third_party/JUCE")
set(SERUMALT_SOURCES set(SERUMALT_SOURCES
Source/PluginProcessor.cpp Source/Plugin/PluginProcessor.cpp
Source/PluginEditor.cpp Source/GUI/PluginEditor.cpp
Source/Params.cpp Source/Params/Params.cpp
Source/Wavetable.cpp Source/Synth/Wavetable.cpp
Source/Oscillator.cpp Source/Synth/Oscillator.cpp
Source/SubOscillator.cpp Source/Synth/SubOscillator.cpp
Source/NoiseOscillator.cpp Source/Synth/NoiseOscillator.cpp
Source/Filter.cpp Source/Synth/Filter.cpp
Source/FilterBank.cpp Source/Synth/FilterBank.cpp
Source/Envelope.cpp Source/Synth/Envelope.cpp
Source/LFO.cpp Source/Synth/LFO.cpp
Source/ModulationMatrix.cpp Source/Modulation/ModulationMatrix.cpp
Source/FXProcessor.cpp Source/EffectUnits/FXProcessor.cpp
Source/MacroControls.cpp Source/Modulation/MacroControls.cpp
Source/RAVEButton.cpp Source/Modulation/RAVEButton.cpp
Source/SynthVoice.cpp Source/Synth/SynthVoice.cpp
Source/Engine.cpp Source/Engine/Engine.cpp
Source/Resources.cpp Source/Resources/Resources.cpp
Source/EffectUnits/Hyper.cpp Source/EffectUnits/Hyper.cpp
Source/EffectUnits/Chorus.cpp Source/EffectUnits/Chorus.cpp
Source/EffectUnits/Flanger.cpp Source/EffectUnits/Flanger.cpp
@@ -57,9 +57,25 @@ set(SERUMALT_SOURCES
Source/GUI/Panel.cpp Source/GUI/Panel.cpp
Source/Presets/FactoryPresets.cpp) Source/Presets/FactoryPresets.cpp)
# One include directory per module, so a source names a header without a path
# prefix. No two headers in this tree share a basename.
set(SERUMALT_INCLUDE_DIRS
Source
Source/EffectUnits
Source/Engine
Source/GUI
Source/Modulation
Source/Params
Source/Plugin
Source/Presets
Source/Resources
Source/Synth
Source/Tests)
function(serumalt_configure_target target) function(serumalt_configure_target target)
juce_generate_juce_header(${target}) juce_generate_juce_header(${target})
target_sources(${target} PRIVATE ${SERUMALT_SOURCES}) target_sources(${target} PRIVATE ${SERUMALT_SOURCES})
target_include_directories(${target} PRIVATE ${SERUMALT_INCLUDE_DIRS})
target_compile_definitions(${target} target_compile_definitions(${target}
PUBLIC PUBLIC
JUCE_WEB_BROWSER=0 JUCE_WEB_BROWSER=0
+11 -22
View File
@@ -27,28 +27,17 @@ working builds and hands-on listening over elaborate test infrastructure.
``` ```
Source/ Source/
PluginProcessor.{h,cpp} APVTS, presets, state, RAVE/UI-scale glue Engine/ Voice pool, MIDI timing, control snapshots, FX rack
PluginEditor.{h,cpp} Tabbed GUI, owned controls, scaling, previews Synth/ Wavetables, oscillators, filters, envelopes, LFOs, voice
Params.{h,cpp} Parameter IDs, indexed groups, enums, mappings Modulation/ Matrix, macros, RAVE
Wavetable.{h,cpp} 256×2048 tables, prebuilt by the engine Params/ Parameter IDs, indexed groups, enums, mappings
Oscillator.{h,cpp} Morph/warp/unison oscillator Plugin/ AudioProcessor: APVTS, presets, state, RAVE/UI-scale glue
SubOscillator.{h,cpp} Sine/triangle sub GUI/ Editor, controls and previews
NoiseOscillator.{h,cpp} White/pink noise EffectUnits/ FX rack and the nine effect units
Filter.{h,cpp} Seven filter models and cached coefficients Presets/ Factory preset definitions
FilterBank.{h,cpp} Two slots and routing Resources/ Theme, formatters and SVG assets
Envelope.{h,cpp} ADSR with curve Tests/ Headless QA harness
LFO.{h,cpp} Continuous phase, sync and shape editing ExactCompare.h Shared exact float comparison helpers
ModulationMatrix.{h,cpp} Connections
FXProcessor.{h,cpp} Independent effect state per rack slot
EffectUnits/ Hyper, Chorus, Flanger, Phaser, Distortion, EQ,
Compressor, Delay, Reverb
MacroControls.{h,cpp} Four assignable macros
RAVEButton.{h,cpp} Render-time boost, without rewriting parameters
SynthVoice.{h,cpp} Per-voice oscillators, filters and envelopes
Engine.{h,cpp} 32 voices, MIDI timing, control snapshots, FX
GUI/ Controls and previews
Presets/FactoryPresets.cpp Factory preset definitions
Resources/ SVG assets
``` ```
The engine splits rendering at MIDI event positions and into segments of at most The engine splits rendering at MIDI event positions and into segments of at most
+2 -2
View File
@@ -2,7 +2,7 @@
## Owned files ## Owned files
- Related rack implementation: `../FXProcessor.h`, `../FXProcessor.cpp` - FXProcessor.h, FXProcessor.cpp
- Biquad.h - Biquad.h
- Hyper.h, Hyper.cpp - Hyper.h, Hyper.cpp
- Chorus.h, Chorus.cpp - Chorus.h, Chorus.cpp
@@ -27,7 +27,7 @@
## IF-THEN ## IF-THEN
- IF a unit needs a delay line THEN allocate it in `prepare()` at the full required length and only read and write it in `process`. - IF a unit needs a delay line THEN allocate it in `prepare()` at the full required length and only read and write it in `process`.
- Include the existing rack interface via `../FXProcessor.h`; no source relocation is implied by this guidance. - Include the rack interface via `FXProcessor.h`.
## Examples ## Examples
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
#include "Biquad.h" #include "Biquad.h"
namespace serum namespace serum
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
#include "Biquad.h" #include "Biquad.h"
namespace serum namespace serum
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
#include "Biquad.h" #include "Biquad.h"
namespace serum namespace serum
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include "../FXProcessor.h" #include "FXProcessor.h"
namespace serum namespace serum
{ {
@@ -1,9 +1,8 @@
# engine module # engine module
## Related source files ## Owned files
This directory contains guidance; the implementation remains in `../Engine.h` - Engine.h, Engine.cpp
and `../Engine.cpp`.
## Rules ## Rules
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -2,7 +2,7 @@
## Owned files ## Owned files
- Related editor implementation: `../PluginEditor.h`, `../PluginEditor.cpp` - PluginEditor.h, PluginEditor.cpp
- Knob.h, Knob.cpp - Knob.h, Knob.cpp
- KnobLookAndFeel.h, KnobLookAndFeel.cpp - KnobLookAndFeel.h, KnobLookAndFeel.cpp
- ToggleButton.h, ToggleButton.cpp - ToggleButton.h, ToggleButton.cpp
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
namespace serum namespace serum
{ {
+2 -2
View File
@@ -1,6 +1,6 @@
#include "EnvelopeDisplay.h" #include "EnvelopeDisplay.h"
#include "../Envelope.h" #include "Envelope.h"
#include "../ExactCompare.h" #include "ExactCompare.h"
namespace serum namespace serum
{ {
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
#include "../Params.h" #include "Params.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
#include "FilterDisplay.h" #include "FilterDisplay.h"
#include "../ExactCompare.h" #include "ExactCompare.h"
namespace serum namespace serum
{ {
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
#include "../Params.h" #include "Params.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <JuceHeader.h> #include <JuceHeader.h>
#include <memory> #include <memory>
#include "../Resources.h" #include "Resources.h"
#include "KnobLookAndFeel.h" #include "KnobLookAndFeel.h"
namespace serum namespace serum
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
#include "LFODisplay.h" #include "LFODisplay.h"
#include "../ExactCompare.h" #include "ExactCompare.h"
namespace serum namespace serum
{ {
+3 -3
View File
@@ -1,9 +1,9 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
#include "../Params.h" #include "Params.h"
#include "../LFO.h" #include "LFO.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
namespace serum namespace serum
{ {
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Resources.h" #include "Resources.h"
namespace serum namespace serum
{ {
+3 -3
View File
@@ -1,9 +1,9 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../ExactCompare.h" #include "ExactCompare.h"
#include "../Resources.h" #include "Resources.h"
#include "../Wavetable.h" #include "Wavetable.h"
namespace serum namespace serum
{ {
@@ -1,13 +1,10 @@
# modulation module # modulation module
## Related source files ## Owned files
This directory contains guidance; implementations remain in the parent `Source/` - ModulationMatrix.h, ModulationMatrix.cpp
directory: - MacroControls.h, MacroControls.cpp
- RAVEButton.h, RAVEButton.cpp, which define `RaveController`
- `../ModulationMatrix.h`, `../ModulationMatrix.cpp`
- `../MacroControls.h`, `../MacroControls.cpp`
- `../RAVEButton.h`, `../RAVEButton.cpp`, which define `RaveController`
## Rules ## Rules
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,15 +1,14 @@
# params module # params module
## Related source files ## Owned files
This directory contains guidance; the implementation remains in `../Params.h` - Params.h, Params.cpp
and `../Params.cpp`.
## Rules ## Rules
- Use the `ids::` namespace for every APVTS parameter ID string. - Use the `ids::` namespace for every APVTS parameter ID string.
- Require one `ids::` entry per audio parameter, and one entry only. - Require one `ids::` entry per audio parameter, and one entry only.
- Reach indexed parameters through the `paramIds::` arrays in `../Params.h`, which pair each - Reach indexed parameters through the `paramIds::` arrays in `Params.h`, which pair each
ID with its slot: `paramIds::oscillators`, `paramIds::envAttack`, `paramIds::lfoRate`, ID with its slot: `paramIds::oscillators`, `paramIds::envAttack`, `paramIds::lfoRate`,
`paramIds::fxType`, `paramIds::macros` and their siblings. Use a single `ids::` entry only `paramIds::fxType`, `paramIds::macros` and their siblings. Use a single `ids::` entry only
when the parameter has no index. when the parameter has no index.
File renamed without changes.
File renamed without changes.
@@ -1,9 +1,8 @@
# plugin module # plugin module
## Related source files ## Owned files
This directory contains guidance; the implementation remains in - PluginProcessor.h, PluginProcessor.cpp
`../PluginProcessor.h` and `../PluginProcessor.cpp`.
## Rules ## Rules
File renamed without changes.
File renamed without changes.
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once #pragma once
#include <JuceHeader.h> #include <JuceHeader.h>
#include "../Params.h" #include "Params.h"
#include "../ModulationMatrix.h" #include "ModulationMatrix.h"
namespace serum namespace serum
{ {
+1 -1
View File
@@ -2,7 +2,7 @@
## Owned files ## Owned files
- Related embedded assets and helpers: `../Resources.h`, `../Resources.cpp` - Resources.h, Resources.cpp
- logo.svg - logo.svg
- background.svg - background.svg
File renamed without changes.
File renamed without changes.
@@ -1,9 +1,6 @@
# synth module # synth module
## Related source files ## Owned files
This directory contains guidance. All files listed below remain in the parent
`Source/` directory.
- Wavetable.h, Wavetable.cpp - Wavetable.h, Wavetable.cpp
- Oscillator.h, Oscillator.cpp - Oscillator.h, Oscillator.cpp
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -1,7 +1,7 @@
#include <JuceHeader.h> #include <JuceHeader.h>
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include "../PluginProcessor.h" #include "PluginProcessor.h"
// =========================================================================== // ===========================================================================
// Headless QA harness: instantiates the processor, plays notes through every // Headless QA harness: instantiates the processor, plays notes through every