wip: filter constructors
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
#pragma once
|
||||
#include "Filter.h"
|
||||
|
||||
class BandPassFilter: public Filter
|
||||
{
|
||||
private:
|
||||
class BandPassFilter : public Filter {
|
||||
private:
|
||||
void calculate_coefficients() override;
|
||||
public:
|
||||
|
||||
public:
|
||||
BandPassFilter(Filter* filter);
|
||||
BandPassFilter(float freq, float res, float q);
|
||||
BandPassFilter(/* args */);
|
||||
~BandPassFilter();
|
||||
};
|
||||
|
||||
|
||||
17
inc/Filter.h
17
inc/Filter.h
@@ -1,18 +1,16 @@
|
||||
#pragma once
|
||||
#include "Effect.h"
|
||||
|
||||
class Filter: public Effect
|
||||
{
|
||||
|
||||
class Filter : public Effect {
|
||||
|
||||
protected:
|
||||
protected:
|
||||
struct Normals {
|
||||
float V;
|
||||
float K;
|
||||
};
|
||||
|
||||
float m_freq; // cutoff frequency
|
||||
float m_q; // filter quantity (resonance)
|
||||
float m_freq; // cutoff frequency
|
||||
float m_q; // filter quantity (resonance)
|
||||
float m_order; // filter order (peakGain)
|
||||
/* todo: filter adsr */
|
||||
float m_norm;
|
||||
@@ -20,7 +18,8 @@ protected:
|
||||
float m_z1, m_z2;
|
||||
Normals calculate_normals();
|
||||
virtual void calculate_coefficients(){};
|
||||
public:
|
||||
|
||||
public:
|
||||
Filter(/* args */);
|
||||
~Filter();
|
||||
void Trigger() override;
|
||||
@@ -28,5 +27,7 @@ public:
|
||||
float Process(float in);
|
||||
void Process(std::vector<float>& samples) override;
|
||||
void SetParameters(float freq, float res, float q);
|
||||
float GetFreq() { return m_freq; }
|
||||
float GetRes() { return m_q; }
|
||||
float GetPeakGain() { return m_norm; }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#pragma once
|
||||
#include "Filter.h"
|
||||
|
||||
class HighPassFilter: public Filter
|
||||
{
|
||||
private:
|
||||
class HighPassFilter : public Filter {
|
||||
private:
|
||||
void calculate_coefficients() override;
|
||||
public:
|
||||
HighPassFilter(/* args */);
|
||||
|
||||
public:
|
||||
HighPassFilter();
|
||||
HighPassFilter(Filter* filter);
|
||||
HighPassFilter(float freq, float res, float q);
|
||||
~HighPassFilter();
|
||||
};
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
#include "Filter.h"
|
||||
|
||||
class LowPassFilter: public Filter
|
||||
{
|
||||
protected:
|
||||
class LowPassFilter : public Filter {
|
||||
protected:
|
||||
void calculate_coefficients() override;
|
||||
public:
|
||||
LowPassFilter(/* args */);
|
||||
|
||||
public:
|
||||
LowPassFilter();
|
||||
LowPassFilter(Filter* filter);
|
||||
LowPassFilter(float freq, float res, float q);
|
||||
~LowPassFilter();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user