refactor(fx): give each FX slot independent DSP history

Replace the single shared array of 9 effect units with a 2D array
of kNumFxSlots × kNumEffectTypes, so each slot owns its own DSP
state. This prevents state bleed when the same effect type appears
in multiple slots and allows reordering without carrying over
internal history.

Track activeTypes to skip unchanged slots. Remove the dry buffer
since it was unused.
This commit is contained in:
2026-09-09 14:32:58 +02:00
parent dc6fd88ed1
commit 4748bfe768
2 changed files with 20 additions and 15 deletions
+5 -3
View File
@@ -31,7 +31,7 @@ struct FxSlotParams
// ===========================================================================
// Reorderable effects rack. Slots are processed in list order; reordering is
// simply swapping FxSlotParams entries. Nine effect unit implementations are
// owned here and shared across slots.
// preconstructed per slot with independent DSP history.
// ===========================================================================
class FXProcessor
{
@@ -47,8 +47,10 @@ public:
static juce::String fxTypeName (int type);
private:
std::array<std::unique_ptr<FXUnit>, 9> units;
juce::AudioBuffer<float> dry, wet;
static constexpr int kNumEffectTypes = (int) FxType::Count - 1;
std::array<std::array<std::unique_ptr<FXUnit>, kNumEffectTypes>, kNumFxSlots> units;
std::array<int, kNumFxSlots> activeTypes {};
juce::AudioBuffer<float> wet;
};
} // namespace serum