diff --git a/src/sfizz/SfzFilterImpls.cxx b/src/sfizz/SfzFilterImpls.cxx index 59455466..a7c86de6 100644 --- a/src/sfizz/SfzFilterImpls.cxx +++ b/src/sfizz/SfzFilterImpls.cxx @@ -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 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 struct sfzFilterNoQ : public F { void setCutoff(float v) { F::fCutoff = v; } void setQ(float) {} void setPkShGain(float) {} }; +/** + Wrapper of fixed filters + Not parameterized + */ template struct sfzFilterNoCutoff : public F { void setCutoff(float) {} void setQ(float) {} void setPkShGain(float) {} }; -template struct sfzFilterEq : public F { +/** + Wrapper of resonant filters with a gain control for peak or shelf + Parameterized by cutoff, Q, peak/shelf gain + */ +template 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 {}; template<> struct sfzHpf2pSv<1> : public sfzFilter {}; template<> struct sfzBpf2pSv<1> : public sfzFilter {}; template<> struct sfzBrf2pSv<1> : public sfzFilter {}; -template<> struct sfzLsh<1> : public sfzFilterEq {}; -template<> struct sfzHsh<1> : public sfzFilterEq {}; -template<> struct sfzPeq<1> : public sfzFilterEq {}; +template<> struct sfzLsh<1> : public sfzFilterPkSh {}; +template<> struct sfzHsh<1> : public sfzFilterPkSh {}; +template<> struct sfzPeq<1> : public sfzFilterPkSh {}; template<> struct sfzLpf1p<2> : public sfzFilterNoQ {}; template<> struct sfzLpf2p<2> : public sfzFilter {}; @@ -157,6 +173,6 @@ template<> struct sfzLpf2pSv<2> : public sfzFilter {}; template<> struct sfzHpf2pSv<2> : public sfzFilter {}; template<> struct sfzBpf2pSv<2> : public sfzFilter {}; template<> struct sfzBrf2pSv<2> : public sfzFilter {}; -template<> struct sfzLsh<2> : public sfzFilterEq {}; -template<> struct sfzHsh<2> : public sfzFilterEq {}; -template<> struct sfzPeq<2> : public sfzFilterEq {}; +template<> struct sfzLsh<2> : public sfzFilterPkSh {}; +template<> struct sfzHsh<2> : public sfzFilterPkSh {}; +template<> struct sfzPeq<2> : public sfzFilterPkSh {};