30 lines
722 B
C++
30 lines
722 B
C++
#include "Types.h"
|
|
#include <vector>
|
|
|
|
#define FILTER_LIMIT 0.25
|
|
namespace Audio {
|
|
class Filter {
|
|
public:
|
|
Filter();
|
|
float process(float input, float cut, float);
|
|
|
|
protected:
|
|
float output = 0.0;
|
|
int m_counter = 0;
|
|
float m_feedback[4][16]{};
|
|
float m_filterOutput[4]{};
|
|
};
|
|
|
|
struct FilterHelper {
|
|
Filter filter_right{};
|
|
Filter filter_left{};
|
|
float cutoff{};
|
|
float scale{1.0};
|
|
std::vector<stereoSample> output;
|
|
stereoSampleFrame work(stereoSample *buffer, int size);
|
|
protected:
|
|
double m_limit = FILTER_LIMIT;
|
|
int overshot_times = 0;
|
|
stereoSampleFrame doLimit(double, double);
|
|
};
|
|
} |