Renamed some filter wrappers to lift some confusion, commented

This commit is contained in:
Jean Pierre Cimalando 2020-02-05 22:28:39 +01:00
parent 1f21916c73
commit e6978b71c2

View file

@ -65,25 +65,41 @@ struct UI {};
#pragma GCC diagnostic pop
#endif
/**
Wrapper of the most common kind of resonant filter
Parameterized by cutoff and Q
*/
template <class F> struct sfzFilter : public F {
void setCutoff(float v) { F::fCutoff = v; }
void setQ(float v) { F::fQ = v; }
void setPkShGain(float) {}
};
/**
Wrapper of non resonant filters
Parameterized by cutoff only
*/
template <class F> struct sfzFilterNoQ : public F {
void setCutoff(float v) { F::fCutoff = v; }
void setQ(float) {}
void setPkShGain(float) {}
};
/**
Wrapper of fixed filters
Not parameterized
*/
template <class F> struct sfzFilterNoCutoff : public F {
void setCutoff(float) {}
void setQ(float) {}
void setPkShGain(float) {}
};
template <class F> struct sfzFilterEq : public F {
/**
Wrapper of resonant filters with a gain control for peak or shelf
Parameterized by cutoff, Q, peak/shelf gain
*/
template <class F> struct sfzFilterPkSh : public F {
void setCutoff(float v) { F::fCutoff = v; }
void setQ(float v) { F::fQ = v; }
void setPkShGain(float v) { F::fPkShGain = v; }
@ -133,9 +149,9 @@ template<> struct sfzLpf2pSv<1> : public sfzFilter<faustLpf2pSv> {};
template<> struct sfzHpf2pSv<1> : public sfzFilter<faustHpf2pSv> {};
template<> struct sfzBpf2pSv<1> : public sfzFilter<faustBpf2pSv> {};
template<> struct sfzBrf2pSv<1> : public sfzFilter<faustBrf2pSv> {};
template<> struct sfzLsh<1> : public sfzFilterEq<faustLsh> {};
template<> struct sfzHsh<1> : public sfzFilterEq<faustHsh> {};
template<> struct sfzPeq<1> : public sfzFilterEq<faustPeq> {};
template<> struct sfzLsh<1> : public sfzFilterPkSh<faustLsh> {};
template<> struct sfzHsh<1> : public sfzFilterPkSh<faustHsh> {};
template<> struct sfzPeq<1> : public sfzFilterPkSh<faustPeq> {};
template<> struct sfzLpf1p<2> : public sfzFilterNoQ<faust2chLpf1p> {};
template<> struct sfzLpf2p<2> : public sfzFilter<faust2chLpf2p> {};
@ -157,6 +173,6 @@ template<> struct sfzLpf2pSv<2> : public sfzFilter<faust2chLpf2pSv> {};
template<> struct sfzHpf2pSv<2> : public sfzFilter<faust2chHpf2pSv> {};
template<> struct sfzBpf2pSv<2> : public sfzFilter<faust2chBpf2pSv> {};
template<> struct sfzBrf2pSv<2> : public sfzFilter<faust2chBrf2pSv> {};
template<> struct sfzLsh<2> : public sfzFilterEq<faust2chLsh> {};
template<> struct sfzHsh<2> : public sfzFilterEq<faust2chHsh> {};
template<> struct sfzPeq<2> : public sfzFilterEq<faust2chPeq> {};
template<> struct sfzLsh<2> : public sfzFilterPkSh<faust2chLsh> {};
template<> struct sfzHsh<2> : public sfzFilterPkSh<faust2chHsh> {};
template<> struct sfzPeq<2> : public sfzFilterPkSh<faust2chPeq> {};