commit
b9d2136740
57 changed files with 9242 additions and 0 deletions
64
scripts/generate_filters.sh
Executable file
64
scripts/generate_filters.sh
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if ! test -d "src"; then
|
||||
echo "Please run this in the project root directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FAUSTARGS="-double -inpl"
|
||||
|
||||
# support GNU sed only, use gsed on a Mac
|
||||
test -z "$SED" && SED=sed
|
||||
|
||||
faustgen() {
|
||||
mkdir -p src/sfizz/gen/filters
|
||||
local outfile=src/sfizz/gen/filters/sfz"$1".cxx
|
||||
|
||||
local code=`faust $FAUSTARGS -pn sfz"$1" -cn faust"$1" src/sfizz/dsp/filters/sfz_filters.dsp`
|
||||
|
||||
# find variable names of our controls
|
||||
local cutoffVar=`echo "$code" | $SED -r 's%.*\("Cutoff", &[ \t]*([a-zA-Z0-9_]+).*%\1%;t;d'`
|
||||
local resoVar=`echo "$code" | $SED -r 's%.*\("Resonance", &[ \t]*([a-zA-Z0-9_]+).*%\1%;t;d'`
|
||||
local pkshVar=`echo "$code" | $SED -r 's%.*\("Peak/shelf gain", &[ \t]*([a-zA-Z0-9_]+).*%\1%;t;d'`
|
||||
|
||||
# suppress some faust-specific stuff we don't care
|
||||
echo "$code" \
|
||||
| fgrep -v -- '->declare(' \
|
||||
| fgrep -v -- '->openHorizontalBox(' \
|
||||
| fgrep -v -- '->openVerticalBox(' \
|
||||
| fgrep -v -- '->closeBox(' \
|
||||
| fgrep -v -- '->addHorizontalSlider(' \
|
||||
| fgrep -v -- '->addVerticalSlider(' \
|
||||
> "$outfile"
|
||||
|
||||
# direct access to parameter variables
|
||||
$SED -r -i 's/\bprivate:/public:/' "$outfile"
|
||||
# no virtuals please
|
||||
$SED -r -i 's/\bvirtual\b//' "$outfile"
|
||||
|
||||
# rename the variables for us to access more easily
|
||||
if test ! -z "$cutoffVar"; then
|
||||
$SED -r -i 's/\b'"$cutoffVar"'\b/fCutoff/' "$outfile"
|
||||
fi
|
||||
if test ! -z "$resoVar"; then
|
||||
$SED -r -i 's/\b'"$resoVar"'\b/fQ/' "$outfile"
|
||||
fi
|
||||
if test ! -z "$pkshVar"; then
|
||||
$SED -r -i 's/\b'"$pkshVar"'\b/fPkShGain/' "$outfile"
|
||||
fi
|
||||
}
|
||||
|
||||
for f in \
|
||||
Lpf1p Lpf2p Lpf4p Lpf6p \
|
||||
Hpf1p Hpf2p Hpf4p Hpf6p \
|
||||
Bpf1p Bpf2p Bpf4p Bpf6p \
|
||||
Apf1p \
|
||||
Brf1p Brf2p \
|
||||
Lsh Hsh Peq \
|
||||
Pink \
|
||||
Lpf2pSv Hpf2pSv Bpf2pSv Brf2pSv
|
||||
do
|
||||
faustgen "$f"
|
||||
faustgen "2ch$f"
|
||||
done
|
||||
|
|
@ -11,6 +11,7 @@ set (SFIZZ_SOURCES
|
|||
sfizz/Oversampler.cpp
|
||||
sfizz/FloatEnvelopes.cpp
|
||||
sfizz/Logger.cpp
|
||||
sfizz/SfzFilter.cpp
|
||||
)
|
||||
include (SfizzSIMDSourceFilesCheck)
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ namespace config {
|
|||
constexpr uint8_t numCCs { 143 };
|
||||
constexpr int chunkSize { 1024 };
|
||||
constexpr float defaultAmpEGRelease { 0.02f };
|
||||
/**
|
||||
Minimum interval in frames between recomputations of coefficients of the
|
||||
modulated filter. The lower, the more CPU resources are consumed.
|
||||
*/
|
||||
constexpr int filterControlInterval { 16 };
|
||||
} // namespace config
|
||||
|
||||
// Enable or disable SIMD accelerators by default
|
||||
|
|
|
|||
|
|
@ -710,6 +710,8 @@ template <class T, bool SIMD = SIMDConfig::copy>
|
|||
void copy(absl::Span<const T> input, absl::Span<T> output) noexcept
|
||||
{
|
||||
ASSERT(output.size() >= input.size());
|
||||
if (output.data() == input.data() && output.size() == input.size())
|
||||
return;
|
||||
auto* in = input.begin();
|
||||
auto* out = output.begin();
|
||||
auto* sentinel = out + min(input.size(), output.size());
|
||||
|
|
|
|||
249
src/sfizz/SfzFilter.cpp
Normal file
249
src/sfizz/SfzFilter.cpp
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
// This code is part of the sfizz library and is licensed under a BSD 2-clause
|
||||
// license. You should have receive a LICENSE.md file along with the code.
|
||||
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
||||
|
||||
#include "Config.h"
|
||||
#include "SfzFilter.h"
|
||||
#include "SfzFilterImpls.cxx"
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include "SIMDHelpers.h"
|
||||
|
||||
namespace sfz {
|
||||
|
||||
template <unsigned NCh>
|
||||
struct Filter<NCh>::Impl {
|
||||
FilterType fType = kFilterNone;
|
||||
|
||||
sfzLpf1p<NCh> fDspLpf1p;
|
||||
sfzLpf2p<NCh> fDspLpf2p;
|
||||
sfzLpf4p<NCh> fDspLpf4p;
|
||||
sfzLpf6p<NCh> fDspLpf6p;
|
||||
sfzHpf1p<NCh> fDspHpf1p;
|
||||
sfzHpf2p<NCh> fDspHpf2p;
|
||||
sfzHpf4p<NCh> fDspHpf4p;
|
||||
sfzHpf6p<NCh> fDspHpf6p;
|
||||
sfzBpf1p<NCh> fDspBpf1p;
|
||||
sfzBpf2p<NCh> fDspBpf2p;
|
||||
sfzBpf4p<NCh> fDspBpf4p;
|
||||
sfzBpf6p<NCh> fDspBpf6p;
|
||||
sfzApf1p<NCh> fDspApf1p;
|
||||
sfzBrf1p<NCh> fDspBrf1p;
|
||||
sfzBrf2p<NCh> fDspBrf2p;
|
||||
sfzPink<NCh> fDspPink;
|
||||
sfzLpf2pSv<NCh> fDspLpf2pSv;
|
||||
sfzHpf2pSv<NCh> fDspHpf2pSv;
|
||||
sfzBpf2pSv<NCh> fDspBpf2pSv;
|
||||
sfzBrf2pSv<NCh> fDspBrf2pSv;
|
||||
sfzLsh<NCh> fDspLsh;
|
||||
sfzHsh<NCh> fDspHsh;
|
||||
sfzPeq<NCh> fDspPeq;
|
||||
|
||||
template <class F> static void process(F &filter, const float *const in[NCh], float *const out[NCh], float cutoff, float q, float pksh, unsigned nframes);
|
||||
template <class F> static void processModulated(F &filter, const float *const in[NCh], float *const out[NCh], const float *cutoff, const float *q, const float *pksh, unsigned nframes);
|
||||
};
|
||||
|
||||
template <unsigned NCh>
|
||||
Filter<NCh>::Filter()
|
||||
: P{new Impl}
|
||||
{
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
Filter<NCh>::~Filter()
|
||||
{
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
void Filter<NCh>::init(double sampleRate)
|
||||
{
|
||||
P->fDspLpf1p.init(sampleRate);
|
||||
P->fDspLpf2p.init(sampleRate);
|
||||
P->fDspLpf4p.init(sampleRate);
|
||||
P->fDspLpf6p.init(sampleRate);
|
||||
P->fDspHpf1p.init(sampleRate);
|
||||
P->fDspHpf2p.init(sampleRate);
|
||||
P->fDspHpf4p.init(sampleRate);
|
||||
P->fDspHpf6p.init(sampleRate);
|
||||
P->fDspBpf1p.init(sampleRate);
|
||||
P->fDspBpf2p.init(sampleRate);
|
||||
P->fDspBpf4p.init(sampleRate);
|
||||
P->fDspBpf6p.init(sampleRate);
|
||||
P->fDspApf1p.init(sampleRate);
|
||||
P->fDspBrf1p.init(sampleRate);
|
||||
P->fDspBrf2p.init(sampleRate);
|
||||
P->fDspPink.init(sampleRate);
|
||||
P->fDspLpf2pSv.init(sampleRate);
|
||||
P->fDspHpf2pSv.init(sampleRate);
|
||||
P->fDspBpf2pSv.init(sampleRate);
|
||||
P->fDspBrf2pSv.init(sampleRate);
|
||||
P->fDspLsh.init(sampleRate);
|
||||
P->fDspHsh.init(sampleRate);
|
||||
P->fDspPeq.init(sampleRate);
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
void Filter<NCh>::clear()
|
||||
{
|
||||
switch (P->fType) {
|
||||
case kFilterNone: break;
|
||||
case kFilterApf1p: P->fDspApf1p.instanceClear(); break;
|
||||
case kFilterBpf1p: P->fDspBpf1p.instanceClear(); break;
|
||||
case kFilterBpf2p: P->fDspBpf2p.instanceClear(); break;
|
||||
case kFilterBpf4p: P->fDspBpf4p.instanceClear(); break;
|
||||
case kFilterBpf6p: P->fDspBpf6p.instanceClear(); break;
|
||||
case kFilterBrf1p: P->fDspBrf1p.instanceClear(); break;
|
||||
case kFilterBrf2p: P->fDspBrf2p.instanceClear(); break;
|
||||
case kFilterHpf1p: P->fDspHpf1p.instanceClear(); break;
|
||||
case kFilterHpf2p: P->fDspHpf2p.instanceClear(); break;
|
||||
case kFilterHpf4p: P->fDspHpf4p.instanceClear(); break;
|
||||
case kFilterHpf6p: P->fDspHpf6p.instanceClear(); break;
|
||||
case kFilterLpf1p: P->fDspLpf1p.instanceClear(); break;
|
||||
case kFilterLpf2p: P->fDspLpf2p.instanceClear(); break;
|
||||
case kFilterLpf4p: P->fDspLpf4p.instanceClear(); break;
|
||||
case kFilterLpf6p: P->fDspLpf6p.instanceClear(); break;
|
||||
case kFilterPink: P->fDspPink.instanceClear(); break;
|
||||
case kFilterLpf2pSv: P->fDspLpf2pSv.instanceClear(); break;
|
||||
case kFilterHpf2pSv: P->fDspHpf2pSv.instanceClear(); break;
|
||||
case kFilterBpf2pSv: P->fDspBpf2pSv.instanceClear(); break;
|
||||
case kFilterBrf2pSv: P->fDspBrf2pSv.instanceClear(); break;
|
||||
case kFilterLsh: P->fDspLsh.instanceClear(); break;
|
||||
case kFilterHsh: P->fDspHsh.instanceClear(); break;
|
||||
case kFilterPeq: P->fDspPeq.instanceClear(); break;
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
template <class F>
|
||||
void Filter<NCh>::Impl::process(F &filter, const float *const in[NCh], float *const out[NCh], float cutoff, float q, float pksh, unsigned nframes)
|
||||
{
|
||||
filter.setCutoff(cutoff);
|
||||
filter.setQ(q);
|
||||
filter.setPkShGain(pksh);
|
||||
filter.compute(nframes, const_cast<float **>(in), const_cast<float **>(out));
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
void Filter<NCh>::process(const float *const in[NCh], float *const out[NCh], float cutoff, float q, float pksh, unsigned nframes)
|
||||
{
|
||||
if (P->fType == kFilterNone) {
|
||||
for (unsigned c = 0; c < NCh; ++c)
|
||||
copy<float>({ in[c], nframes }, { out[c], nframes });
|
||||
return;
|
||||
}
|
||||
|
||||
switch (P->fType) {
|
||||
case kFilterApf1p: P->process(P->fDspApf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf1p: P->process(P->fDspBpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf2p: P->process(P->fDspBpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf4p: P->process(P->fDspBpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf6p: P->process(P->fDspBpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf1p: P->process(P->fDspBrf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf2p: P->process(P->fDspBrf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf1p: P->process(P->fDspHpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf2p: P->process(P->fDspHpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf4p: P->process(P->fDspHpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf6p: P->process(P->fDspHpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf1p: P->process(P->fDspLpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf2p: P->process(P->fDspLpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf4p: P->process(P->fDspLpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf6p: P->process(P->fDspLpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterPink: P->process(P->fDspPink, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf2pSv: P->process(P->fDspLpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf2pSv: P->process(P->fDspHpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf2pSv: P->process(P->fDspBpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf2pSv: P->process(P->fDspBrf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLsh: P->process(P->fDspLsh, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHsh: P->process(P->fDspHsh, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterPeq: P->process(P->fDspPeq, in, out, cutoff, q, pksh, nframes); break;
|
||||
default: assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
template <class F>
|
||||
void Filter<NCh>::Impl::processModulated(F &filter, const float *const in[NCh], float *const out[NCh], const float *cutoff, const float *q, const float *pksh, unsigned nframes)
|
||||
{
|
||||
unsigned frame = 0;
|
||||
|
||||
while (frame < nframes) {
|
||||
unsigned current = nframes - frame;
|
||||
|
||||
if (current > config::filterControlInterval)
|
||||
current = config::filterControlInterval;
|
||||
|
||||
const float *current_in[NCh];
|
||||
float *current_out[NCh];
|
||||
|
||||
for (unsigned c = 0; c < NCh; ++c) {
|
||||
current_in[c] = in[c] + frame;
|
||||
current_out[c] = out[c] + frame;
|
||||
}
|
||||
|
||||
filter.setCutoff(cutoff[frame]);
|
||||
filter.setQ(q[frame]);
|
||||
filter.setPkShGain(pksh[frame]);
|
||||
filter.compute(current, const_cast<float **>(current_in), const_cast<float **>(current_out));
|
||||
|
||||
frame += current;
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
void Filter<NCh>::processModulated(const float *const in[NCh], float *const out[NCh], const float *cutoff, const float *q, const float *pksh, unsigned nframes)
|
||||
{
|
||||
if (P->fType == kFilterNone) {
|
||||
for (unsigned c = 0; c < NCh; ++c)
|
||||
copy<float>({ in[c], nframes }, { out[c], nframes });
|
||||
return;
|
||||
}
|
||||
|
||||
switch (P->fType) {
|
||||
case kFilterApf1p: P->processModulated(P->fDspApf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf1p: P->processModulated(P->fDspBpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf2p: P->processModulated(P->fDspBpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf4p: P->processModulated(P->fDspBpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf6p: P->processModulated(P->fDspBpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf1p: P->processModulated(P->fDspBrf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf2p: P->processModulated(P->fDspBrf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf1p: P->processModulated(P->fDspHpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf2p: P->processModulated(P->fDspHpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf4p: P->processModulated(P->fDspHpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf6p: P->processModulated(P->fDspHpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf1p: P->processModulated(P->fDspLpf1p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf2p: P->processModulated(P->fDspLpf2p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf4p: P->processModulated(P->fDspLpf4p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf6p: P->processModulated(P->fDspLpf6p, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterPink: P->processModulated(P->fDspPink, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLpf2pSv: P->processModulated(P->fDspLpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHpf2pSv: P->processModulated(P->fDspHpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBpf2pSv: P->processModulated(P->fDspBpf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterBrf2pSv: P->processModulated(P->fDspBrf2pSv, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterLsh: P->processModulated(P->fDspLsh, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterHsh: P->processModulated(P->fDspHsh, in, out, cutoff, q, pksh, nframes); break;
|
||||
case kFilterPeq: P->processModulated(P->fDspPeq, in, out, cutoff, q, pksh, nframes); break;
|
||||
default: assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
FilterType Filter<NCh>::type() const
|
||||
{
|
||||
return P->fType;
|
||||
}
|
||||
|
||||
template <unsigned NCh>
|
||||
void Filter<NCh>::setType(FilterType type)
|
||||
{
|
||||
if (P->fType != type) {
|
||||
P->fType = type;
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
template class Filter<1>;
|
||||
template class Filter<2>;
|
||||
|
||||
} // namespace sfz
|
||||
100
src/sfizz/SfzFilter.h
Normal file
100
src/sfizz/SfzFilter.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
// This code is part of the sfizz library and is licensed under a BSD 2-clause
|
||||
// license. You should have receive a LICENSE.md file along with the code.
|
||||
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
||||
|
||||
#pragma once
|
||||
#include <memory>
|
||||
|
||||
namespace sfz {
|
||||
|
||||
enum FilterType : int;
|
||||
|
||||
/**
|
||||
Multi-mode filter for SFZ v2
|
||||
Available for mono and stereo. (NCh=1, NCh=2)
|
||||
|
||||
Parameters:
|
||||
`cutoff`: it's the opcode `filN_cutoff` (Hz)
|
||||
`q`: it's the opcode `filN_resonance` (dB)
|
||||
`pksh`: it's the opcode `filN_gain` (dB)
|
||||
*/
|
||||
template <unsigned NCh>
|
||||
class Filter {
|
||||
public:
|
||||
Filter();
|
||||
~Filter();
|
||||
|
||||
/**
|
||||
Set up the filter constants.
|
||||
Run it exactly once after instantiating.
|
||||
*/
|
||||
void init(double sampleRate);
|
||||
|
||||
/**
|
||||
Reinitialize the filter memory to zeros.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
Process one cycle of the filter without modulating cutoff or Q.
|
||||
`cutoff` is a frequency expressed in Hz.
|
||||
`q` is a resonance expressed in dB.
|
||||
`pksh` is a peak/shelf gain expressed in dB.
|
||||
`in[i]` and `out[i]` may refer to identical buffers, for in-place processing
|
||||
*/
|
||||
void process(const float *const in[NCh], float *const out[NCh], float cutoff, float q, float pksh, unsigned nframes);
|
||||
|
||||
/**
|
||||
Process one cycle of the filter with cutoff and Q values varying over time.
|
||||
`cutoff` is a frequency expressed in Hz.
|
||||
`q` is a resonance expressed in dB.
|
||||
`pksh` is a peak/shelf gain expressed in dB.
|
||||
`in[i]` and `out[i]` may refer to identical buffers, for in-place processing
|
||||
*/
|
||||
void processModulated(const float *const in[NCh], float *const out[NCh], const float *cutoff, const float *q, const float *pksh, unsigned nframes);
|
||||
|
||||
/**
|
||||
Get the type of filter.
|
||||
*/
|
||||
FilterType type() const;
|
||||
|
||||
/**
|
||||
Set the type of filter.
|
||||
*/
|
||||
void setType(FilterType type);
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> P;
|
||||
};
|
||||
|
||||
enum FilterType : int {
|
||||
kFilterNone,
|
||||
kFilterApf1p,
|
||||
kFilterBpf1p,
|
||||
kFilterBpf2p,
|
||||
kFilterBpf4p,
|
||||
kFilterBpf6p,
|
||||
kFilterBrf1p,
|
||||
kFilterBrf2p,
|
||||
kFilterHpf1p,
|
||||
kFilterHpf2p,
|
||||
kFilterHpf4p,
|
||||
kFilterHpf6p,
|
||||
kFilterLpf1p,
|
||||
kFilterLpf2p,
|
||||
kFilterLpf4p,
|
||||
kFilterLpf6p,
|
||||
kFilterPink,
|
||||
kFilterLpf2pSv,
|
||||
kFilterHpf2pSv,
|
||||
kFilterBpf2pSv,
|
||||
kFilterBrf2pSv,
|
||||
kFilterLsh,
|
||||
kFilterHsh,
|
||||
kFilterPeq,
|
||||
};
|
||||
|
||||
} // namespace sfz
|
||||
162
src/sfizz/SfzFilterImpls.cxx
Normal file
162
src/sfizz/SfzFilterImpls.cxx
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
// This code is part of the sfizz library and is licensed under a BSD 2-clause
|
||||
// license. You should have receive a LICENSE.md file along with the code.
|
||||
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
|
||||
|
||||
struct dsp {};
|
||||
struct Meta {};
|
||||
struct UI {};
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
|
||||
#include "gen/filters/sfzApf1p.cxx"
|
||||
#include "gen/filters/sfzBpf1p.cxx"
|
||||
#include "gen/filters/sfzBpf2p.cxx"
|
||||
#include "gen/filters/sfzBpf4p.cxx"
|
||||
#include "gen/filters/sfzBpf6p.cxx"
|
||||
#include "gen/filters/sfzBrf1p.cxx"
|
||||
#include "gen/filters/sfzBrf2p.cxx"
|
||||
#include "gen/filters/sfzHpf1p.cxx"
|
||||
#include "gen/filters/sfzHpf2p.cxx"
|
||||
#include "gen/filters/sfzHpf4p.cxx"
|
||||
#include "gen/filters/sfzHpf6p.cxx"
|
||||
#include "gen/filters/sfzLpf1p.cxx"
|
||||
#include "gen/filters/sfzLpf2p.cxx"
|
||||
#include "gen/filters/sfzLpf4p.cxx"
|
||||
#include "gen/filters/sfzLpf6p.cxx"
|
||||
#include "gen/filters/sfzPink.cxx"
|
||||
#include "gen/filters/sfzLpf2pSv.cxx"
|
||||
#include "gen/filters/sfzHpf2pSv.cxx"
|
||||
#include "gen/filters/sfzBpf2pSv.cxx"
|
||||
#include "gen/filters/sfzBrf2pSv.cxx"
|
||||
#include "gen/filters/sfzLsh.cxx"
|
||||
#include "gen/filters/sfzHsh.cxx"
|
||||
#include "gen/filters/sfzPeq.cxx"
|
||||
|
||||
#include "gen/filters/sfz2chApf1p.cxx"
|
||||
#include "gen/filters/sfz2chBpf1p.cxx"
|
||||
#include "gen/filters/sfz2chBpf2p.cxx"
|
||||
#include "gen/filters/sfz2chBpf4p.cxx"
|
||||
#include "gen/filters/sfz2chBpf6p.cxx"
|
||||
#include "gen/filters/sfz2chBrf1p.cxx"
|
||||
#include "gen/filters/sfz2chBrf2p.cxx"
|
||||
#include "gen/filters/sfz2chHpf1p.cxx"
|
||||
#include "gen/filters/sfz2chHpf2p.cxx"
|
||||
#include "gen/filters/sfz2chHpf4p.cxx"
|
||||
#include "gen/filters/sfz2chHpf6p.cxx"
|
||||
#include "gen/filters/sfz2chLpf1p.cxx"
|
||||
#include "gen/filters/sfz2chLpf2p.cxx"
|
||||
#include "gen/filters/sfz2chLpf4p.cxx"
|
||||
#include "gen/filters/sfz2chLpf6p.cxx"
|
||||
#include "gen/filters/sfz2chPink.cxx"
|
||||
#include "gen/filters/sfz2chLpf2pSv.cxx"
|
||||
#include "gen/filters/sfz2chHpf2pSv.cxx"
|
||||
#include "gen/filters/sfz2chBpf2pSv.cxx"
|
||||
#include "gen/filters/sfz2chBrf2pSv.cxx"
|
||||
#include "gen/filters/sfz2chLsh.cxx"
|
||||
#include "gen/filters/sfz2chHsh.cxx"
|
||||
#include "gen/filters/sfz2chPeq.cxx"
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
template <class F> struct sfzFilter : public F {
|
||||
void setCutoff(float v) { F::fCutoff = v; }
|
||||
void setQ(float v) { F::fQ = v; }
|
||||
void setPkShGain(float) {}
|
||||
};
|
||||
|
||||
template <class F> struct sfzFilterNoQ : public F {
|
||||
void setCutoff(float v) { F::fCutoff = v; }
|
||||
void setQ(float) {}
|
||||
void setPkShGain(float) {}
|
||||
};
|
||||
|
||||
template <class F> struct sfzFilterNoCutoff : public F {
|
||||
void setCutoff(float) {}
|
||||
void setQ(float) {}
|
||||
void setPkShGain(float) {}
|
||||
};
|
||||
|
||||
template <class F> struct sfzFilterEq : public F {
|
||||
void setCutoff(float v) { F::fCutoff = v; }
|
||||
void setQ(float v) { F::fQ = v; }
|
||||
void setPkShGain(float v) { F::fPkShGain = v; }
|
||||
};
|
||||
|
||||
template <unsigned NCh> struct sfzLpf1p;
|
||||
template <unsigned NCh> struct sfzLpf2p;
|
||||
template <unsigned NCh> struct sfzLpf4p;
|
||||
template <unsigned NCh> struct sfzLpf6p;
|
||||
template <unsigned NCh> struct sfzHpf1p;
|
||||
template <unsigned NCh> struct sfzHpf2p;
|
||||
template <unsigned NCh> struct sfzHpf4p;
|
||||
template <unsigned NCh> struct sfzHpf6p;
|
||||
template <unsigned NCh> struct sfzBpf1p;
|
||||
template <unsigned NCh> struct sfzBpf2p;
|
||||
template <unsigned NCh> struct sfzBpf4p;
|
||||
template <unsigned NCh> struct sfzBpf6p;
|
||||
template <unsigned NCh> struct sfzApf1p;
|
||||
template <unsigned NCh> struct sfzBrf1p;
|
||||
template <unsigned NCh> struct sfzBrf2p;
|
||||
template <unsigned NCh> struct sfzPink;
|
||||
template <unsigned NCh> struct sfzLpf2pSv;
|
||||
template <unsigned NCh> struct sfzHpf2pSv;
|
||||
template <unsigned NCh> struct sfzBpf2pSv;
|
||||
template <unsigned NCh> struct sfzBrf2pSv;
|
||||
template <unsigned NCh> struct sfzLsh;
|
||||
template <unsigned NCh> struct sfzHsh;
|
||||
template <unsigned NCh> struct sfzPeq;
|
||||
|
||||
template<> struct sfzLpf1p<1> : public sfzFilterNoQ<faustLpf1p> {};
|
||||
template<> struct sfzLpf2p<1> : public sfzFilter<faustLpf2p> {};
|
||||
template<> struct sfzLpf4p<1> : public sfzFilter<faustLpf4p> {};
|
||||
template<> struct sfzLpf6p<1> : public sfzFilter<faustLpf6p> {};
|
||||
template<> struct sfzHpf1p<1> : public sfzFilterNoQ<faustHpf1p> {};
|
||||
template<> struct sfzHpf2p<1> : public sfzFilter<faustHpf2p> {};
|
||||
template<> struct sfzHpf4p<1> : public sfzFilter<faustHpf4p> {};
|
||||
template<> struct sfzHpf6p<1> : public sfzFilter<faustHpf6p> {};
|
||||
template<> struct sfzBpf1p<1> : public sfzFilterNoQ<faustBpf1p> {};
|
||||
template<> struct sfzBpf2p<1> : public sfzFilter<faustBpf2p> {};
|
||||
template<> struct sfzBpf4p<1> : public sfzFilter<faustBpf4p> {};
|
||||
template<> struct sfzBpf6p<1> : public sfzFilter<faustBpf6p> {};
|
||||
template<> struct sfzApf1p<1> : public sfzFilterNoQ<faustApf1p> {};
|
||||
template<> struct sfzBrf1p<1> : public sfzFilterNoQ<faustBrf1p> {};
|
||||
template<> struct sfzBrf2p<1> : public sfzFilter<faustBrf2p> {};
|
||||
template<> struct sfzPink<1> : public sfzFilterNoCutoff<faustPink> {};
|
||||
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 sfzLpf1p<2> : public sfzFilterNoQ<faust2chLpf1p> {};
|
||||
template<> struct sfzLpf2p<2> : public sfzFilter<faust2chLpf2p> {};
|
||||
template<> struct sfzLpf4p<2> : public sfzFilter<faust2chLpf4p> {};
|
||||
template<> struct sfzLpf6p<2> : public sfzFilter<faust2chLpf6p> {};
|
||||
template<> struct sfzHpf1p<2> : public sfzFilterNoQ<faust2chHpf1p> {};
|
||||
template<> struct sfzHpf2p<2> : public sfzFilter<faust2chHpf2p> {};
|
||||
template<> struct sfzHpf4p<2> : public sfzFilter<faust2chHpf4p> {};
|
||||
template<> struct sfzHpf6p<2> : public sfzFilter<faust2chHpf6p> {};
|
||||
template<> struct sfzBpf1p<2> : public sfzFilterNoQ<faust2chBpf1p> {};
|
||||
template<> struct sfzBpf2p<2> : public sfzFilter<faust2chBpf2p> {};
|
||||
template<> struct sfzBpf4p<2> : public sfzFilter<faust2chBpf4p> {};
|
||||
template<> struct sfzBpf6p<2> : public sfzFilter<faust2chBpf6p> {};
|
||||
template<> struct sfzApf1p<2> : public sfzFilterNoQ<faust2chApf1p> {};
|
||||
template<> struct sfzBrf1p<2> : public sfzFilterNoQ<faust2chBrf1p> {};
|
||||
template<> struct sfzBrf2p<2> : public sfzFilter<faust2chBrf2p> {};
|
||||
template<> struct sfzPink<2> : public sfzFilterNoCutoff<faust2chPink> {};
|
||||
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> {};
|
||||
72
src/sfizz/dsp/filters/filters_modulable.dsp
Normal file
72
src/sfizz/dsp/filters/filters_modulable.dsp
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
// -*- mode: faust; -*-
|
||||
|
||||
declare author "Jean Pierre Cimalando";
|
||||
declare license "BSD-2-Clause";
|
||||
|
||||
import("stdfaust.lib");
|
||||
rbj = library("rbj_filters.dsp");
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Biquad filter from normalized coefficients
|
||||
// b0,b1,b2,a1,a2 : normalized coefficients
|
||||
//-------------------------------------------------------------------------
|
||||
biquad(b0,b1,b2,a1,a2) = fi.iir((b0,b1,b2),(a1,a2));
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Biquad filter using smoothed coefficients
|
||||
// s : a smoothing function applied to each coefficient
|
||||
// b0,b1,b2,a1,a2 : normalized coefficients
|
||||
//-------------------------------------------------------------------------
|
||||
smoothBiquad(s,b0,b1,b2,a1,a2) = biquad(b0:s,b1:s,b2:s,a1:s,a2:s);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RBJ filter of a specific type using smoothed coefficients
|
||||
// s : a smoothing function applied to each coefficient
|
||||
// f : cutoff frequency
|
||||
// g : gain in decibel, for peaking and shelving types only
|
||||
// q : height of the resonant peak in linear units
|
||||
//-------------------------------------------------------------------------
|
||||
rbjLpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).LPF,x) : smoothBiquad(s);
|
||||
rbjHpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).HPF,x) : smoothBiquad(s);
|
||||
rbjBpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).BPF,x) : smoothBiquad(s);
|
||||
rbjNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).notch,x) : smoothBiquad(s);
|
||||
rbjApfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).APF,x) : smoothBiquad(s);
|
||||
rbjPeakingEqSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakingEQ,x) : smoothBiquad(s);
|
||||
rbjPeakingNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakNotch,x) : smoothBiquad(s);
|
||||
rbjLowShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).lowShelf,x) : smoothBiquad(s);
|
||||
rbjHighShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).highShelf,x) : smoothBiquad(s);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 1-pole low-pass filter
|
||||
// s : a smoothing function applied to each coefficient
|
||||
// f : cutoff frequency
|
||||
//-------------------------------------------------------------------------
|
||||
lp1Smooth(s,f) = fi.iir((1-p),(0-p)) with {
|
||||
p = exp(-2.*ma.PI*f/ma.SR) : s;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 1-pole high-pass filter
|
||||
// s : a smoothing function applied to each coefficient
|
||||
// f : cutoff frequency
|
||||
//-------------------------------------------------------------------------
|
||||
hp1Smooth(s,f) = fi.iir((0.5*(1.+p),-0.5*(1+p)),(0.-p)) with {
|
||||
p = exp(-2.*ma.PI*f/ma.SR) : s;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 1-pole all-pass filter
|
||||
// s : a smoothing function applied to each coefficient
|
||||
// f : cutoff frequency
|
||||
//-------------------------------------------------------------------------
|
||||
ap1Smooth(s,f) = fi.iir((a,1.),(a)) with {
|
||||
a = (-1.+2.*ma.PI*f/ma.SR) : s;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Example
|
||||
//------------------------------------------------------------------------------
|
||||
// process = rbjLpfSmooth(si.smoo, cutoff, 0.0, resonance : ba.db2linear) with {
|
||||
// cutoff = hslider("[1] Cutoff [unit:Hz] [scale:log]", 440.0, 50.0, 10000.0, 1.0);
|
||||
// resonance = hslider("[2] Resonance [unit:dB]", 0.0, 0.0, 40.0, 0.1);
|
||||
// };
|
||||
212
src/sfizz/dsp/filters/rbj_filters.dsp
Normal file
212
src/sfizz/dsp/filters/rbj_filters.dsp
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
/**
|
||||
Note(jpc): This is RBJ filter extracted from faustlibraries master branch.
|
||||
Unlike some prior versions found in faust 2.x, this one has been
|
||||
permissively relicensed.
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
************************************************************************
|
||||
FAUST library file
|
||||
Copyright (C) 2019-2020 GRAME, Centre National de Creation Musicale
|
||||
---------------------------------------------------------------------
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA.
|
||||
|
||||
EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
|
||||
larger FAUST program which directly or indirectly imports this library
|
||||
file and still distribute the compiled code generated by the FAUST
|
||||
compiler, or a modified version of this compiled code, under your own
|
||||
copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
|
||||
grants you the right to freely choose the license for the resulting
|
||||
compiled code. In particular the resulting compiled code has no obligation
|
||||
to be LGPL or GPL. For example you are free to choose a commerci
|
||||
************************************************************************
|
||||
************************************************************************/
|
||||
|
||||
declare name "MaxMSP compatibility Library";
|
||||
declare author "GRAME";
|
||||
declare copyright "GRAME";
|
||||
declare version "1.1";
|
||||
declare license "LGPL with exception";
|
||||
|
||||
ba = library("basics.lib");
|
||||
ma = library("maths.lib");
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Implementation of MaxMSP filtercoeff
|
||||
//
|
||||
// from : Cookbook formulae for audio EQ biquad filter coefficients
|
||||
// by : Robert Bristow-Johnson <rbj@audioimagination.com>
|
||||
// URL : http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
filtercoeff(f0, dBgain, Q) = environment
|
||||
{
|
||||
//----------------------------------------
|
||||
// biquad coeffs for various filters
|
||||
// usage : filtercoeff(f0, dBgain, Q).LPF
|
||||
//----------------------------------------
|
||||
|
||||
LPF = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = (1 - cos(w0))/2;
|
||||
b1 = 1 - cos(w0);
|
||||
b2 = (1 - cos(w0))/2;
|
||||
a0 = 1 + alpha;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha;
|
||||
};
|
||||
|
||||
HPF = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = (1 + cos(w0))/2;
|
||||
b1 = -1 - cos(w0);
|
||||
b2 = (1 + cos(w0))/2;
|
||||
a0 = 1 + alpha;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha;
|
||||
};
|
||||
|
||||
BPF = rbjcoef(a0, a1, a2, b0, b1, b2) // constant 0 dB peak gain
|
||||
with {
|
||||
b0 = alpha;
|
||||
b1 = 0;
|
||||
b2 = -alpha;
|
||||
a0 = 1 + alpha;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha;
|
||||
};
|
||||
|
||||
notch = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = 1;
|
||||
b1 = -2*cos(w0);
|
||||
b2 = 1;
|
||||
a0 = 1 + alpha;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha;
|
||||
};
|
||||
|
||||
APF = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = 1 - alpha;
|
||||
b1 = -2*cos(w0);
|
||||
b2 = 1 + alpha;
|
||||
a0 = 1 + alpha;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha;
|
||||
};
|
||||
|
||||
peakingEQ = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = 1 + alpha*A;
|
||||
b1 = -2*cos(w0);
|
||||
b2 = 1 - alpha*A;
|
||||
a0 = 1 + alpha/A;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha/A;
|
||||
};
|
||||
|
||||
peakNotch = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = 1 + alpha*G;
|
||||
b1 = -2*cos(w0);
|
||||
b2 = 1 - alpha*G;
|
||||
a0 = 1 + alpha/G;
|
||||
a1 = -2*cos(w0);
|
||||
a2 = 1 - alpha/G;
|
||||
};
|
||||
|
||||
lowShelf = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = A*((A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha);
|
||||
b1 = 2*A*((A-1) - (A+1)*cos(w0));
|
||||
b2 = A*((A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha);
|
||||
a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha;
|
||||
a1 = -2*((A-1) + (A+1)*cos(w0));
|
||||
a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha;
|
||||
};
|
||||
|
||||
highShelf = rbjcoef(a0, a1, a2, b0, b1, b2)
|
||||
with {
|
||||
b0 = A*((A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha);
|
||||
b1 = -2*A*((A-1) + (A+1)*cos(w0));
|
||||
b2 = A*((A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha);
|
||||
a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha;
|
||||
a1 = 2*((A-1) - (A+1)*cos(w0));
|
||||
a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha;
|
||||
};
|
||||
|
||||
// --------------------- implementation ------------------------------
|
||||
|
||||
// convert rbj coeffs to biquad coeffs
|
||||
rbjcoef(a0,a1,a2,b0,b1,b2) = (b0/a0, b1/a0, b2/a0, a1/a0, a2/a0);
|
||||
|
||||
// common values
|
||||
// alpha = sin(w0)/(2*Q);
|
||||
// w0 = 2*ma.PI*f0/Fs;
|
||||
alpha = sin(w0)/(2*max(0.001,Q));
|
||||
w0 = 2*ma.PI*max(0,f0)/Fs;
|
||||
Fs = ma.SR;
|
||||
A = 10^(dBgain/40); // (for peaking and shelving EQ filters only)
|
||||
G = sqrt(max(0.00001, dBgain)); // When gain is a linear values (i.e. not in dB)
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Implementation of MaxMSP biquad~
|
||||
// y[n] = a0 * x[n] + a1 * x[n-1] + a2 * x[n-2] - b1 * y[n-1] - b2 * y[n-2]
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
biquad(x,a0,a1,a2,b1,b2) = x : + ~ ((-1)*conv2(b1, b2)) : conv3(a0, a1, a2)
|
||||
with {
|
||||
conv2(c0,c1,x) = c0*x+c1*x';
|
||||
conv3(c0,c1,c2,x) = c0*x+c1*x'+c2*x'';
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Filters using filtercoeff and biquad
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Low Pass Filter
|
||||
LPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).LPF : biquad;
|
||||
|
||||
// High Pass Filter
|
||||
HPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).HPF : biquad;
|
||||
|
||||
// Band Pass Filter
|
||||
BPF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).BPF : biquad;
|
||||
|
||||
// notch Filter
|
||||
notch(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).notch : biquad;
|
||||
|
||||
// All Pass Filter
|
||||
APF(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).APF : biquad;
|
||||
|
||||
// ????
|
||||
peakingEQ(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).peakingEQ : biquad;
|
||||
|
||||
// Max peakNotch is like peakingEQ but with a linear gain
|
||||
peakNotch(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).peakNotch : biquad;
|
||||
|
||||
// ????
|
||||
lowShelf(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).lowShelf : biquad;
|
||||
|
||||
// ????
|
||||
highShelf(x, f0, gain, Q) = x , filtercoeff(f0,gain,Q).highShelf : biquad;
|
||||
140
src/sfizz/dsp/filters/sallenkey_modulable.dsp
Normal file
140
src/sfizz/dsp/filters/sallenkey_modulable.dsp
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
/**
|
||||
Note(jpc): this is a personal edit of the Sallen-Key state-variable filter
|
||||
from `vaeffects.lib`. This changes:
|
||||
- the frequency control, now in Hz instead of 0-1
|
||||
- the smooth parameter, allowing for slower parameter transitions
|
||||
while keeping some expensive computation out of the frame loop
|
||||
*/
|
||||
|
||||
import("stdfaust.lib");
|
||||
|
||||
declare author "Eric Tarr";
|
||||
declare license "MIT-style STK-4.3 license";
|
||||
|
||||
//================================Sallen Key Filters======================================
|
||||
// The following filters were implemented based on VA models of synthesizer
|
||||
// filters.
|
||||
//
|
||||
// The modeling approach is based on a Topology Preserving Transform (TPT) to
|
||||
// resolve the delay-free feedback loop in the corresponding analog filters.
|
||||
//
|
||||
// The primary processing block used to build other filters (Moog, Korg, etc.) is
|
||||
// based on a 1st-order Sallen-Key filter.
|
||||
//
|
||||
// The filters included in this script are 1st-order LPF/HPF and 2nd-order
|
||||
// state-variable filters capable of LPF, HPF, and BPF.
|
||||
//
|
||||
// #### Resources:
|
||||
//
|
||||
// * Vadim Zavalishin (2018) "The Art of VA Filter Design", v2.1.0
|
||||
// <https://www.native-instruments.com/fileadmin/ni_media/downloads/pdf/VAFilterDesign_2.1.0.pdf>
|
||||
// * Will Pirkle (2014) "Resolving Delay-Free Loops in Recursive Filters Using
|
||||
// the Modified Härmä Method", AES 137 <http://www.aes.org/e-lib/browse.cfm?elib=17517>
|
||||
// * Description and diagrams of 1st- and 2nd-order TPT filters:
|
||||
// <https://www.willpirkle.com/706-2/>
|
||||
//========================================================================================
|
||||
|
||||
//------------------`(fi.)sallenKey2ndOrder`-----------------
|
||||
// Sallen-Key generic multi-outputs 2nd order filter.
|
||||
//
|
||||
// This is a 2nd-order Sallen-Key state-variable filter. The idea is that by
|
||||
// "tapping" into different points in the circuit, different filters
|
||||
// (LPF,BPF,HPF) can be achieved. See Figure 4.6 of
|
||||
// <https://www.willpirkle.com/706-2/>
|
||||
//
|
||||
// This is also a good example of the next step for generalizing the Faust
|
||||
// programming approach used for all these VA filters. In this case, there are
|
||||
// three things to calculate each recursive step (y,s1,s2). For each thing, the
|
||||
// circuit is only calculated up to that point.
|
||||
//
|
||||
// Comparing the LPF to BPF, the output signal (y) is calculated similarly.
|
||||
// Except, the output of the BPF stops earlier in the circuit. Similarly, the
|
||||
// states (s1 and s2) only differ in that s2 includes a couple more terms
|
||||
// beyond what is used for s1.
|
||||
//
|
||||
// #### Usage
|
||||
//
|
||||
// ```
|
||||
// _ : sallenKey2ndOrder(smooth,freq,Q) : _,_,_
|
||||
// ```
|
||||
//
|
||||
// Where:
|
||||
//
|
||||
// * `freq`: cutoff frequency
|
||||
// * `Q`: q
|
||||
//---------------------------------------------------------------------
|
||||
sallenKey2ndOrder(smooth,freq,Q) = _<:(s1,s2,ylpf,ybpf,yhpf) : !,!,_,_,_
|
||||
letrec{
|
||||
's1 = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1);
|
||||
's2 = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1):*(g*2):+(s2);
|
||||
// Compute the LPF, BPF, HPF outputs
|
||||
'ylpf = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1):*(g):+(s2);
|
||||
'ybpf = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1);
|
||||
'yhpf = -(s2):-(s1*FBs1):*(alpha0);
|
||||
}
|
||||
with{
|
||||
wd = 2*ma.PI*freq;
|
||||
T = 1/ma.SR;
|
||||
wa = (2/T)*tan(wd*T/2);
|
||||
g = (wa*T/2):smooth;
|
||||
G = g/(1.0 + g);
|
||||
R = 1/(2*Q);
|
||||
FBs1 = (2*R+g):smooth;
|
||||
alpha0 = (1/(1 + 2*R*g + g*g)):smooth;
|
||||
};
|
||||
|
||||
//------------------`(fi.)sallenKey2ndOrderLPF`-----------------
|
||||
// Sallen-Key 2nd order lowpass filter (see description above).
|
||||
//
|
||||
//
|
||||
// #### Usage
|
||||
//
|
||||
// ```
|
||||
// _ : sallenKey2ndOrderLPF(smooth,freq,Q) : _
|
||||
// ```
|
||||
//
|
||||
// Where:
|
||||
//
|
||||
// * `freq`: cutoff frequency
|
||||
// * `Q`: q
|
||||
//---------------------------------------------------------------------
|
||||
// Specialize the generic implementation: keep the first LPF output, the compiler will only generate the needed code
|
||||
sallenKey2ndOrderLPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : _,!,!;
|
||||
|
||||
|
||||
//------------------`(fi.)sallenKey2ndOrderBPF`-----------------
|
||||
// Sallen-Key 2nd order bandpass filter (see description above).
|
||||
//
|
||||
//
|
||||
// #### Usage
|
||||
//
|
||||
// ```
|
||||
// _ : sallenKey2ndOrderBPF(smooth,freq,Q) : _
|
||||
// ```
|
||||
//
|
||||
// Where:
|
||||
//
|
||||
// * `freq`: cutoff frequency
|
||||
// * `Q`: q
|
||||
//---------------------------------------------------------------------
|
||||
// Specialize the generic implementation: keep the second BPF output, the compiler will only generate the needed code
|
||||
sallenKey2ndOrderBPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,_,!;
|
||||
|
||||
|
||||
//------------------`(fi.)sallenKey2ndOrderHPF`-----------------
|
||||
// Sallen-Key 2nd order highpass filter (see description above).
|
||||
//
|
||||
//
|
||||
// #### Usage
|
||||
//
|
||||
// ```
|
||||
// _ : sallenKey2ndOrderHPF(smooth,freq,Q) : _
|
||||
// ```
|
||||
//
|
||||
// Where:
|
||||
//
|
||||
// * `freq`: cutoff frequency
|
||||
// * `Q`: q
|
||||
//---------------------------------------------------------------------
|
||||
// Specialize the generic implementation: keep the third HPF output, the compiler will only generate the needed code
|
||||
sallenKey2ndOrderHPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,!,_;
|
||||
128
src/sfizz/dsp/filters/sfz_filters.dsp
Normal file
128
src/sfizz/dsp/filters/sfz_filters.dsp
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
// -*- mode: faust; -*-
|
||||
|
||||
declare author "Jean Pierre Cimalando";
|
||||
declare license "BSD-2-Clause";
|
||||
|
||||
import("stdfaust.lib");
|
||||
fm = library("filters_modulable.dsp");
|
||||
sk = library("sallenkey_modulable.dsp");
|
||||
|
||||
//==============================================================================
|
||||
// Generators
|
||||
|
||||
// the SFZ *noise generator
|
||||
sfzNoise = no.noise : *(gate) : *(0.25);
|
||||
|
||||
//==============================================================================
|
||||
// Filters
|
||||
|
||||
// the SFZ lowpass 1-pole filter
|
||||
sfzLpf1p = fm.lp1Smooth(smoothCoefs,cutoff);
|
||||
|
||||
// the SFZ lowpass 2-pole filter
|
||||
sfzLpf2p = fm.rbjLpfSmooth(smoothCoefs,cutoff,0.,Q);
|
||||
|
||||
// the SFZ lowpass 4-pole filter
|
||||
sfzLpf4p = sfzLpf2p : sfzLpf2p;
|
||||
|
||||
// the SFZ lowpass 6-pole filter
|
||||
sfzLpf6p = sfzLpf2p : sfzLpf2p : sfzLpf2p;
|
||||
|
||||
// the SFZ highpass 1-pole filter
|
||||
sfzHpf1p = fm.hp1Smooth(smoothCoefs,cutoff);
|
||||
|
||||
// the SFZ highpass 2-pole filter
|
||||
sfzHpf2p = fm.rbjHpfSmooth(smoothCoefs,cutoff,0.,Q);
|
||||
|
||||
// the SFZ highpass 4-pole filter
|
||||
sfzHpf4p = sfzHpf2p : sfzHpf2p;
|
||||
|
||||
// the SFZ highpass 6-pole filter
|
||||
sfzHpf6p = sfzHpf2p : sfzHpf2p : sfzHpf2p;
|
||||
|
||||
// the SFZ bandpass 1-pole filter
|
||||
sfzBpf1p = sfzLpf1p : sfzHpf1p;
|
||||
|
||||
// the SFZ bandpass 2-pole filter
|
||||
sfzBpf2p = fm.rbjBpfSmooth(smoothCoefs,cutoff,0.,Q);
|
||||
|
||||
// the SFZ bandpass 4-pole filter
|
||||
// Note: bpf_4p not in specification but here anyway
|
||||
sfzBpf4p = sfzBpf2p : sfzBpf2p;
|
||||
|
||||
// the SFZ bandpass 6-pole filter
|
||||
// Note: bpf_6p not in specification but here anyway
|
||||
sfzBpf6p = sfzBpf2p : sfzBpf2p : sfzBpf2p;
|
||||
|
||||
// the SFZ allpass 1-pole filter
|
||||
sfzApf1p = fm.ap1Smooth(smoothCoefs,cutoff);
|
||||
|
||||
// the SFZ notch 1-pole filter
|
||||
// Note: this thing is my invention, may not be correct.
|
||||
// in Sforzando, 1p seems implemented the same as 2p.
|
||||
sfzBrf1p = _ <: (_, (sfzApf1p : sfzApf1p)) :> +;
|
||||
|
||||
// the SFZ notch 2-pole filter
|
||||
sfzBrf2p = fm.rbjNotchSmooth(smoothCoefs,cutoff,0.,Q);
|
||||
|
||||
// the SFZ pink filter
|
||||
sfzPink = no.pink_filter;
|
||||
|
||||
// the SFZ 2-pole state-variable lowpass filter
|
||||
sfzLpf2pSv = sk.sallenKey2ndOrderLPF(smoothCoefs,cutoff,Q);
|
||||
|
||||
// the SFZ 2-pole state-variable highpass filter
|
||||
sfzHpf2pSv = sk.sallenKey2ndOrderHPF(smoothCoefs,cutoff,Q);
|
||||
|
||||
// the SFZ 2-pole state-variable bandpass filter
|
||||
// Note: attenuate in order to have the resonant peak at 0 dB (same as sfzBpf2p)
|
||||
sfzBpf2pSv = sk.sallenKey2ndOrderBPF(smoothCoefs,cutoff,Q) : *((1./Q):smoothCoefs);
|
||||
|
||||
// the SFZ 2-pole state-variable notch filter
|
||||
sfzBrf2pSv = _ <: (sfzLpf2pSv, sfzHpf2pSv) :> +;
|
||||
|
||||
// the SFZ low-shelf filter
|
||||
sfzLsh = fm.rbjLowShelfSmooth(smoothCoefs,cutoff,pkShGain,Q);
|
||||
|
||||
// the SFZ high-shelf filter
|
||||
sfzHsh = fm.rbjHighShelfSmooth(smoothCoefs,cutoff,pkShGain,Q);
|
||||
|
||||
// the SFZ peaking EQ filter
|
||||
sfzPeq = fm.rbjPeakingEqSmooth(smoothCoefs,cutoff,pkShGain,Q);
|
||||
|
||||
//==============================================================================
|
||||
// Filters (stereo)
|
||||
|
||||
sfz2chLpf1p = par(i,2,sfzLpf1p);
|
||||
sfz2chLpf2p = par(i,2,sfzLpf2p);
|
||||
sfz2chLpf4p = par(i,2,sfzLpf4p);
|
||||
sfz2chLpf6p = par(i,2,sfzLpf6p);
|
||||
sfz2chHpf1p = par(i,2,sfzHpf1p);
|
||||
sfz2chHpf2p = par(i,2,sfzHpf2p);
|
||||
sfz2chHpf4p = par(i,2,sfzHpf4p);
|
||||
sfz2chHpf6p = par(i,2,sfzHpf6p);
|
||||
sfz2chBpf1p = par(i,2,sfzBpf1p);
|
||||
sfz2chBpf2p = par(i,2,sfzBpf2p);
|
||||
sfz2chBpf4p = par(i,2,sfzBpf4p);
|
||||
sfz2chBpf6p = par(i,2,sfzBpf6p);
|
||||
sfz2chApf1p = par(i,2,sfzApf1p);
|
||||
sfz2chBrf1p = par(i,2,sfzBrf1p);
|
||||
sfz2chBrf2p = par(i,2,sfzBrf2p);
|
||||
sfz2chPink = par(i,2,sfzPink);
|
||||
sfz2chLpf2pSv = par(i,2,sfzLpf2pSv);
|
||||
sfz2chHpf2pSv = par(i,2,sfzHpf2pSv);
|
||||
sfz2chBpf2pSv = par(i,2,sfzBpf2pSv);
|
||||
sfz2chBrf2pSv = par(i,2,sfzBrf2pSv);
|
||||
sfz2chLsh = par(i,2,sfzLsh);
|
||||
sfz2chHsh = par(i,2,sfzHsh);
|
||||
sfz2chPeq = par(i,2,sfzPeq);
|
||||
|
||||
//==============================================================================
|
||||
// Filter parameters
|
||||
|
||||
cutoff = hslider("[01] Cutoff [unit:Hz] [scale:log]", 440.0, 50.0, 10000.0, 1.0);
|
||||
Q = vslider("[02] Resonance [unit:dB]", 0.0, 0.0, 40.0, 0.1) : ba.db2linear;
|
||||
pkShGain = vslider("[03] Peak/shelf gain [unit:dB]", 0.0, 0.0, 40.0, 0.1);
|
||||
|
||||
// smoothing function to prevent fast changes of filter coefficients
|
||||
smoothCoefs = si.smoo; // TODO check if this is appropriate otherwise replace
|
||||
156
src/sfizz/gen/filters/sfz2chApf1p.cxx
Normal file
156
src/sfizz/gen/filters/sfz2chApf1p.cxx
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chApf1p_H__
|
||||
#define __faust2chApf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chApf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chApf1p* clone() {
|
||||
return new faust2chApf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT((fRec2[1] + (fRec1[0] * fRec2[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
171
src/sfizz/gen/filters/sfz2chBpf1p.cxx
Normal file
171
src/sfizz/gen/filters/sfz2chBpf1p.cxx
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf1p_H__
|
||||
#define __faust2chBpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec4[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf1p* clone() {
|
||||
return new faust2chBpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
double fTemp2 = (1.0 - fRec2[0]);
|
||||
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
|
||||
double fTemp3 = (fRec2[0] + 1.0);
|
||||
double fTemp4 = (0.0 - (0.5 * fTemp3));
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4)));
|
||||
fRec4[0] = (fTemp1 + (fRec2[0] * fRec4[1]));
|
||||
fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1]));
|
||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1])));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
193
src/sfizz/gen/filters/sfz2chBpf2p.cxx
Normal file
193
src/sfizz/gen/filters/sfz2chBpf2p.cxx
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2p_H__
|
||||
#define __faust2chBpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf2p* clone() {
|
||||
return new faust2chBpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow7);
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (0.999 * fRec4[1]);
|
||||
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
203
src/sfizz/gen/filters/sfz2chBpf2pSv.cxx
Normal file
203
src/sfizz/gen/filters/sfz2chBpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2pSv_H__
|
||||
#define __faust2chBpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec6[2];
|
||||
double fRec8[2];
|
||||
double fRec9[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf2pSv* clone() {
|
||||
return new faust2chBpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
|
||||
double fSlow2 = (1.0 / fSlow1);
|
||||
double fSlow3 = (0.0010000000000000009 / fSlow1);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp2 = (fSlow2 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp5 = (fTemp3 * fTemp4);
|
||||
double fTemp6 = (fRec2[1] + fTemp5);
|
||||
double fRec0 = fTemp6;
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6)));
|
||||
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
||||
fRec2[0] = fTemp7;
|
||||
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||
double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1])));
|
||||
double fTemp9 = (fTemp3 * fTemp8);
|
||||
double fTemp10 = (fRec9[1] + fTemp9);
|
||||
double fRec7 = fTemp10;
|
||||
fRec8[0] = (fRec8[1] + (2.0 * (fRec3[0] * fTemp10)));
|
||||
double fTemp11 = (fRec9[1] + (2.0 * fTemp9));
|
||||
fRec9[0] = fTemp11;
|
||||
output1[i] = FAUSTFLOAT((fRec6[0] * fRec7));
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
207
src/sfizz/gen/filters/sfz2chBpf4p.cxx
Normal file
207
src/sfizz/gen/filters/sfz2chBpf4p.cxx
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf4p_H__
|
||||
#define __faust2chBpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec6[2];
|
||||
double fRec1[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec8[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec7[l8] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf4p* clone() {
|
||||
return new faust2chBpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (0.999 * fRec5[1]);
|
||||
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
|
||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
|
||||
fRec8[0] = (fTemp1 - ((fRec3[0] * fRec8[1]) + (fRec4[0] * fRec8[2])));
|
||||
fRec7[0] = ((((fRec0[0] * fRec8[0]) + (fRec5[0] * fRec8[1])) + (fRec6[0] * fRec8[2])) - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec7[0]) + (fRec5[0] * fRec7[1])) + (fRec6[0] * fRec7[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
221
src/sfizz/gen/filters/sfz2chBpf6p.cxx
Normal file
221
src/sfizz/gen/filters/sfz2chBpf6p.cxx
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf6p_H__
|
||||
#define __faust2chBpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec7[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec10[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec2[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec1[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec10[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec9[l9] = 0.0;
|
||||
}
|
||||
for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) {
|
||||
fRec8[l10] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf6p* clone() {
|
||||
return new faust2chBpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (0.999 * fRec6[1]);
|
||||
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
|
||||
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||
fRec10[0] = (fTemp1 - ((fRec4[0] * fRec10[1]) + (fRec5[0] * fRec10[2])));
|
||||
fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec6[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec6[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec6[0] * fRec8[1])) + (fRec7[0] * fRec8[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec10[2] = fRec10[1];
|
||||
fRec10[1] = fRec10[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
168
src/sfizz/gen/filters/sfz2chBrf1p.cxx
Normal file
168
src/sfizz/gen/filters/sfz2chBrf1p.cxx
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf1p_H__
|
||||
#define __faust2chBrf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec4[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf1p* clone() {
|
||||
return new faust2chBrf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1]));
|
||||
fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1])));
|
||||
output1[i] = FAUSTFLOAT((fTemp1 + (fRec3[1] + (fRec2[0] * fRec3[0]))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfz2chBrf2p.cxx
Normal file
179
src/sfizz/gen/filters/sfz2chBrf2p.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2p_H__
|
||||
#define __faust2chBrf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec1[3];
|
||||
double fRec3[2];
|
||||
double fRec4[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec1[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf2p* clone() {
|
||||
return new faust2chBrf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow2 = (fSlow1 + 1.0);
|
||||
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
|
||||
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
|
||||
double fSlow5 = (0.0010000000000000009 / fSlow2);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
|
||||
double fTemp2 = (fRec0[0] * fRec1[1]);
|
||||
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||
double fTemp3 = (fRec0[0] * fRec4[1]);
|
||||
fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2])));
|
||||
output1[i] = FAUSTFLOAT((fTemp3 + (fRec3[0] * (fRec4[0] + fRec4[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[2] = fRec4[1];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
197
src/sfizz/gen/filters/sfz2chBrf2pSv.cxx
Normal file
197
src/sfizz/gen/filters/sfz2chBrf2pSv.cxx
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2pSv_H__
|
||||
#define __faust2chBrf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec9[2];
|
||||
double fRec10[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec6[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec9[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec10[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf2pSv* clone() {
|
||||
return new faust2chBrf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
|
||||
double fTemp2 = (fSlow1 + fRec5[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp2) + 1.0)));
|
||||
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||
double fRec0 = (fRec4[0] * fTemp3);
|
||||
double fTemp4 = (fRec5[0] * fRec4[0]);
|
||||
double fTemp5 = (fTemp4 * fTemp3);
|
||||
double fTemp6 = (fRec3[1] + (2.0 * fTemp5));
|
||||
double fRec1 = (fRec2[1] + (fRec5[0] * fTemp6));
|
||||
double fTemp7 = (fRec3[1] + fTemp5);
|
||||
fRec2[0] = (fRec2[1] + (2.0 * (fRec5[0] * fTemp7)));
|
||||
fRec3[0] = fTemp6;
|
||||
output0[i] = FAUSTFLOAT((fRec1 + fRec0));
|
||||
double fTemp8 = (fTemp1 - (fRec9[1] + (fRec6[0] * fRec10[1])));
|
||||
double fRec7 = (fRec4[0] * fTemp8);
|
||||
double fTemp9 = (fTemp4 * fTemp8);
|
||||
double fTemp10 = (fRec10[1] + (2.0 * fTemp9));
|
||||
double fRec8 = (fRec9[1] + (fRec5[0] * fTemp10));
|
||||
double fTemp11 = (fRec10[1] + fTemp9);
|
||||
fRec9[0] = (fRec9[1] + (2.0 * (fRec5[0] * fTemp11)));
|
||||
fRec10[0] = fTemp10;
|
||||
output1[i] = FAUSTFLOAT((fRec8 + fRec7));
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec10[1] = fRec10[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
158
src/sfizz/gen/filters/sfz2chHpf1p.cxx
Normal file
158
src/sfizz/gen/filters/sfz2chHpf1p.cxx
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf1p_H__
|
||||
#define __faust2chHpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf1p* clone() {
|
||||
return new faust2chHpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (fRec1[0] + 1.0);
|
||||
double fTemp3 = (0.0 - (0.5 * fTemp2));
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3)));
|
||||
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
185
src/sfizz/gen/filters/sfz2chHpf2p.cxx
Normal file
185
src/sfizz/gen/filters/sfz2chHpf2p.cxx
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2p_H__
|
||||
#define __faust2chHpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf2p* clone() {
|
||||
return new faust2chHpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
195
src/sfizz/gen/filters/sfz2chHpf2pSv.cxx
Normal file
195
src/sfizz/gen/filters/sfz2chHpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2pSv_H__
|
||||
#define __faust2chHpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf2pSv* clone() {
|
||||
return new faust2chHpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
|
||||
double fTemp2 = (fSlow1 + fRec4[0]);
|
||||
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp2) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fRec0 = (fRec3[0] * fTemp3);
|
||||
double fTemp4 = (fRec4[0] * fRec3[0]);
|
||||
double fTemp5 = (fTemp4 * fTemp3);
|
||||
double fTemp6 = (fRec2[1] + fTemp5);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec4[0] * fTemp6)));
|
||||
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
||||
fRec2[0] = fTemp7;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
double fTemp8 = (fTemp1 - (fRec7[1] + (fRec5[0] * fRec8[1])));
|
||||
double fRec6 = (fRec3[0] * fTemp8);
|
||||
double fTemp9 = (fTemp4 * fTemp8);
|
||||
double fTemp10 = (fRec8[1] + fTemp9);
|
||||
fRec7[0] = (fRec7[1] + (2.0 * (fRec4[0] * fTemp10)));
|
||||
double fTemp11 = (fRec8[1] + (2.0 * fTemp9));
|
||||
fRec8[0] = fTemp11;
|
||||
output1[i] = FAUSTFLOAT(fRec6);
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
199
src/sfizz/gen/filters/sfz2chHpf4p.cxx
Normal file
199
src/sfizz/gen/filters/sfz2chHpf4p.cxx
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf4p_H__
|
||||
#define __faust2chHpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
double fRec7[3];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec7[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec6[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf4p* clone() {
|
||||
return new faust2chHpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
fRec6[0] = (((fRec0[0] * fRec7[1]) + (fRec5[0] * (fRec7[0] + fRec7[2]))) - ((fRec3[0] * fRec6[1]) + (fRec4[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec6[1]) + (fRec5[0] * (fRec6[0] + fRec6[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
213
src/sfizz/gen/filters/sfz2chHpf6p.cxx
Normal file
213
src/sfizz/gen/filters/sfz2chHpf6p.cxx
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf6p_H__
|
||||
#define __faust2chHpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec8[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec7[l9] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf6p* clone() {
|
||||
return new faust2chHpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec9[0] = (fTemp1 - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = (((fRec0[0] * fRec9[1]) + (fRec6[0] * (fRec9[0] + fRec9[2]))) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
fRec7[0] = (((fRec0[0] * fRec8[1]) + (fRec6[0] * (fRec8[0] + fRec8[2]))) - ((fRec4[0] * fRec7[1]) + (fRec5[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec7[1]) + (fRec6[0] * (fRec7[0] + fRec7[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
198
src/sfizz/gen/filters/sfz2chHsh.cxx
Normal file
198
src/sfizz/gen/filters/sfz2chHsh.cxx
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHsh_H__
|
||||
#define __faust2chHsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHsh* clone() {
|
||||
return new faust2chHsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
|
||||
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
|
||||
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
|
||||
double fSlow9 = (fSlow0 + fSlow5);
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
|
||||
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
157
src/sfizz/gen/filters/sfz2chLpf1p.cxx
Normal file
157
src/sfizz/gen/filters/sfz2chLpf1p.cxx
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf1p_H__
|
||||
#define __faust2chLpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf1p* clone() {
|
||||
return new faust2chLpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (1.0 - fRec1[0]);
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
|
||||
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
186
src/sfizz/gen/filters/sfz2chLpf2p.cxx
Normal file
186
src/sfizz/gen/filters/sfz2chLpf2p.cxx
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2p_H__
|
||||
#define __faust2chLpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf2p* clone() {
|
||||
return new faust2chLpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
195
src/sfizz/gen/filters/sfz2chLpf2pSv.cxx
Normal file
195
src/sfizz/gen/filters/sfz2chLpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2pSv_H__
|
||||
#define __faust2chLpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf2pSv* clone() {
|
||||
return new faust2chLpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp2 = (fSlow1 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp5 = (fTemp3 * fTemp4);
|
||||
double fTemp6 = (fRec2[1] + (2.0 * fTemp5));
|
||||
double fRec0 = (fRec1[1] + (fRec3[0] * fTemp6));
|
||||
double fTemp7 = (fRec2[1] + fTemp5);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp7)));
|
||||
fRec2[0] = fTemp6;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
double fTemp8 = (fTemp1 - (fRec7[1] + (fRec5[0] * fRec8[1])));
|
||||
double fTemp9 = (fTemp3 * fTemp8);
|
||||
double fTemp10 = (fRec8[1] + (2.0 * fTemp9));
|
||||
double fRec6 = (fRec7[1] + (fRec3[0] * fTemp10));
|
||||
double fTemp11 = (fRec8[1] + fTemp9);
|
||||
fRec7[0] = (fRec7[1] + (2.0 * (fRec3[0] * fTemp11)));
|
||||
fRec8[0] = fTemp10;
|
||||
output1[i] = FAUSTFLOAT(fRec6);
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
200
src/sfizz/gen/filters/sfz2chLpf4p.cxx
Normal file
200
src/sfizz/gen/filters/sfz2chLpf4p.cxx
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf4p_H__
|
||||
#define __faust2chLpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
double fRec7[3];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec7[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec6[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf4p* clone() {
|
||||
return new faust2chLpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
fRec6[0] = (((fRec0[0] * fRec7[1]) + (fRec5[0] * (fRec7[0] + fRec7[2]))) - ((fRec3[0] * fRec6[1]) + (fRec4[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec6[1]) + (fRec5[0] * (fRec6[0] + fRec6[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
214
src/sfizz/gen/filters/sfz2chLpf6p.cxx
Normal file
214
src/sfizz/gen/filters/sfz2chLpf6p.cxx
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf6p_H__
|
||||
#define __faust2chLpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec8[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec7[l9] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf6p* clone() {
|
||||
return new faust2chLpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec9[0] = (fTemp1 - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = (((fRec0[0] * fRec9[1]) + (fRec6[0] * (fRec9[0] + fRec9[2]))) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
fRec7[0] = (((fRec0[0] * fRec8[1]) + (fRec6[0] * (fRec8[0] + fRec8[2]))) - ((fRec4[0] * fRec7[1]) + (fRec5[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec7[1]) + (fRec6[0] * (fRec7[0] + fRec7[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
198
src/sfizz/gen/filters/sfz2chLsh.cxx
Normal file
198
src/sfizz/gen/filters/sfz2chLsh.cxx
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLsh_H__
|
||||
#define __faust2chLsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLsh* clone() {
|
||||
return new faust2chLsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = (fSlow0 + fSlow5);
|
||||
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
|
||||
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
|
||||
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
192
src/sfizz/gen/filters/sfz2chPeq.cxx
Normal file
192
src/sfizz/gen/filters/sfz2chPeq.cxx
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPeq_H__
|
||||
#define __faust2chPeq_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chPeq : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chPeq* clone() {
|
||||
return new faust2chPeq();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
|
||||
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
|
||||
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
|
||||
double fTemp2 = (fRec1[0] * fRec0[1]);
|
||||
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
||||
double fTemp3 = (fRec1[0] * fRec5[1]);
|
||||
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec3[0] * fRec5[0]) + (fTemp3 + (fRec4[0] * fRec5[2]))));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
148
src/sfizz/gen/filters/sfz2chPink.cxx
Normal file
148
src/sfizz/gen/filters/sfz2chPink.cxx
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPink_H__
|
||||
#define __faust2chPink_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chPink : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
double fRec0[4];
|
||||
double fRec1[4];
|
||||
int fSampleRate;
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chPink* clone() {
|
||||
return new faust2chPink();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
||||
fRec1[0] = ((fTemp1 + ((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3]))) - (2.0172658750000001 * fRec1[2]));
|
||||
output1[i] = FAUSTFLOAT((((0.049922034999999997 * fRec1[0]) + (0.050612698999999997 * fRec1[2])) - ((0.095993537000000004 * fRec1[1]) + (0.0044087859999999996 * fRec1[3]))));
|
||||
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||
fRec0[j0] = fRec0[(j0 - 1)];
|
||||
}
|
||||
for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) {
|
||||
fRec1[j1] = fRec1[(j1 - 1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
138
src/sfizz/gen/filters/sfzApf1p.cxx
Normal file
138
src/sfizz/gen/filters/sfzApf1p.cxx
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustApf1p_H__
|
||||
#define __faustApf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustApf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustApf1p* clone() {
|
||||
return new faustApf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
145
src/sfizz/gen/filters/sfzBpf1p.cxx
Normal file
145
src/sfizz/gen/filters/sfzBpf1p.cxx
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf1p_H__
|
||||
#define __faustBpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf1p* clone() {
|
||||
return new faustBpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec2[0] + 1.0);
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
174
src/sfizz/gen/filters/sfzBpf2p.cxx
Normal file
174
src/sfizz/gen/filters/sfzBpf2p.cxx
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2p_H__
|
||||
#define __faustBpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf2p* clone() {
|
||||
return new faustBpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow7);
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (0.999 * fRec4[1]);
|
||||
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
173
src/sfizz/gen/filters/sfzBpf2pSv.cxx
Normal file
173
src/sfizz/gen/filters/sfzBpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2pSv_H__
|
||||
#define __faustBpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec6[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf2pSv* clone() {
|
||||
return new faustBpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
|
||||
double fSlow2 = (1.0 / fSlow1);
|
||||
double fSlow3 = (0.0010000000000000009 / fSlow1);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp1 = (fSlow2 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + fTemp3);
|
||||
double fRec0 = fTemp4;
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4)));
|
||||
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
||||
fRec2[0] = fTemp5;
|
||||
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
181
src/sfizz/gen/filters/sfzBpf4p.cxx
Normal file
181
src/sfizz/gen/filters/sfzBpf4p.cxx
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf4p_H__
|
||||
#define __faustBpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec6[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf4p* clone() {
|
||||
return new faustBpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (0.999 * fRec5[1]);
|
||||
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
|
||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
188
src/sfizz/gen/filters/sfzBpf6p.cxx
Normal file
188
src/sfizz/gen/filters/sfzBpf6p.cxx
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf6p_H__
|
||||
#define __faustBpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec7[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec2[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec1[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf6p* clone() {
|
||||
return new faustBpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (0.999 * fRec6[1]);
|
||||
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
|
||||
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
144
src/sfizz/gen/filters/sfzBrf1p.cxx
Normal file
144
src/sfizz/gen/filters/sfzBrf1p.cxx
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf1p_H__
|
||||
#define __faustBrf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf1p* clone() {
|
||||
return new faustBrf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
159
src/sfizz/gen/filters/sfzBrf2p.cxx
Normal file
159
src/sfizz/gen/filters/sfzBrf2p.cxx
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2p_H__
|
||||
#define __faustBrf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec1[3];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec1[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf2p* clone() {
|
||||
return new faustBrf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow2 = (fSlow1 + 1.0);
|
||||
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
|
||||
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
|
||||
double fSlow5 = (0.0010000000000000009 / fSlow2);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
|
||||
double fTemp1 = (fRec0[0] * fRec1[1]);
|
||||
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2])));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
166
src/sfizz/gen/filters/sfzBrf2pSv.cxx
Normal file
166
src/sfizz/gen/filters/sfzBrf2pSv.cxx
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2pSv_H__
|
||||
#define __faustBrf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec6[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf2pSv* clone() {
|
||||
return new faustBrf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
|
||||
double fTemp1 = (fSlow1 + fRec5[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp1) + 1.0)));
|
||||
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||
double fRec0 = (fRec4[0] * fTemp2);
|
||||
double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec3[1] + (2.0 * fTemp3));
|
||||
double fRec1 = (fRec2[1] + (fRec5[0] * fTemp4));
|
||||
double fTemp5 = (fRec3[1] + fTemp3);
|
||||
fRec2[0] = (fRec2[1] + (2.0 * (fRec5[0] * fTemp5)));
|
||||
fRec3[0] = fTemp4;
|
||||
output0[i] = FAUSTFLOAT((fRec1 + fRec0));
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
139
src/sfizz/gen/filters/sfzHpf1p.cxx
Normal file
139
src/sfizz/gen/filters/sfzHpf1p.cxx
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf1p_H__
|
||||
#define __faustHpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf1p* clone() {
|
||||
return new faustHpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec1[0] + 1.0);
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
166
src/sfizz/gen/filters/sfzHpf2p.cxx
Normal file
166
src/sfizz/gen/filters/sfzHpf2p.cxx
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2p_H__
|
||||
#define __faustHpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf2p* clone() {
|
||||
return new faustHpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
165
src/sfizz/gen/filters/sfzHpf2pSv.cxx
Normal file
165
src/sfizz/gen/filters/sfzHpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2pSv_H__
|
||||
#define __faustHpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf2pSv* clone() {
|
||||
return new faustHpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
|
||||
double fTemp1 = (fSlow1 + fRec4[0]);
|
||||
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fRec0 = (fRec3[0] * fTemp2);
|
||||
double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + fTemp3);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec4[0] * fTemp4)));
|
||||
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
||||
fRec2[0] = fTemp5;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
173
src/sfizz/gen/filters/sfzHpf4p.cxx
Normal file
173
src/sfizz/gen/filters/sfzHpf4p.cxx
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf4p_H__
|
||||
#define __faustHpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf4p* clone() {
|
||||
return new faustHpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
180
src/sfizz/gen/filters/sfzHpf6p.cxx
Normal file
180
src/sfizz/gen/filters/sfzHpf6p.cxx
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf6p_H__
|
||||
#define __faustHpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf6p* clone() {
|
||||
return new faustHpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfzHsh.cxx
Normal file
179
src/sfizz/gen/filters/sfzHsh.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHsh_H__
|
||||
#define __faustHsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHsh* clone() {
|
||||
return new faustHsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
|
||||
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
|
||||
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
|
||||
double fSlow9 = (fSlow0 + fSlow5);
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
|
||||
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
138
src/sfizz/gen/filters/sfzLpf1p.cxx
Normal file
138
src/sfizz/gen/filters/sfzLpf1p.cxx
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf1p_H__
|
||||
#define __faustLpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf1p* clone() {
|
||||
return new faustLpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
167
src/sfizz/gen/filters/sfzLpf2p.cxx
Normal file
167
src/sfizz/gen/filters/sfzLpf2p.cxx
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2p_H__
|
||||
#define __faustLpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf2p* clone() {
|
||||
return new faustLpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
165
src/sfizz/gen/filters/sfzLpf2pSv.cxx
Normal file
165
src/sfizz/gen/filters/sfzLpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2pSv_H__
|
||||
#define __faustLpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf2pSv* clone() {
|
||||
return new faustLpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp1 = (fSlow1 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + (2.0 * fTemp3));
|
||||
double fRec0 = (fRec1[1] + (fRec3[0] * fTemp4));
|
||||
double fTemp5 = (fRec2[1] + fTemp3);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp5)));
|
||||
fRec2[0] = fTemp4;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
174
src/sfizz/gen/filters/sfzLpf4p.cxx
Normal file
174
src/sfizz/gen/filters/sfzLpf4p.cxx
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf4p_H__
|
||||
#define __faustLpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf4p* clone() {
|
||||
return new faustLpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
181
src/sfizz/gen/filters/sfzLpf6p.cxx
Normal file
181
src/sfizz/gen/filters/sfzLpf6p.cxx
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf6p_H__
|
||||
#define __faustLpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf6p* clone() {
|
||||
return new faustLpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfzLsh.cxx
Normal file
179
src/sfizz/gen/filters/sfzLsh.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLsh_H__
|
||||
#define __faustLsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLsh* clone() {
|
||||
return new faustLsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = (fSlow0 + fSlow5);
|
||||
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
|
||||
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
|
||||
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
172
src/sfizz/gen/filters/sfzPeq.cxx
Normal file
172
src/sfizz/gen/filters/sfzPeq.cxx
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPeq_H__
|
||||
#define __faustPeq_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustPeq : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustPeq* clone() {
|
||||
return new faustPeq();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
|
||||
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
|
||||
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
|
||||
double fTemp1 = (fRec1[0] * fRec0[1]);
|
||||
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
128
src/sfizz/gen/filters/sfzPink.cxx
Normal file
128
src/sfizz/gen/filters/sfzPink.cxx
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPink_H__
|
||||
#define __faustPink_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustPink : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
double fRec0[4];
|
||||
int fSampleRate;
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustPink* clone() {
|
||||
return new faustPink();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
||||
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||
fRec0[j0] = fRec0[(j0 - 1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue