Faust filters automatically generated
This commit is contained in:
parent
9bb633e50d
commit
cd43cac59b
2 changed files with 40 additions and 10 deletions
|
|
@ -310,6 +310,36 @@ endif()
|
|||
# Generic library alias
|
||||
add_library(sfizz::sfizz ALIAS sfizz_static)
|
||||
|
||||
# Preserve generated files (Faust)
|
||||
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM TRUE)
|
||||
|
||||
# Faust filters
|
||||
foreach(filter_type
|
||||
Lpf1p Lpf2p Lpf4p Lpf6p Hpf1p Hpf2p Hpf4p Hpf6p
|
||||
Bpf1p Bpf2p Bpf4p Bpf6p Apf1p Brf1p Brf2p
|
||||
Pink Lpf2pSv Hpf2pSv Bpf2pSv Brf2pSv
|
||||
Lsh Hsh Peq EqPeak EqLshelf EqHshelf)
|
||||
add_faust_command(
|
||||
"sfizz/dsp/filters/sfz_filters.dsp"
|
||||
"sfizz/gen/filters/sfz${filter_type}.hxx"
|
||||
DOUBLE IN_PLACE
|
||||
PROCESS_NAME "sfz${filter_type}"
|
||||
CLASS_NAME "faust${filter_type}"
|
||||
SUPERCLASS_NAME "sfzFilterDsp"
|
||||
IMPORT_DIRS "sfizz/dsp")
|
||||
add_faust_command(
|
||||
"sfizz/dsp/filters/sfz_filters.dsp"
|
||||
"sfizz/gen/filters/sfz2ch${filter_type}.hxx"
|
||||
DOUBLE IN_PLACE
|
||||
PROCESS_NAME "sfz2ch${filter_type}"
|
||||
CLASS_NAME "faust2ch${filter_type}"
|
||||
SUPERCLASS_NAME "sfzFilterDsp"
|
||||
IMPORT_DIRS "sfizz/dsp")
|
||||
target_sources(sfizz_internal PRIVATE
|
||||
"sfizz/gen/filters/sfz${filter_type}.hxx"
|
||||
"sfizz/gen/filters/sfz2ch${filter_type}.hxx")
|
||||
endforeach()
|
||||
|
||||
# Windows installer
|
||||
if(WIN32)
|
||||
include(VSTConfig)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public:
|
|||
|
||||
virtual void init(int) = 0;
|
||||
virtual void instanceClear() = 0;
|
||||
virtual void compute(int, float **, float **) = 0;
|
||||
virtual void compute(int, const float *const *, float *const *) = 0;
|
||||
|
||||
virtual void configureStandard(float, float, float) {}
|
||||
virtual void configureEq(float, float, float) {}
|
||||
|
|
@ -105,8 +105,8 @@ protected:
|
|||
template <class F> struct sfzFilter : public F {
|
||||
void configureStandard(float cutoff, float q, float pksh) override
|
||||
{
|
||||
F::fCutoff = cutoff;
|
||||
F::fQ = q;
|
||||
this->setCutoff(cutoff);
|
||||
this->setResonance(q);
|
||||
(void)pksh;
|
||||
}
|
||||
};
|
||||
|
|
@ -118,7 +118,7 @@ template <class F> struct sfzFilter : public F {
|
|||
template <class F> struct sfzFilterNoQ : public F {
|
||||
void configureStandard(float cutoff, float q, float pksh) override
|
||||
{
|
||||
F::fCutoff = cutoff;
|
||||
this->setCutoff(cutoff);
|
||||
(void)q;
|
||||
(void)pksh;
|
||||
}
|
||||
|
|
@ -144,9 +144,9 @@ template <class F> struct sfzFilterNoCutoff : public F {
|
|||
template <class F> struct sfzFilterPkSh : public F {
|
||||
void configureStandard(float cutoff, float q, float pksh) override
|
||||
{
|
||||
F::fCutoff = cutoff;
|
||||
F::fQ = q;
|
||||
F::fPkShGain = pksh;
|
||||
this->setCutoff(cutoff);
|
||||
this->setResonance(q);
|
||||
this->setPeakShelfGain(pksh);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -157,9 +157,9 @@ template <class F> struct sfzFilterPkSh : public F {
|
|||
template <class F> struct sfzFilterEq : public F {
|
||||
void configureEq(float cutoff, float bw, float pksh) override
|
||||
{
|
||||
F::fCutoff = cutoff;
|
||||
F::fBandwidth = bw;
|
||||
F::fPkShGain = pksh;
|
||||
this->setCutoff(cutoff);
|
||||
this->setBandwidth(bw);
|
||||
this->setPeakShelfGain(pksh);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue