LCOV - code coverage report
Current view: top level - src/audio/effects/dynamics - noise_gate.h (source / functions) Coverage Total Hit
Test: merged.info Lines: 80.0 % 5 4
Test Date: 2026-06-07 15:51:50 Functions: 75.0 % 4 3

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : // Noise gate that attenuates low-level input between notes.
       4              : // An envelope follower tracks amplitude e[n]; when e[n] falls below threshold
       5              : // T, gain approaches 0 with release smoothing, and when e[n]>=T it approaches
       6              : // 1 with attack smoothing, preventing abrupt chopping.
       7              : 
       8              : #include "audio/dsp/envelope_follower.h"
       9              : #include "audio/effects/core/effect.h"
      10              : 
      11              : namespace Amplitron {
      12              : 
      13            5 : class NoiseGate : public Effect {
      14              :    public:
      15              :     NoiseGate();
      16              :     void process(float* buffer, int num_samples) override;
      17              :     void reset() override;
      18          143 :     const char* name() const override { return "Noise Gate"; }
      19            3 :     const char* type_id() const override { return "Noise Gate"; }
      20          183 :     std::vector<EffectParam>& params() override { return params_; }
      21            0 :     const std::vector<EffectParam>& params() const override { return params_; }
      22              : 
      23              :    private:
      24              :     std::vector<EffectParam> params_;
      25              :     EnvelopeFollower env_;
      26              :     float gain_ = 0.0f;
      27              : };
      28              : 
      29              : }  // namespace Amplitron
        

Generated by: LCOV version 2.0-1