Files
serumalt/Source/EffectUnits/AGENTS.md
T
biggy e4cea300db chore: land janitor round 1 and graft integration
Round 1 findings and fixes, all previously uncommitted:
- FXProcessor per-slot DSP history repair (HEAD does not compile without it)
- SynthVoice::getModulationValue, editor control-lock guard
- ExactCompare.h naming the deliberate exact float comparisons
- KnobLookAndFeel replacing the never-installed SerumLookAndFeel
- 55 first-party compiler warnings to 0
- AGENT.md renamed to AGENTS.md across Source/
- graft repository context graph and its hooks
- JANITOR_TASKS.md and UI_UX_AUDIT.md records
2026-10-06 08:50:45 +02:00

1.6 KiB

effects module

Owned files

  • Related rack implementation: ../FXProcessor.h, ../FXProcessor.cpp
  • Biquad.h
  • Hyper.h, Hyper.cpp
  • Chorus.h, Chorus.cpp
  • Flanger.h, Flanger.cpp
  • Phaser.h, Phaser.cpp
  • Distortion.h, Distortion.cpp
  • EQ.h, EQ.cpp
  • Compressor.h, Compressor.cpp
  • Delay.h, Delay.cpp
  • Reverb.h, Reverb.cpp

Rules

  • Implement the FXUnit interface with prepare, reset and process (float* l, float* r, int numSamples, const float p[4]).
  • Process full-wet in place; FXProcessor handles the dry/wet mix.
  • Document what p[0] through p[3] mean for each unit in the header comment.
  • Use std::vector<float> for delay lines and size them in prepare().
  • Use juce::MathConstants<T>::pi and twoPi in delay LFOs, not raw literals.
  • Never allocate or resize a delay line inside process.
  • Guard empty delay lines with an early if (len < 4) return;.

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.
  • Include the existing rack interface via ../FXProcessor.h; no source relocation is implied by this guidance.

Examples

// BAD: reallocates a delay line on the audio thread
void process (float* l, float* r, int n, const float p[4]) override
{
    std::vector<float> delay ((size_t) (sr * 0.05), 0.0f);
    ...
}
// GOOD: sized once at prepare time, reused per block
void prepare (double sampleRate, int) override
{
    sr = sampleRate;
    delayL.assign ((size_t) (sr * 0.05), 0.0f);
    delayR.assign ((size_t) (sr * 0.05), 0.0f);
}

This file overrides /AGENTS.md where they conflict.