LCOV - code coverage report
Current view: top level - src/audio/effects - wah.h (source / functions) Coverage Total Hit
Test: merged.info Lines: 100.0 % 4 4
Test Date: 2026-06-01 11:15:25 Functions: 100.0 % 3 3

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : // Wah filter with manual and envelope-following sweep modes.
       4              : // A resonant state-variable band-pass filter sweeps center frequency f_c; in
       5              : // auto mode f_c follows an envelope e[n], while manual mode maps pedal position
       6              : // directly. Resonance/Q controls bandwidth around f_c.
       7              : 
       8              : #include "audio/effects/effect.h"
       9              : #include "audio/dsp/envelope_follower.h"
      10              : 
      11              : namespace Amplitron {
      12              : 
      13            8 : class WahPedal : public Effect {
      14              : public:
      15              :     WahPedal();
      16              :     void process(float* buffer, int num_samples) override;
      17              :     void reset() override;
      18            4 :     const char* name() const override { return "Wah"; }
      19            3 :     const char* type_id() const override { return "Wah"; }
      20           18 :     std::vector<EffectParam>& params() override { return params_; }
      21              : 
      22              : private:
      23              :     std::vector<EffectParam> params_;
      24              : 
      25              :     // State-variable filter (Chamberlin topology) state
      26              :     float svf_lp_ = 0.0f;
      27              :     float svf_bp_ = 0.0f;
      28              : 
      29              :     // Envelope follower state (auto-wah)
      30              :     EnvelopeFollower env_;
      31              : 
      32              :     // Smoothed sweep position (avoids zipper noise)
      33              :     float sweep_smooth_ = 0.5f;
      34              : 
      35              :     // Smoothed Q / resonance (avoids zipper noise on knob moves)
      36              :     float q_smooth_ = 3.5f;
      37              : };
      38              : 
      39              : } // namespace Amplitron
        

Generated by: LCOV version 2.0-1