Merge pull request #663 from jpcima/faust

Faust helpers with cmake
This commit is contained in:
JP Cimalando 2021-02-25 02:23:15 +01:00 committed by GitHub
commit 5e9ec9b299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 6257 additions and 6128 deletions

View file

@ -41,6 +41,7 @@ option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
include (SfizzConfig)
include (SfizzDeps)
include (SfizzFaust)
# Don't use IPO in non Release builds
include (CheckIPO)

72
cmake/SfizzFaust.cmake Normal file
View file

@ -0,0 +1,72 @@
include(CMakeParseArguments)
option(SFIZZ_RECOMPILE_FAUST "Recompile faust sources" OFF)
if(SFIZZ_RECOMPILE_FAUST)
find_program(RDMD "rdmd")
if(NOT RDMD)
message(FATAL_ERROR "rdmd is missing, it is required for regenerating faust sources.")
endif()
endif()
function(add_faust_command INPUT OUTPUT)
set(_options ONE_SAMPLE DOUBLE IN_PLACE VECTORIZE MATH_APPROXIMATION)
set(_one_args PROCESS_NAME CLASS_NAME SUPERCLASS_NAME)
set(_multi_args IMPORT_DIRS)
cmake_parse_arguments(_FAUST "${_options}" "${_one_args}" "${_multi_args}" ${ARGN})
if(NOT SFIZZ_RECOMPILE_FAUST)
return()
endif()
if(NOT RDMD)
return()
endif()
if(NOT INPUT)
message(FATAL_ERROR "No input file given.")
endif()
if(NOT OUTPUT)
message(FATAL_ERROR "No output file given.")
endif()
set(_cmd "${RDMD}" "${PROJECT_SOURCE_DIR}/scripts/faustwrap.d")
if(NOT IS_ABSOLUTE "${INPUT}")
set(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT}")
endif()
if(NOT IS_ABSOLUTE "${OUTPUT}")
set(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${OUTPUT}")
endif()
get_filename_component(_output_dir "${OUTPUT}" DIRECTORY)
file(MAKE_DIRECTORY "${_output_dir}")
list(APPEND _cmd "-o" "${OUTPUT}" "${INPUT}")
if(_FAUST_ONE_SAMPLE)
list(APPEND _cmd "--os")
endif()
if(_FAUST_DOUBLE)
list(APPEND _cmd "--double")
endif()
if(_FAUST_IN_PLACE)
list(APPEND _cmd "--inpl")
endif()
if(_FAUST_VECTORIZE)
list(APPEND _cmd "--vec")
endif()
if(_FAUST_MATH_APPROXIMATION)
list(APPEND _cmd "--mapp")
endif()
if(_FAUST_PROCESS_NAME)
list(APPEND _cmd "--pn" "${_FAUST_PROCESS_NAME}")
endif()
if(_FAUST_CLASS_NAME)
list(APPEND _cmd "--cn" "${_FAUST_CLASS_NAME}")
endif()
if(_FAUST_SUPERCLASS_NAME)
list(APPEND _cmd "--scn" "${_FAUST_SUPERCLASS_NAME}")
endif()
if (_FAUST_IMPORT_DIRS)
foreach(_dir IN LISTS _FAUST_IMPORT_DIRS)
if(NOT IS_ABSOLUTE "${_dir}")
set(_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}")
endif()
list(APPEND _cmd "--import-dir" "${_dir}")
endforeach()
endif()
add_custom_command(OUTPUT "${OUTPUT}" COMMAND ${_cmd} DEPENDS "${INPUT}")
endfunction()

393
scripts/faustwrap.d Executable file
View file

@ -0,0 +1,393 @@
#!/usr/bin/env rdmd
import std.conv;
import std.algorithm;
import std.getopt;
import std.process;
import std.regex;
import std.uni;
import std.ascii;
import std.string;
import std.array;
import std.stdio;
import core.stdc.stdlib;
enum string prologue = `#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
`;
enum string epilogue = `
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS
`;
void main(string[] args)
{
struct Opts {
string outputPath;
string className = "mydsp";
string superclassName = null;
bool oneSample = false;
bool doublePrecision = false;
bool inPlace = false;
bool vectorize = false;
bool mathApproximation = false;
string processName = null;
string[] importDirs;
}
Opts opts;
auto optInfo = getopt(args,
"out|o", "Output path", &opts.outputPath,
"cn", "Class name", &opts.className,
"scn", "Superclass name", &opts.superclassName,
"os", "One sample", &opts.oneSample,
"double", "Double precision", &opts.doublePrecision,
"inpl", "In-place", &opts.inPlace,
"vec", "Vectorization", &opts.vectorize,
"mapp", "Math approximation", &opts.mathApproximation,
"pn", "Process name", &opts.processName,
"import-dir|I", "Import directory", &opts.importDirs);
if (optInfo.helpWanted)
{
defaultGetoptPrinter("MyFaust", optInfo.options);
return;
}
if (args.length != 2)
{
writeln("You must indicate exactly 1 input file.");
exit(1);
}
string[] cmd = [getFaust()];
cmd ~= "-cn";
cmd ~= opts.className;
if (opts.superclassName)
{
cmd ~= "-scn";
cmd ~= opts.superclassName;
}
if (opts.oneSample)
cmd ~= "-os";
if (opts.doublePrecision)
cmd ~= "-double";
if (opts.inPlace)
cmd ~= "-inpl";
if (opts.vectorize)
cmd ~= "-vec";
if (opts.mathApproximation)
cmd ~= "-mapp";
if (opts.processName)
{
cmd ~= "-pn";
cmd ~= opts.processName;
}
foreach (string dir; opts.importDirs)
{
cmd ~= "-I";
cmd ~= dir;
}
cmd ~= args[1];
auto result = execute(cmd, null, Config.stderrPassThrough|Config.suppressConsole);
if (result.status != 0)
exit(1);
string code = result.output;
Parameter[] params = findParameters(code);
code = removeVirtualKeyword(code);
foreach (string method; ["metadata", "getInputRate", "getOutputRate", "clone", "buildUserInterface"])
code = removeMethod(code, method);
foreach (string method; ["getNumInputs", "getNumOutputs"])
code = makeMethodStaticConstexpr(code, method);
if (!opts.superclassName)
code = removeSuperclass(code);
code = makePointerArgsConst(code, opts.oneSample);
code = addParameters(code, params);
foreach (string method; ["compute", "classInit", "instanceConstants", "instanceResetUserInterface", "instanceClear", "init", "instanceInit"])
code = addMethodStartEnd(code, method);
code = addClassStartEnd(code);
File outFile = stdout;
if (opts.outputPath)
outFile = File(opts.outputPath, "w");
outFile.writef("%s%s%s", prologue, code, epilogue);
outFile.flush();
}
final class Parameter
{
string name;
string var;
bool readonly;
};
Parameter[] findParameters(string code)
{
Parameter[] params;
auto expr = regex(`->add(Button|CheckButton|VerticalSlider|HorizontalSlider|NumEntry|HorizontalBargraph|VerticalBargraph)\("([^"]*)", &([a-zA-Z0-9_]+)`);
foreach (string line; code.lineSplitter)
{
auto match = line.matchFirst(expr);
if (match)
{
Parameter param = new Parameter;
param.name = match[2];
param.var = match[3];
param.readonly = ["HorizontalBargraph", "VerticalBargraph"].canFind(match[1]);
params ~= param;
}
}
return params;
}
string removeVirtualKeyword(string code)
{
auto expr = regex(`\bvirtual\s*\b`);
return code.replaceAll(expr, "");
}
string removeMethod(string code, string method)
{
string[] newLines;
newLines.reserve(1024);
auto expr = regex(`^(\s*).*\b` ~ method.escaper.to!string ~ `\s*\(.*\{\s*$`);
bool inMethod = false;
string eom = null;
foreach (string line; code.lineSplitter)
{
if (inMethod)
{
if (line.stripRight == eom)
inMethod = false;
}
else
{
auto match = line.matchFirst(expr);
if (match)
{
inMethod = true;
eom = match[1] ~ '}';
}
else
newLines ~= line;
}
}
return newLines.join('\n');
}
string makeMethodStaticConstexpr(string code, string method)
{
string[] newLines;
newLines.reserve(1024);
auto expr = regex(`^(\s*)(.*\b` ~ method.escaper.to!string ~ `\s*\(.*\{\s*)$`);
foreach (string line; code.lineSplitter)
{
auto match = line.matchFirst(expr);
if (match)
newLines ~= match[1] ~ "static constexpr " ~ match[2];
else
newLines ~= line;
}
return newLines.join('\n');
}
string removeSuperclass(string code)
{
auto expr = regex(`\s*:\s*public\s+dsp\s*`);
return code.replaceFirst(expr, " ");
}
string makePointerArgsConst(string code, bool oneSample)
{
if (!oneSample)
{
auto expr = regex(`\bvoid\s+compute\s*\(\s*([^,)]+)\s*,\s*([^,)]+)\s*,\s*([^,)]+)\s*\)`);
auto match = code.matchFirst(expr);
string arg1 = match[1];
string arg2 = match[2];
string arg3 = match[3];
auto exprArg = regex(`^FAUSTFLOAT\s*\*\s*\*`);
arg2 = arg2.replaceFirst(exprArg, "FAUSTFLOAT const* const*");
arg3 = arg3.replaceFirst(exprArg, "FAUSTFLOAT* const*");
ulong start = match[0].ptr - code.ptr;
ulong end = start + match[0].length;
code = format("%svoid compute(%s, %s, %s)%s", code[0..start], arg1, arg2, arg3, code[end..$]);
//
auto exprStmt = regex(`FAUSTFLOAT\s*\*\s*(input\d+)`);
code = code.replaceAll(exprStmt, "FAUSTFLOAT const* $1");
}
else
{
auto expr = regex(`\bvoid\s+compute\s*\(\s*([^,)]+)\s*,\s*([^,)]+)\s*,\s*([^,)]+)\s*,\s*([^,)]+)\s*\)`);
auto match = code.matchFirst(expr);
string arg1 = match[1];
string arg2 = match[2];
string arg3 = match[3];
string arg4 = match[4];
auto exprArg = regex(`^(FAUSTFLOAT|int)\s*\*`);
arg1 = arg1.replaceFirst(exprArg, "$1 const*");
arg3 = arg3.replaceFirst(exprArg, "$1 const*");
arg4 = arg4.replaceFirst(exprArg, "$1 const*");
ulong start = match[0].ptr - code.ptr;
ulong end = start + match[0].length;
code = format("%svoid compute(%s, %s, %s, %s)%s", code[0..start], arg1, arg2, arg3, arg4, code[end..$]);
}
return code;
}
string addParameters(string code, Parameter[] params)
{
string[] addedLines;
foreach (Parameter param; params)
{
string camelName = param.name.camelify;
addedLines ~= "";
addedLines ~= format(` FAUSTFLOAT get%s() const { return %s; }`, camelName, param.var);
if (!param.readonly)
addedLines ~= format(` void set%s(FAUSTFLOAT value) { %s = value; }`, camelName, param.var);
}
return addToClass(code, addedLines.join('\n'));
}
string addMethodStartEnd(string code, string method)
{
string[] newLines;
newLines.reserve(1024);
auto expr = regex(`^(\s*).*\b` ~ method.escaper.to!string ~ `\s*\(.*\{\s*$`);
bool inMethod = false;
string eom = null;
foreach (string line; code.lineSplitter)
{
if (inMethod)
{
if (line.stripRight == eom)
{
newLines ~= "\t\t//[End:" ~ method ~ "]";
inMethod = false;
}
newLines ~= line;
}
else
{
newLines ~= line;
auto match = line.matchFirst(expr);
if (match)
{
inMethod = true;
eom = match[1] ~ '}';
newLines ~= "\t\t//[Begin:" ~ method ~ "]";
}
}
}
return newLines.join('\n');
}
string addClassStartEnd(string code)
{
{
auto expr = regex(`^class\b.*$`, "m");
auto match = code.matchFirst(expr);
ulong start = match[0].ptr - code.ptr;
ulong end = start + match[0].length;
code = code[0..start] ~ "\n//[Before:class]\n" ~ match[0] ~ "\n\t//[Begin:class]\n" ~ code[end..$];
}
{
auto expr = regex(`^\};`, "m");
auto match = code.matchLast(expr);
ulong start = match[0].ptr - code.ptr;
ulong end = start + match[0].length;
code = code[0..start] ~ "\n\t//[End:class]\n" ~ match[0] ~ "\n//[After:class]\n" ~ code[end..$];
}
return code;
}
string addToClass(string code, string addend)
{
if (addend.empty)
return code;
auto expr = regex(`^\};`, "m");
auto match = code.matchLast(expr);
ulong index = match[0].ptr - code.ptr;
return code[0..index] ~ addend ~ '\n' ~ code[index..$];
}
string camelify(string name)
{
dchar[] result;
result.reserve(name.length);
bool isIdentifierChar(dchar ch)
{
return std.ascii.isAlphaNum(ch) || ch == '_';
}
dchar[] temp = name.to!(dchar[]);
foreach (ref dchar uniChar; temp)
{
uniChar = [uniChar].normalize!NFD[0];
if (!isIdentifierChar(uniChar))
uniChar = ' ';
}
foreach (dchar[] part; temp.split(' '))
{
if (!part.empty)
part[0] = std.uni.toUpper(part[0]);
result ~= part;
}
return result.to!string;
}
Captures!S matchLast(S, R)(S input, R expr)
{
Captures!S last;
foreach (Captures!S current; input.matchAll(expr))
last = current;
return last;
}
string getFaust()
{
char *env = getenv("FAUST");
return env ? env.to!string : "faust";
}

View file

@ -1,54 +0,0 @@
#!/bin/sh
set -e
if ! test -d "src"; then
echo "Please run this in the project root directory."
exit 1
fi
# Note: needs faust >= 2.27.1 for UI macros
FAUSTARGS="-uim -inpl"
# support GNU sed only, use gsed on a Mac
test -z "$SED" && SED=sed
faustgen() {
mkdir -p src/sfizz/effects/gen
local outfile=src/sfizz/effects/gen/compressor.cxx
local code=`faust $FAUSTARGS -cn faustCompressor src/sfizz/effects/dsp/compressor.dsp`
# 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"
# remove metadata
$SED -r -i 's/void[ \t]+metadata[ \t]*\(Meta[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void metadata()/' "$outfile"
# remove UI
$SED -r -i 's/void[ \t]+buildUserInterface[ \t]*\(UI[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void buildUserInterface()/' "$outfile"
# remove inheritance
$SED -r -i 's/:[ \t]*public[ \t]+dsp\b\s*//' "$outfile"
# remove virtual
$SED -r -i 's/\bvirtual\b\s*//' "$outfile"
# remove undesired UIM
$SED -r -i '/^[ \t]*#define[ \t]+FAUST_(FILE_NAME|CLASS_NAME|INPUTS|OUTPUTS|ACTIVES|PASSIVES)/d' "$outfile"
$SED -r -i '/^[ \t]*FAUST_ADD.*/d' "$outfile"
# direct access to parameter variables
$SED -r -i 's/\bprivate:/public:/' "$outfile"
# remove trailing whitespace
$SED -r -i 's/[ \t]+$//' "$outfile"
}
faustgen

View file

@ -1,54 +0,0 @@
#!/bin/sh
set -e
if ! test -d "src"; then
echo "Please run this in the project root directory."
exit 1
fi
# Note: needs faust >= 2.27.1 for UI macros
FAUSTARGS="-uim -inpl"
# support GNU sed only, use gsed on a Mac
test -z "$SED" && SED=sed
faustgen() {
mkdir -p src/sfizz/effects/gen
local outfile=src/sfizz/effects/gen/disto_stage.cxx
local code=`faust $FAUSTARGS -cn faustDisto src/sfizz/effects/dsp/disto_stage.dsp`
# 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"
# remove metadata
$SED -r -i 's/void[ \t]+metadata[ \t]*\(Meta[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void metadata()/' "$outfile"
# remove UI
$SED -r -i 's/void[ \t]+buildUserInterface[ \t]*\(UI[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void buildUserInterface()/' "$outfile"
# remove inheritance
$SED -r -i 's/:[ \t]*public[ \t]+dsp\b\s*//' "$outfile"
# remove virtual
$SED -r -i 's/\bvirtual\b\s*//' "$outfile"
# remove undesired UIM
$SED -r -i '/^[ \t]*#define[ \t]+FAUST_(FILE_NAME|CLASS_NAME|INPUTS|OUTPUTS|ACTIVES|PASSIVES)/d' "$outfile"
$SED -r -i '/^[ \t]*FAUST_ADD.*/d' "$outfile"
# direct access to parameter variables
$SED -r -i 's/\bprivate:/public:/' "$outfile"
# remove trailing whitespace
$SED -r -i 's/[ \t]+$//' "$outfile"
}
faustgen

View file

@ -1,70 +0,0 @@
#!/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" -scn sfzFilterDsp 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'`
local bwVar=`echo "$code" | $SED -r 's%.*\("Bandwidth", &[ \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"
# 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
if test ! -z "$bwVar"; then
$SED -r -i 's/\b'"$bwVar"'\b/fBandwidth/' "$outfile"
fi
# remove trailing whitespace
$SED -r -i 's/[ \t]+$//' "$outfile"
}
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 \
EqPeak EqLshelf EqHshelf
do
faustgen "$f"
faustgen "2ch$f"
done

View file

@ -1,54 +0,0 @@
#!/bin/sh
set -e
if ! test -d "src"; then
echo "Please run this in the project root directory."
exit 1
fi
# Note: needs faust >= 2.27.1 for UI macros
FAUSTARGS="-uim -inpl"
# support GNU sed only, use gsed on a Mac
test -z "$SED" && SED=sed
faustgen() {
mkdir -p src/sfizz/effects/gen
local outfile=src/sfizz/effects/gen/fverb.cxx
local code=`faust $FAUSTARGS -cn faustFverb src/sfizz/effects/dsp/fverb.dsp`
# 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"
# remove metadata
$SED -r -i 's/void[ \t]+metadata[ \t]*\(Meta[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void metadata()/' "$outfile"
# remove UI
$SED -r -i 's/void[ \t]+buildUserInterface[ \t]*\(UI[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void buildUserInterface()/' "$outfile"
# remove inheritance
$SED -r -i 's/:[ \t]*public[ \t]+dsp\b\s*//' "$outfile"
# remove virtual
$SED -r -i 's/\bvirtual\b\s*//' "$outfile"
# remove undesired UIM
$SED -r -i '/^[ \t]*#define[ \t]+FAUST_(FILE_NAME|CLASS_NAME|INPUTS|OUTPUTS|ACTIVES|PASSIVES)/d' "$outfile"
$SED -r -i '/^[ \t]*FAUST_ADD.*/d' "$outfile"
# direct access to parameter variables
$SED -r -i 's/\bprivate:/public:/' "$outfile"
# remove trailing whitespace
$SED -r -i 's/[ \t]+$//' "$outfile"
}
faustgen

View file

@ -1,54 +0,0 @@
#!/bin/sh
set -e
if ! test -d "src"; then
echo "Please run this in the project root directory."
exit 1
fi
# Note: needs faust >= 2.27.1 for UI macros
FAUSTARGS="-uim -inpl"
# support GNU sed only, use gsed on a Mac
test -z "$SED" && SED=sed
faustgen() {
mkdir -p src/sfizz/effects/gen
local outfile=src/sfizz/effects/gen/gate.cxx
local code=`faust $FAUSTARGS -cn faustGate src/sfizz/effects/dsp/gate.dsp`
# 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"
# remove metadata
$SED -r -i 's/void[ \t]+metadata[ \t]*\(Meta[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void metadata()/' "$outfile"
# remove UI
$SED -r -i 's/void[ \t]+buildUserInterface[ \t]*\(UI[ \t]*\*[ \t]*[a-zA-Z0-9_]+\)/void buildUserInterface()/' "$outfile"
# remove inheritance
$SED -r -i 's/:[ \t]*public[ \t]+dsp\b\s*//' "$outfile"
# remove virtual
$SED -r -i 's/\bvirtual\b\s*//' "$outfile"
# remove undesired UIM
$SED -r -i '/^[ \t]*#define[ \t]+FAUST_(FILE_NAME|CLASS_NAME|INPUTS|OUTPUTS|ACTIVES|PASSIVES)/d' "$outfile"
$SED -r -i '/^[ \t]*FAUST_ADD.*/d' "$outfile"
# direct access to parameter variables
$SED -r -i 's/\bprivate:/public:/' "$outfile"
# remove trailing whitespace
$SED -r -i 's/[ \t]+$//' "$outfile"
}
faustgen

View file

@ -310,6 +310,74 @@ endif()
# Generic library alias
add_library(sfizz::sfizz ALIAS sfizz_static)
# Preserve generated files (Faust)
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM TRUE)
# Faust filters
foreach(filter_type
Lpf1p Lpf2p Lpf4p Lpf6p Hpf1p Hpf2p Hpf4p Hpf6p
Bpf1p Bpf2p Bpf4p Bpf6p Apf1p Brf1p Brf2p
Pink Lpf2pSv Hpf2pSv Bpf2pSv Brf2pSv
Lsh Hsh Peq EqPeak EqLshelf EqHshelf)
add_faust_command(
"sfizz/dsp/filters/sfz_filters.dsp"
"sfizz/gen/filters/sfz${filter_type}.hxx"
DOUBLE IN_PLACE
PROCESS_NAME "sfz${filter_type}"
CLASS_NAME "faust${filter_type}"
SUPERCLASS_NAME "sfzFilterDsp"
IMPORT_DIRS "sfizz/dsp")
add_faust_command(
"sfizz/dsp/filters/sfz_filters.dsp"
"sfizz/gen/filters/sfz2ch${filter_type}.hxx"
DOUBLE IN_PLACE
PROCESS_NAME "sfz2ch${filter_type}"
CLASS_NAME "faust2ch${filter_type}"
SUPERCLASS_NAME "sfzFilterDsp"
IMPORT_DIRS "sfizz/dsp")
target_sources(sfizz_internal PRIVATE
"sfizz/gen/filters/sfz${filter_type}.hxx"
"sfizz/gen/filters/sfz2ch${filter_type}.hxx")
endforeach()
# Faust effects
add_faust_command(
"sfizz/effects/dsp/compressor.dsp"
"sfizz/effects/gen/compressor.hxx"
IN_PLACE
CLASS_NAME "faustCompressor"
IMPORT_DIRS "sfizz/dsp")
add_faust_command(
"sfizz/effects/dsp/disto_stage.dsp"
"sfizz/effects/gen/disto_stage.hxx"
IN_PLACE
CLASS_NAME "faustDisto"
IMPORT_DIRS "sfizz/dsp")
add_faust_command(
"sfizz/effects/dsp/fverb.dsp"
"sfizz/effects/gen/fverb.hxx"
IN_PLACE
CLASS_NAME "faustFverb"
IMPORT_DIRS "sfizz/dsp")
add_faust_command(
"sfizz/effects/dsp/gate.dsp"
"sfizz/effects/gen/gate.hxx"
IN_PLACE
CLASS_NAME "faustGate"
IMPORT_DIRS "sfizz/dsp")
add_faust_command(
"sfizz/effects/dsp/limiter.dsp"
"sfizz/effects/gen/limiter.hxx"
IN_PLACE
CLASS_NAME "faustLimiter"
IMPORT_DIRS "sfizz/dsp")
target_sources(sfizz_internal PRIVATE
"sfizz/effects/gen/compressor.hxx"
"sfizz/effects/gen/disto_stage.hxx"
"sfizz/effects/gen/fverb.hxx"
"sfizz/effects/gen/gate.hxx"
"sfizz/effects/gen/limiter.hxx")
# Windows installer
if(WIN32)
include(VSTConfig)

View file

@ -131,6 +131,7 @@ extern const OpcodeSpec<int> sampleQuality { 1, Range<int>(1, 10), 0 };
extern const OpcodeSpec<int> octaveOffset { 0, Range<int>(-10, 10), 0 };
extern const OpcodeSpec<int> noteOffset { 0, Range<int>(-127, 127), 0 };
extern const OpcodeSpec<float> effect { 0.0f, Range<float>(0.0f, 100.0f), kNormalizePercent };
extern const OpcodeSpec<float> effectPercent { 0.0f, Range<float>(0.0f, 100.0f), 0 };
extern const OpcodeSpec<int> apanWaveform { 0, Range<int>(0, std::numeric_limits<int>::max()), 0 };
extern const OpcodeSpec<float> apanFrequency { 0.0f, Range<float>(0.0f, std::numeric_limits<float>::max()), 0 };
extern const OpcodeSpec<float> apanPhase { 0.5f, Range<float>(0.0f, 1.0f), kWrapPhase };

View file

@ -250,6 +250,7 @@ namespace Default
extern const OpcodeSpec<int> octaveOffset;
extern const OpcodeSpec<int> noteOffset;
extern const OpcodeSpec<float> effect;
extern const OpcodeSpec<float> effectPercent;
extern const OpcodeSpec<int> apanWaveform;
extern const OpcodeSpec<float> apanFrequency;
extern const OpcodeSpec<float> apanPhase;

View file

@ -16,7 +16,7 @@ public:
virtual void init(int) = 0;
virtual void instanceClear() = 0;
virtual void compute(int, float **, float **) = 0;
virtual void compute(int, const float *const *, float *const *) = 0;
virtual void configureStandard(float, float, float) {}
virtual void configureEq(float, float, float) {}
@ -40,59 +40,59 @@ protected:
#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/sfzEqPeak.cxx"
#include "gen/filters/sfzEqLshelf.cxx"
#include "gen/filters/sfzEqHshelf.cxx"
#include "gen/filters/sfzApf1p.hxx"
#include "gen/filters/sfzBpf1p.hxx"
#include "gen/filters/sfzBpf2p.hxx"
#include "gen/filters/sfzBpf4p.hxx"
#include "gen/filters/sfzBpf6p.hxx"
#include "gen/filters/sfzBrf1p.hxx"
#include "gen/filters/sfzBrf2p.hxx"
#include "gen/filters/sfzHpf1p.hxx"
#include "gen/filters/sfzHpf2p.hxx"
#include "gen/filters/sfzHpf4p.hxx"
#include "gen/filters/sfzHpf6p.hxx"
#include "gen/filters/sfzLpf1p.hxx"
#include "gen/filters/sfzLpf2p.hxx"
#include "gen/filters/sfzLpf4p.hxx"
#include "gen/filters/sfzLpf6p.hxx"
#include "gen/filters/sfzPink.hxx"
#include "gen/filters/sfzLpf2pSv.hxx"
#include "gen/filters/sfzHpf2pSv.hxx"
#include "gen/filters/sfzBpf2pSv.hxx"
#include "gen/filters/sfzBrf2pSv.hxx"
#include "gen/filters/sfzLsh.hxx"
#include "gen/filters/sfzHsh.hxx"
#include "gen/filters/sfzPeq.hxx"
#include "gen/filters/sfzEqPeak.hxx"
#include "gen/filters/sfzEqLshelf.hxx"
#include "gen/filters/sfzEqHshelf.hxx"
#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"
#include "gen/filters/sfz2chEqPeak.cxx"
#include "gen/filters/sfz2chEqLshelf.cxx"
#include "gen/filters/sfz2chEqHshelf.cxx"
#include "gen/filters/sfz2chApf1p.hxx"
#include "gen/filters/sfz2chBpf1p.hxx"
#include "gen/filters/sfz2chBpf2p.hxx"
#include "gen/filters/sfz2chBpf4p.hxx"
#include "gen/filters/sfz2chBpf6p.hxx"
#include "gen/filters/sfz2chBrf1p.hxx"
#include "gen/filters/sfz2chBrf2p.hxx"
#include "gen/filters/sfz2chHpf1p.hxx"
#include "gen/filters/sfz2chHpf2p.hxx"
#include "gen/filters/sfz2chHpf4p.hxx"
#include "gen/filters/sfz2chHpf6p.hxx"
#include "gen/filters/sfz2chLpf1p.hxx"
#include "gen/filters/sfz2chLpf2p.hxx"
#include "gen/filters/sfz2chLpf4p.hxx"
#include "gen/filters/sfz2chLpf6p.hxx"
#include "gen/filters/sfz2chPink.hxx"
#include "gen/filters/sfz2chLpf2pSv.hxx"
#include "gen/filters/sfz2chHpf2pSv.hxx"
#include "gen/filters/sfz2chBpf2pSv.hxx"
#include "gen/filters/sfz2chBrf2pSv.hxx"
#include "gen/filters/sfz2chLsh.hxx"
#include "gen/filters/sfz2chHsh.hxx"
#include "gen/filters/sfz2chPeq.hxx"
#include "gen/filters/sfz2chEqPeak.hxx"
#include "gen/filters/sfz2chEqLshelf.hxx"
#include "gen/filters/sfz2chEqHshelf.hxx"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
@ -105,8 +105,8 @@ protected:
template <class F> struct sfzFilter : public F {
void configureStandard(float cutoff, float q, float pksh) override
{
F::fCutoff = cutoff;
F::fQ = q;
this->setCutoff(cutoff);
this->setResonance(q);
(void)pksh;
}
};
@ -118,7 +118,7 @@ template <class F> struct sfzFilter : public F {
template <class F> struct sfzFilterNoQ : public F {
void configureStandard(float cutoff, float q, float pksh) override
{
F::fCutoff = cutoff;
this->setCutoff(cutoff);
(void)q;
(void)pksh;
}
@ -144,9 +144,9 @@ template <class F> struct sfzFilterNoCutoff : public F {
template <class F> struct sfzFilterPkSh : public F {
void configureStandard(float cutoff, float q, float pksh) override
{
F::fCutoff = cutoff;
F::fQ = q;
F::fPkShGain = pksh;
this->setCutoff(cutoff);
this->setResonance(q);
this->setPeakShelfGain(pksh);
}
};
@ -157,9 +157,9 @@ template <class F> struct sfzFilterPkSh : public F {
template <class F> struct sfzFilterEq : public F {
void configureEq(float cutoff, float bw, float pksh) override
{
F::fCutoff = cutoff;
F::fBandwidth = bw;
F::fPkShGain = pksh;
this->setCutoff(cutoff);
this->setBandwidth(bw);
this->setPeakShelfGain(pksh);
}
};

View file

@ -0,0 +1,18 @@
//-----------------------------------------------------------------------------
// A version of platform.lib which does not limit the sample rate.
// This allows use of high oversampling factors.
//-----------------------------------------------------------------------------
declare name "sfizz Generic Platform Library";
declare license "BSD-2-Clause";
//---------------------------------`(pl.)SR`-----------------------------------
// Current sampling rate (between 1Hz and 192000Hz). Constant during
// program execution.
//-----------------------------------------------------------------------------
SR = fconstant(int fSamplingFreq, <math.h>);
//---------------------------------`(pl.)tablesize`----------------------------
// Oscillator table size
//-----------------------------------------------------------------------------
tablesize = 1 << 16;

View file

@ -17,6 +17,7 @@
*/
#include "Compressor.h"
#include "gen/compressor.hxx"
#include "Opcode.h"
#include "AudioSpan.h"
#include "MathHelpers.h"
@ -24,8 +25,6 @@
#include "absl/memory/memory.h"
static constexpr int _oversampling = 2;
#define FAUST_UIMACROS 1
#include "gen/compressor.cxx"
namespace sfz {
namespace fx {
@ -38,12 +37,6 @@ namespace fx {
AudioBuffer<float, 2> _gain2x { 2, _oversampling * config::defaultSamplesPerBlock };
hiir::Downsampler2x<12> _downsampler2x[EffectChannels];
hiir::Upsampler2x<12> _upsampler2x[EffectChannels];
#define DEFINE_SET_GET(type, ident, name, var, def, min, max, step) \
float get_##ident(size_t i) const noexcept { return _compressor[i].var; } \
void set_##ident(size_t i, float value) noexcept { _compressor[i].var = value; }
FAUST_LIST_ACTIVES(DEFINE_SET_GET);
#undef DEFINE_SET_GET
};
Compressor::Compressor()
@ -62,8 +55,8 @@ namespace fx {
{
Impl& impl = *_impl;
for (faustCompressor& comp : impl._compressor) {
comp.classInit(sampleRate);
comp.instanceConstants(sampleRate);
comp.classInit(_oversampling * sampleRate);
comp.instanceConstants(_oversampling * sampleRate);
}
for (unsigned c = 0; c < EffectChannels; ++c) {
@ -164,29 +157,29 @@ namespace fx {
case hash("comp_attack"):
{
auto value = opc.read(Default::compAttack);
for (size_t c = 0; c < 2; ++c)
impl.set_Attack(c, value);
for (faustCompressor& comp : impl._compressor)
comp.setAttack(value);
}
break;
case hash("comp_release"):
{
auto value = opc.read(Default::compRelease);
for (size_t c = 0; c < 2; ++c)
impl.set_Release(c, value);
for (faustCompressor& comp : impl._compressor)
comp.setRelease(value);
}
break;
case hash("comp_threshold"):
{
auto value = opc.read(Default::compThreshold);
for (size_t c = 0; c < 2; ++c)
impl.set_Threshold(c, value);
for (faustCompressor& comp : impl._compressor)
comp.setThreshold(value);
}
break;
case hash("comp_ratio"):
{
auto value = opc.read(Default::compRatio);
for (size_t c = 0; c < 2; ++c)
impl.set_Ratio(c, value);
for (faustCompressor& comp : impl._compressor)
comp.setRatio(value);
}
break;
case hash("comp_gain"):

View file

@ -19,6 +19,7 @@
*/
#include "Disto.h"
#include "gen/disto_stage.hxx"
#include "Opcode.h"
#include "Config.h"
#include "MathHelpers.h"
@ -27,8 +28,6 @@
#include <cmath>
static constexpr int _oversampling = 8;
#define FAUST_UIMACROS 1
#include "gen/disto_stage.cxx"
namespace sfz {
namespace fx {
@ -56,12 +55,6 @@ struct Disto::Impl {
float mk = 21.0f + _tone * 1.08f;
return 440.0f * std::exp2((mk - 69.0f) * (1.0f / 12.0f));
}
#define DEFINE_SET_GET(type, ident, name, var, def, min, max, step) \
float get_##ident(size_t c, size_t s) const noexcept { return _stages[c][s].var; } \
void set_##ident(size_t c, size_t s, float value) noexcept { _stages[c][s].var = value; }
FAUST_LIST_ACTIVES(DEFINE_SET_GET);
#undef DEFINE_SET_GET
};
Disto::Disto()
@ -71,7 +64,7 @@ Disto::Disto()
for (unsigned c = 0; c < EffectChannels; ++c) {
for (faustDisto& stage : impl._stages[c])
stage.init(config::defaultSampleRate);
stage.init(_oversampling * config::defaultSampleRate);
}
}
@ -86,10 +79,12 @@ void Disto::setSampleRate(double sampleRate)
for (unsigned c = 0; c < EffectChannels; ++c) {
for (faustDisto& stage : impl._stages[c]) {
stage.classInit(sampleRate);
stage.instanceConstants(sampleRate);
stage.classInit(_oversampling * sampleRate);
stage.instanceConstants(_oversampling * sampleRate);
}
}
clear();
}
void Disto::setSamplesPerBlock(int samplesPerBlock)
@ -150,7 +145,7 @@ void Disto::process(const float* const inputs[], float* const outputs[], unsigne
absl::Span<float> stageInOut = upsamplerOut;
for (unsigned s = 0, numStages = impl._numStages; s < numStages; ++s) {
// set depth parameter (TODO modulation)
impl.set_Depth(c, s, depth);
impl._stages[c][s].setDepth(depth);
//
float *faustIn[] = { stageInOut.data() };
float *faustOut[] = { stageInOut.data() };

View file

@ -5,14 +5,13 @@
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#include "Fverb.h"
#include "gen/fverb.hxx"
#include "Opcode.h"
#include "Config.h"
#include "MathHelpers.h"
#include <absl/memory/memory.h>
#include <absl/strings/ascii.h>
#include <cmath>
#define FAUST_UIMACROS 1
#include "gen/fverb.cxx"
/**
Note(jpc): implementation status
@ -40,12 +39,6 @@ namespace fx {
struct Fverb::Impl {
faustFverb dsp;
#define DEFINE_SET_GET(type, ident, name, var, def, min, max, step) \
float get_##ident() const noexcept { return dsp.var; } \
void set_##ident(float value) noexcept { dsp.var = value; }
FAUST_LIST_ACTIVES(DEFINE_SET_GET);
#undef DEFINE_SET_GET
struct Profile {
float tailDensity; // %
float decayAtMaxSize; // %
@ -180,9 +173,9 @@ namespace fx {
std::unique_ptr<Effect> fx { reverb };
const Impl::Profile* profile = &Impl::largeHall;
float dry { Default::effect };
float wet { Default::effect };
float input { Default::effect };
float dry { Default::effectPercent };
float wet { Default::effectPercent };
float input { Default::effectPercent };
float size { Default::fverbSize };
float predelay { Default::fverbPredelay };
float tone { Default::fverbTone };
@ -212,13 +205,13 @@ namespace fx {
break;
case hash("reverb_dry"):
dry = opc.read(Default::effect);
dry = opc.read(Default::effectPercent);
break;
case hash("reverb_wet"):
wet = opc.read(Default::effect);
wet = opc.read(Default::effectPercent);
break;
case hash("reverb_input"):
input = opc.read(Default::effect);
input = opc.read(Default::effectPercent);
break;
case hash("reverb_size"):
size = opc.read(Default::fverbSize);
@ -240,17 +233,18 @@ namespace fx {
const float decayMin = decayMax * 0.5f;
Impl& impl = *reverb->impl_;
impl.set_Predelay(predelay * 1e3);
impl.set_Tail_density(profile->tailDensity);
impl.set_Decay(decayMax * size * 0.01f + decayMin * (1.0f - size * 0.01f));
impl.set_Modulator_frequency(profile->modulationFrequency);
impl.set_Modulator_depth(profile->modulationDepth);
impl.set_Dry(profile->dry * dry * 0.01f);
impl.set_Wet(profile->wet * wet * 0.01f);
impl.set_Input_amount(input);
impl.set_Input_low_pass_cutoff(Impl::lpfCutoff(tone));
faustFverb& dsp = impl.dsp;
dsp.setPredelay(predelay * 1e3);
dsp.setTailDensity(profile->tailDensity);
dsp.setDecay(decayMax * size * 0.01f + decayMin * (1.0f - size * 0.01f));
dsp.setModulatorFrequency(profile->modulationFrequency);
dsp.setModulatorDepth(profile->modulationDepth);
dsp.setDry(profile->dry * dry * 0.01f);
dsp.setWet(profile->wet * wet * 0.01f);
dsp.setInputAmount(input);
dsp.setInputLowPassCutoff(Impl::lpfCutoff(tone));
// NOTE(jpc): damp formula not well calibrated, but sounds ok-ish
impl.set_Damping(Impl::lpfCutoff(100 - 0.5 * damp));
dsp.setDamping(Impl::lpfCutoff(100 - 0.5 * damp));
return fx;
}

View file

@ -20,6 +20,7 @@
*/
#include "Gate.h"
#include "gen/gate.hxx"
#include "Opcode.h"
#include "AudioSpan.h"
#include "MathHelpers.h"
@ -27,8 +28,6 @@
#include "absl/memory/memory.h"
static constexpr int _oversampling = 2;
#define FAUST_UIMACROS 1
#include "gen/gate.cxx"
namespace sfz {
namespace fx {
@ -41,12 +40,6 @@ namespace fx {
AudioBuffer<float, 2> _gain2x { 2, _oversampling * config::defaultSamplesPerBlock };
hiir::Downsampler2x<12> _downsampler2x[EffectChannels];
hiir::Upsampler2x<12> _upsampler2x[EffectChannels];
#define DEFINE_SET_GET(type, ident, name, var, def, min, max, step) \
float get_##ident(size_t i) const noexcept { return _gate[i].var; } \
void set_##ident(size_t i, float value) noexcept { _gate[i].var = value; }
FAUST_LIST_ACTIVES(DEFINE_SET_GET);
#undef DEFINE_SET_GET
};
Gate::Gate()
@ -65,8 +58,8 @@ namespace fx {
{
Impl& impl = *_impl;
for (faustGate& gate : impl._gate) {
gate.classInit(sampleRate);
gate.instanceConstants(sampleRate);
gate.classInit(_oversampling * sampleRate);
gate.instanceConstants(_oversampling * sampleRate);
}
for (unsigned c = 0; c < EffectChannels; ++c) {
@ -167,29 +160,29 @@ namespace fx {
case hash("gate_attack"):
{
auto value = opc.read(Default::gateAttack);
for (size_t c = 0; c < 2; ++c)
impl.set_Attack(c, value);
for (faustGate& gate : impl._gate)
gate.setAttack(value);
}
break;
case hash("gate_hold"):
{
auto value = opc.read(Default::gateHold);
for (size_t c = 0; c < 2; ++c)
impl.set_Hold(c, value);
for (faustGate& gate : impl._gate)
gate.setHold(value);
}
break;
case hash("gate_release"):
{
auto value = opc.read(Default::gateRelease);
for (size_t c = 0; c < 2; ++c)
impl.set_Release(c, value);
for (faustGate& gate : impl._gate)
gate.setRelease(value);
}
break;
case hash("gate_threshold"):
{
auto value = opc.read(Default::gateThreshold);
for (size_t c = 0; c < 2; ++c)
impl.set_Threshold(c, value);
for (faustGate& gate : impl._gate)
gate.setThreshold(value);
}
break;
case hash("gate_stlink"):

View file

@ -11,12 +11,12 @@
*/
#include "Limiter.h"
#include "gen/limiter.hxx"
#include "Opcode.h"
#include "AudioSpan.h"
#include "absl/memory/memory.h"
static constexpr int _oversampling = 2;
#include "gen/limiter.cpp"
namespace sfz {
namespace fx {
@ -33,8 +33,8 @@ namespace fx {
void Limiter::setSampleRate(double sampleRate)
{
_limiter->classInit(sampleRate);
_limiter->instanceConstants(sampleRate);
_limiter->classInit(_oversampling * sampleRate);
_limiter->instanceConstants(_oversampling * sampleRate);
for (unsigned c = 0; c < EffectChannels; ++c) {
_downsampler2x[c].set_coefs(OSCoeffs2x);

View file

@ -116,7 +116,7 @@ namespace fx {
auto outputR = absl::MakeSpan(outputs[1], nframes);
absl::Span<float> wet = _tempBuffer.getSpan(2).first(nframes);
sfz::fill(wet, 0.01f *_wet); // TOD strings_wet_oncc modulation...
sfz::fill(wet, _wet); // TOD strings_wet_oncc modulation...
sfz::copy(inputL, outputL);
sfz::copy(inputR, outputR);

View file

@ -3,9 +3,8 @@ import("stdfaust.lib");
cgain = co.compression_gain_mono(ratio, thresh, att, rel) with {
ratio = hslider("[1] Ratio", 1.0, 1.0, 20.0, 0.01);
thresh = hslider("[2] Threshold [unit:dB]", 0.0, -60.0, 0.0, 0.01);
over = fconstant(int _oversampling, <math.h>);
att = hslider("[3] Attack [unit:s]", 0.0, 0.0, 0.5, 1e-3) : *(over);
rel = hslider("[4] Release [unit:s]", 0.0, 0.0, 5.0, 1e-3) : *(over);
att = hslider("[3] Attack [unit:s]", 0.0, 0.0, 0.5, 1e-3);
rel = hslider("[4] Release [unit:s]", 0.0, 0.0, 5.0, 1e-3);
};
process = cgain;

View file

@ -1,14 +1,12 @@
import("stdfaust.lib");
disto_stage(depth, x) = shs*hh(x)+(1.0-shs)*lh(x) : fi.dcblockerat(5.0) with {
over = fconstant(int _oversampling, <math.h>);
disto_stage(depth, x) = shs*hh(x)+(1.0-shs)*lh(x) : fi.dcblockerat(40.0) with {
// sigmoid parameters
a = depth*0.2+2.0;
b = 2.0;
// smooth hysteresis transition
shs = hs : si.smooth(ba.tau2pole(10e-3*over));
shs = hs : si.smooth(ba.tau2pole(10e-3));
// the low and high hysteresis
lh(x) = sig(a*x)*b;

View file

@ -2,10 +2,9 @@ import("stdfaust.lib");
ggain = ef.gate_gain_mono(thresh, att, hold, rel) with {
thresh = hslider("[1] Threshold [unit:dB]", 0.0, -60.0, 0.0, 0.01);
over = fconstant(int _oversampling, <math.h>);
att = hslider("[2] Attack [unit:s]", 0.0, 0.0, 10.0, 1e-3) : *(over);
hold = hslider("[3] Hold [unit:s]", 0.0, 0.0, 10.0, 1e-3) : *(over);
rel = hslider("[4] Release [unit:s]", 0.0, 0.0, 5.0, 1e-3) : *(over);
att = hslider("[2] Attack [unit:s]", 0.0, 0.0, 10.0, 1e-3);
hold = hslider("[3] Hold [unit:s]", 0.0, 0.0, 10.0, 1e-3);
rel = hslider("[4] Release [unit:s]", 0.0, 0.0, 5.0, 1e-3);
};
process = ggain;

View file

@ -1,9 +1,8 @@
import("stdfaust.lib");
limiter(x) = gain*x with {
att = 0.0008 * over;
rel = 0.5 * over;
over = fconstant(int _oversampling, <math.h>);
att = 0.0008;
rel = 0.5;
peak = x : an.amp_follower_ud(att, rel);
gain = ba.if(peak>1.0, 1.0/peak, 1.0) : si.smooth(ba.tau2pole(0.5*att));
};

View file

@ -1,181 +0,0 @@
/* ------------------------------------------------------------
name: "compressor"
Code generated with Faust 2.27.2 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustCompressor_H__
#define __faustCompressor_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#define FAUSTCLASS faustCompressor
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
class faustCompressor {
public:
float fConst0;
float fConst1;
FAUSTFLOAT fHslider0;
int fSampleRate;
float fConst2;
FAUSTFLOAT fHslider1;
FAUSTFLOAT fHslider2;
float fRec2[2];
float fRec1[2];
FAUSTFLOAT fHslider3;
float fRec0[2];
public:
void metadata() {
}
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)sample_rate;
}
void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = float(_oversampling);
fConst1 = (0.5f * fConst0);
fConst2 = (1.0f / std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate))));
}
void instanceResetUserInterface() {
fHslider0 = FAUSTFLOAT(0.0f);
fHslider1 = FAUSTFLOAT(1.0f);
fHslider2 = FAUSTFLOAT(0.0f);
fHslider3 = FAUSTFLOAT(0.0f);
}
void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0f;
}
}
void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
faustCompressor* clone() {
return new faustCompressor();
}
int getSampleRate() {
return fSampleRate;
}
void buildUserInterface() {
}
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
float fSlow0 = float(fHslider0);
float fSlow1 = (fConst1 * fSlow0);
int iSlow2 = (std::fabs(fSlow1) < 1.1920929e-07f);
float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow2 ? 1.0f : fSlow1)))));
float fSlow4 = ((1.0f / std::max<float>(1.00000001e-07f, float(fHslider1))) + -1.0f);
float fSlow5 = (fConst0 * fSlow0);
int iSlow6 = (std::fabs(fSlow5) < 1.1920929e-07f);
float fSlow7 = (iSlow6 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow6 ? 1.0f : fSlow5)))));
float fSlow8 = (fConst0 * float(fHslider2));
int iSlow9 = (std::fabs(fSlow8) < 1.1920929e-07f);
float fSlow10 = (iSlow9 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow9 ? 1.0f : fSlow8)))));
float fSlow11 = float(fHslider3);
float fSlow12 = (1.0f - fSlow3);
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = std::fabs(fTemp0);
float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow10 : fSlow7);
fRec2[0] = ((fRec2[1] * fTemp2) + (fTemp1 * (1.0f - fTemp2)));
fRec1[0] = fRec2[0];
fRec0[0] = ((fRec0[1] * fSlow3) + (fSlow4 * (std::max<float>(((20.0f * std::log10(fRec1[0])) - fSlow11), 0.0f) * fSlow12)));
output0[i] = FAUSTFLOAT(std::pow(10.0f, (0.0500000007f * fRec0[0])));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
}
};
#ifdef FAUST_UIMACROS
#define FAUST_LIST_ACTIVES(p) \
p(HORIZONTALSLIDER, Ratio, "Ratio", fHslider1, 1.0f, 1.0f, 20.0f, 0.01f) \
p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider3, 0.0f, -60.0f, 0.0f, 0.01f) \
p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 0.5f, 0.001f) \
p(HORIZONTALSLIDER, Release, "Release", fHslider2, 0.0f, 0.0f, 5.0f, 0.001f) \
#define FAUST_LIST_PASSIVES(p) \
#endif
#endif

View file

@ -0,0 +1,169 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
name: "compressor"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustCompressor_H__
#define __faustCompressor_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#define FAUSTCLASS faustCompressor
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustCompressor {
//[Begin:class]
private:
FAUSTFLOAT fHslider0;
int fSampleRate;
float fConst0;
FAUSTFLOAT fHslider1;
FAUSTFLOAT fHslider2;
float fRec2[2];
float fRec1[2];
FAUSTFLOAT fHslider3;
float fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = (1.0f / float(fSampleRate));
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(0.0f);
fHslider1 = FAUSTFLOAT(1.0f);
fHslider2 = FAUSTFLOAT(0.0f);
fHslider3 = FAUSTFLOAT(0.0f);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0f;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
float fSlow0 = float(fHslider0);
float fSlow1 = (0.5f * fSlow0);
int iSlow2 = (std::fabs(fSlow1) < 1.1920929e-07f);
float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow2 ? 1.0f : fSlow1)))));
float fSlow4 = ((1.0f / std::max<float>(1.1920929e-07f, float(fHslider1))) + -1.0f);
int iSlow5 = (std::fabs(fSlow0) < 1.1920929e-07f);
float fSlow6 = (iSlow5 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow5 ? 1.0f : fSlow0)))));
float fSlow7 = float(fHslider2);
int iSlow8 = (std::fabs(fSlow7) < 1.1920929e-07f);
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow8 ? 1.0f : fSlow7)))));
float fSlow10 = float(fHslider3);
float fSlow11 = (1.0f - fSlow3);
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = std::fabs(fTemp0);
float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow9 : fSlow6);
fRec2[0] = ((fRec2[1] * fTemp2) + (fTemp1 * (1.0f - fTemp2)));
fRec1[0] = fRec2[0];
fRec0[0] = ((fSlow3 * fRec0[1]) + (fSlow4 * (std::max<float>(((20.0f * std::log10(fRec1[0])) - fSlow10), 0.0f) * fSlow11)));
output0[i] = FAUSTFLOAT(std::pow(10.0f, (0.0500000007f * fRec0[0])));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getRatio() const { return fHslider1; }
void setRatio(FAUSTFLOAT value) { fHslider1 = value; }
FAUSTFLOAT getThreshold() const { return fHslider3; }
void setThreshold(FAUSTFLOAT value) { fHslider3 = value; }
FAUSTFLOAT getAttack() const { return fHslider0; }
void setAttack(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getRelease() const { return fHslider2; }
void setRelease(FAUSTFLOAT value) { fHslider2 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,7 +1,11 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
name: "disto_stage"
Code generated with Faust 2.27.2 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -scal -ftz 0
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustDisto_H__
@ -9,20 +13,24 @@ Compilation options: -lang cpp -inpl -scal -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
//[Before:class]
class faustDistoSIG0 {
//[Begin:class]
public:
private:
int iRec3[2];
public:
int getNumInputsfaustDistoSIG0() {
return 0;
}
@ -53,14 +61,13 @@ class faustDistoSIG0 {
}
return rate;
}
void instanceInitfaustDistoSIG0(int sample_rate) {
(void)sample_rate;
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
iRec3[l3] = 0;
}
}
void fillfaustDistoSIG0(int count, float* table) {
for (int i = 0; (i < count); i = (i + 1)) {
iRec3[0] = (iRec3[1] + 1);
@ -77,19 +84,19 @@ static void deletefaustDistoSIG0(faustDistoSIG0* dsp) { delete dsp; }
static float ftbl0faustDistoSIG0[256];
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustDisto
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
class faustDisto {
public:
private:
float fVec0[2];
int fSampleRate;
float fConst0;
@ -97,79 +104,52 @@ class faustDisto {
float fConst2;
float fConst3;
float fConst4;
int iConst5;
float fConst6;
float fConst5;
int iRec2[2];
float fConst7;
float fRec1[2];
FAUSTFLOAT fHslider0;
float fVec1[2];
float fRec0[2];
public:
void metadata() {
}
int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
int getNumOutputs() {
static constexpr 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) {
//[Begin:classInit]
faustDistoSIG0* sig0 = newfaustDistoSIG0();
sig0->instanceInitfaustDistoSIG0(sample_rate);
sig0->fillfaustDistoSIG0(256, ftbl0faustDistoSIG0);
deletefaustDistoSIG0(sig0);
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
fConst1 = (15.707963f / fConst0);
fConst0 = float(fSampleRate);
fConst1 = (125.663704f / fConst0);
fConst2 = (1.0f / (fConst1 + 1.0f));
fConst3 = (1.0f - fConst1);
fConst4 = (0.00999999978f * float(_oversampling));
iConst5 = (std::fabs(fConst4) < 1.1920929e-07f);
fConst6 = (iConst5 ? 0.0f : std::exp((0.0f - ((1.0f / fConst0) / (iConst5 ? 1.0f : fConst4)))));
fConst7 = (1.0f - fConst6);
fConst4 = std::exp((0.0f - (100.0f / fConst0)));
fConst5 = (1.0f - fConst4);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(100.0f);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fVec0[l0] = 0.0f;
}
@ -185,38 +165,39 @@ class faustDisto {
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec0[l5] = 0.0f;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
faustDisto* clone() {
return new faustDisto();
}
int getSampleRate() {
return fSampleRate;
}
void buildUserInterface() {
}
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
float fSlow0 = ((0.200000003f * float(fHslider0)) + 2.0f);
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
fVec0[0] = fTemp0;
iRec2[0] = (((fTemp0 < fVec0[1]) & (fTemp0 < -0.25f)) ? 1 : (((fTemp0 > fVec0[1]) & (fTemp0 > 0.25f)) ? 0 : iRec2[1]));
fRec1[0] = ((fRec1[1] * fConst6) + (float(iRec2[0]) * fConst7));
fRec1[0] = ((fConst4 * fRec1[1]) + (fConst5 * float(iRec2[0])));
float fTemp2 = std::max<float>(0.0f, (12.75f * ((fSlow0 * fTemp0) + 10.0f)));
int iTemp3 = int(fTemp2);
float fTemp4 = ftbl0faustDistoSIG0[std::min<int>(255, iTemp3)];
@ -231,19 +212,21 @@ class faustDisto {
fVec1[1] = fVec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getDepth() const { return fHslider0; }
void setDepth(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#ifdef FAUST_UIMACROS
#define FAUST_LIST_ACTIVES(p) \
p(HORIZONTALSLIDER, Depth, "Depth", fHslider0, 100.0f, 0.0f, 100.0f, 0.01f) \
#define FAUST_LIST_PASSIVES(p) \
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,714 +0,0 @@
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "fverb"
version: "0.5"
Code generated with Faust 2.27.1 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustFverb_H__
#define __faustFverb_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
class faustFverbSIG0 {
public:
int iRec19[2];
public:
int getNumInputsfaustFverbSIG0() {
return 0;
}
int getNumOutputsfaustFverbSIG0() {
return 1;
}
int getInputRatefaustFverbSIG0(int channel) {
int rate;
switch ((channel)) {
default: {
rate = -1;
break;
}
}
return rate;
}
int getOutputRatefaustFverbSIG0(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 0;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
void instanceInitfaustFverbSIG0(int sample_rate) {
(void)sample_rate;
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
iRec19[l4] = 0;
}
}
void fillfaustFverbSIG0(int count, float* table) {
for (int i = 0; (i < count); i = (i + 1)) {
iRec19[0] = (iRec19[1] + 1);
table[i] = std::sin((9.58738019e-05f * float((iRec19[0] + -1))));
iRec19[1] = iRec19[0];
}
}
};
static faustFverbSIG0* newfaustFverbSIG0() { return (faustFverbSIG0*)new faustFverbSIG0(); }
static void deletefaustFverbSIG0(faustFverbSIG0* dsp) { delete dsp; }
static float ftbl0faustFverbSIG0[65536];
#ifndef FAUSTCLASS
#define FAUSTCLASS faustFverb
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
class faustFverb {
public:
FAUSTFLOAT fHslider0;
float fRec0[2];
FAUSTFLOAT fHslider1;
float fRec1[2];
FAUSTFLOAT fHslider2;
float fRec10[2];
int fSampleRate;
float fConst0;
FAUSTFLOAT fHslider3;
float fRec18[2];
float fConst1;
FAUSTFLOAT fHslider4;
float fRec21[2];
float fRec20[2];
float fConst2;
float fConst3;
float fRec14[2];
float fRec15[2];
int iRec16[2];
int iRec17[2];
FAUSTFLOAT fHslider5;
float fRec32[2];
int IOTA;
float fVec0[131072];
FAUSTFLOAT fHslider6;
float fRec33[2];
FAUSTFLOAT fHslider7;
float fRec34[2];
float fRec31[2];
FAUSTFLOAT fHslider8;
float fRec35[2];
float fRec30[2];
FAUSTFLOAT fHslider9;
float fRec36[2];
float fVec1[1024];
int iConst4;
float fRec28[2];
float fVec2[1024];
int iConst5;
float fRec26[2];
FAUSTFLOAT fHslider10;
float fRec37[2];
float fVec3[4096];
int iConst6;
float fRec24[2];
float fVec4[2048];
int iConst7;
float fRec22[2];
int iConst8;
FAUSTFLOAT fHslider11;
float fRec38[2];
float fVec5[131072];
float fRec12[2];
float fVec6[32768];
int iConst9;
FAUSTFLOAT fHslider12;
float fRec39[2];
float fRec11[2];
float fVec7[32768];
int iConst10;
float fRec8[2];
float fRec2[32768];
float fRec3[16384];
float fRec4[32768];
float fRec45[2];
float fRec46[2];
int iRec47[2];
int iRec48[2];
float fVec8[131072];
float fRec58[2];
float fRec57[2];
float fVec9[1024];
int iConst11;
float fRec55[2];
float fVec10[1024];
int iConst12;
float fRec53[2];
float fVec11[4096];
int iConst13;
float fRec51[2];
float fVec12[2048];
int iConst14;
float fRec49[2];
int iConst15;
float fVec13[131072];
float fRec43[2];
float fVec14[32768];
int iConst16;
float fRec42[2];
float fVec15[16384];
int iConst17;
float fRec40[2];
float fRec5[32768];
float fRec6[8192];
float fRec7[32768];
int iConst18;
int iConst19;
int iConst20;
int iConst21;
int iConst22;
int iConst23;
int iConst24;
int iConst25;
int iConst26;
int iConst27;
int iConst28;
int iConst29;
int iConst30;
int iConst31;
public:
void metadata() {
}
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) {
faustFverbSIG0* sig0 = newfaustFverbSIG0();
sig0->instanceInitfaustFverbSIG0(sample_rate);
sig0->fillfaustFverbSIG0(65536, ftbl0faustFverbSIG0);
deletefaustFverbSIG0(sig0);
}
void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
fConst1 = (1.0f / fConst0);
fConst2 = (1.0f / float(int((0.00999999978f * fConst0))));
fConst3 = (0.0f - fConst2);
iConst4 = std::min<int>(65536, std::max<int>(0, (int((0.00462820474f * fConst0)) + -1)));
iConst5 = std::min<int>(65536, std::max<int>(0, (int((0.00370316859f * fConst0)) + -1)));
iConst6 = std::min<int>(65536, std::max<int>(0, (int((0.013116831f * fConst0)) + -1)));
iConst7 = std::min<int>(65536, std::max<int>(0, (int((0.00902825873f * fConst0)) + -1)));
iConst8 = (std::min<int>(65536, std::max<int>(0, int((0.106280029f * fConst0)))) + 1);
iConst9 = std::min<int>(65536, std::max<int>(0, int((0.141695514f * fConst0))));
iConst10 = std::min<int>(65536, std::max<int>(0, (int((0.0892443135f * fConst0)) + -1)));
iConst11 = std::min<int>(65536, std::max<int>(0, (int((0.00491448538f * fConst0)) + -1)));
iConst12 = std::min<int>(65536, std::max<int>(0, (int((0.00348745007f * fConst0)) + -1)));
iConst13 = std::min<int>(65536, std::max<int>(0, (int((0.0123527432f * fConst0)) + -1)));
iConst14 = std::min<int>(65536, std::max<int>(0, (int((0.00958670769f * fConst0)) + -1)));
iConst15 = (std::min<int>(65536, std::max<int>(0, int((0.124995798f * fConst0)))) + 1);
iConst16 = std::min<int>(65536, std::max<int>(0, int((0.149625346f * fConst0))));
iConst17 = std::min<int>(65536, std::max<int>(0, (int((0.0604818389f * fConst0)) + -1)));
iConst18 = std::min<int>(65536, std::max<int>(0, int((0.00893787201f * fConst0))));
iConst19 = std::min<int>(65536, std::max<int>(0, int((0.099929437f * fConst0))));
iConst20 = std::min<int>(65536, std::max<int>(0, int((0.067067638f * fConst0))));
iConst21 = std::min<int>(65536, std::max<int>(0, int((0.0642787516f * fConst0))));
iConst22 = std::min<int>(65536, std::max<int>(0, int((0.0668660328f * fConst0))));
iConst23 = std::min<int>(65536, std::max<int>(0, int((0.0062833908f * fConst0))));
iConst24 = std::min<int>(65536, std::max<int>(0, int((0.0358186886f * fConst0))));
iConst25 = std::min<int>(65536, std::max<int>(0, int((0.0118611604f * fConst0))));
iConst26 = std::min<int>(65536, std::max<int>(0, int((0.121870905f * fConst0))));
iConst27 = std::min<int>(65536, std::max<int>(0, int((0.0898155272f * fConst0))));
iConst28 = std::min<int>(65536, std::max<int>(0, int((0.041262053f * fConst0))));
iConst29 = std::min<int>(65536, std::max<int>(0, int((0.070931755f * fConst0))));
iConst30 = std::min<int>(65536, std::max<int>(0, int((0.0112563418f * fConst0))));
iConst31 = std::min<int>(65536, std::max<int>(0, int((0.00406572362f * fConst0))));
}
void instanceResetUserInterface() {
fHslider0 = FAUSTFLOAT(100.0f);
fHslider1 = FAUSTFLOAT(50.0f);
fHslider2 = FAUSTFLOAT(50.0f);
fHslider3 = FAUSTFLOAT(0.5f);
fHslider4 = FAUSTFLOAT(1.0f);
fHslider5 = FAUSTFLOAT(100.0f);
fHslider6 = FAUSTFLOAT(0.0f);
fHslider7 = FAUSTFLOAT(10000.0f);
fHslider8 = FAUSTFLOAT(100.0f);
fHslider9 = FAUSTFLOAT(75.0f);
fHslider10 = FAUSTFLOAT(62.5f);
fHslider11 = FAUSTFLOAT(70.0f);
fHslider12 = FAUSTFLOAT(5500.0f);
}
void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec10[l2] = 0.0f;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec18[l3] = 0.0f;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec21[l5] = 0.0f;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec20[l6] = 0.0f;
}
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
fRec14[l7] = 0.0f;
}
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec15[l8] = 0.0f;
}
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
iRec16[l9] = 0;
}
for (int l10 = 0; (l10 < 2); l10 = (l10 + 1)) {
iRec17[l10] = 0;
}
for (int l11 = 0; (l11 < 2); l11 = (l11 + 1)) {
fRec32[l11] = 0.0f;
}
IOTA = 0;
for (int l12 = 0; (l12 < 131072); l12 = (l12 + 1)) {
fVec0[l12] = 0.0f;
}
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec33[l13] = 0.0f;
}
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec34[l14] = 0.0f;
}
for (int l15 = 0; (l15 < 2); l15 = (l15 + 1)) {
fRec31[l15] = 0.0f;
}
for (int l16 = 0; (l16 < 2); l16 = (l16 + 1)) {
fRec35[l16] = 0.0f;
}
for (int l17 = 0; (l17 < 2); l17 = (l17 + 1)) {
fRec30[l17] = 0.0f;
}
for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
fRec36[l18] = 0.0f;
}
for (int l19 = 0; (l19 < 1024); l19 = (l19 + 1)) {
fVec1[l19] = 0.0f;
}
for (int l20 = 0; (l20 < 2); l20 = (l20 + 1)) {
fRec28[l20] = 0.0f;
}
for (int l21 = 0; (l21 < 1024); l21 = (l21 + 1)) {
fVec2[l21] = 0.0f;
}
for (int l22 = 0; (l22 < 2); l22 = (l22 + 1)) {
fRec26[l22] = 0.0f;
}
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
fRec37[l23] = 0.0f;
}
for (int l24 = 0; (l24 < 4096); l24 = (l24 + 1)) {
fVec3[l24] = 0.0f;
}
for (int l25 = 0; (l25 < 2); l25 = (l25 + 1)) {
fRec24[l25] = 0.0f;
}
for (int l26 = 0; (l26 < 2048); l26 = (l26 + 1)) {
fVec4[l26] = 0.0f;
}
for (int l27 = 0; (l27 < 2); l27 = (l27 + 1)) {
fRec22[l27] = 0.0f;
}
for (int l28 = 0; (l28 < 2); l28 = (l28 + 1)) {
fRec38[l28] = 0.0f;
}
for (int l29 = 0; (l29 < 131072); l29 = (l29 + 1)) {
fVec5[l29] = 0.0f;
}
for (int l30 = 0; (l30 < 2); l30 = (l30 + 1)) {
fRec12[l30] = 0.0f;
}
for (int l31 = 0; (l31 < 32768); l31 = (l31 + 1)) {
fVec6[l31] = 0.0f;
}
for (int l32 = 0; (l32 < 2); l32 = (l32 + 1)) {
fRec39[l32] = 0.0f;
}
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
fRec11[l33] = 0.0f;
}
for (int l34 = 0; (l34 < 32768); l34 = (l34 + 1)) {
fVec7[l34] = 0.0f;
}
for (int l35 = 0; (l35 < 2); l35 = (l35 + 1)) {
fRec8[l35] = 0.0f;
}
for (int l36 = 0; (l36 < 32768); l36 = (l36 + 1)) {
fRec2[l36] = 0.0f;
}
for (int l37 = 0; (l37 < 16384); l37 = (l37 + 1)) {
fRec3[l37] = 0.0f;
}
for (int l38 = 0; (l38 < 32768); l38 = (l38 + 1)) {
fRec4[l38] = 0.0f;
}
for (int l39 = 0; (l39 < 2); l39 = (l39 + 1)) {
fRec45[l39] = 0.0f;
}
for (int l40 = 0; (l40 < 2); l40 = (l40 + 1)) {
fRec46[l40] = 0.0f;
}
for (int l41 = 0; (l41 < 2); l41 = (l41 + 1)) {
iRec47[l41] = 0;
}
for (int l42 = 0; (l42 < 2); l42 = (l42 + 1)) {
iRec48[l42] = 0;
}
for (int l43 = 0; (l43 < 131072); l43 = (l43 + 1)) {
fVec8[l43] = 0.0f;
}
for (int l44 = 0; (l44 < 2); l44 = (l44 + 1)) {
fRec58[l44] = 0.0f;
}
for (int l45 = 0; (l45 < 2); l45 = (l45 + 1)) {
fRec57[l45] = 0.0f;
}
for (int l46 = 0; (l46 < 1024); l46 = (l46 + 1)) {
fVec9[l46] = 0.0f;
}
for (int l47 = 0; (l47 < 2); l47 = (l47 + 1)) {
fRec55[l47] = 0.0f;
}
for (int l48 = 0; (l48 < 1024); l48 = (l48 + 1)) {
fVec10[l48] = 0.0f;
}
for (int l49 = 0; (l49 < 2); l49 = (l49 + 1)) {
fRec53[l49] = 0.0f;
}
for (int l50 = 0; (l50 < 4096); l50 = (l50 + 1)) {
fVec11[l50] = 0.0f;
}
for (int l51 = 0; (l51 < 2); l51 = (l51 + 1)) {
fRec51[l51] = 0.0f;
}
for (int l52 = 0; (l52 < 2048); l52 = (l52 + 1)) {
fVec12[l52] = 0.0f;
}
for (int l53 = 0; (l53 < 2); l53 = (l53 + 1)) {
fRec49[l53] = 0.0f;
}
for (int l54 = 0; (l54 < 131072); l54 = (l54 + 1)) {
fVec13[l54] = 0.0f;
}
for (int l55 = 0; (l55 < 2); l55 = (l55 + 1)) {
fRec43[l55] = 0.0f;
}
for (int l56 = 0; (l56 < 32768); l56 = (l56 + 1)) {
fVec14[l56] = 0.0f;
}
for (int l57 = 0; (l57 < 2); l57 = (l57 + 1)) {
fRec42[l57] = 0.0f;
}
for (int l58 = 0; (l58 < 16384); l58 = (l58 + 1)) {
fVec15[l58] = 0.0f;
}
for (int l59 = 0; (l59 < 2); l59 = (l59 + 1)) {
fRec40[l59] = 0.0f;
}
for (int l60 = 0; (l60 < 32768); l60 = (l60 + 1)) {
fRec5[l60] = 0.0f;
}
for (int l61 = 0; (l61 < 8192); l61 = (l61 + 1)) {
fRec6[l61] = 0.0f;
}
for (int l62 = 0; (l62 < 32768); l62 = (l62 + 1)) {
fRec7[l62] = 0.0f;
}
}
void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
faustFverb* clone() {
return new faustFverb();
}
int getSampleRate() {
return fSampleRate;
}
void buildUserInterface() {
}
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
float fSlow0 = (9.99999975e-06f * float(fHslider0));
float fSlow1 = (9.99999975e-06f * float(fHslider1));
float fSlow2 = (9.99999975e-06f * float(fHslider2));
float fSlow3 = (9.99999997e-07f * float(fHslider3));
float fSlow4 = (0.00100000005f * float(fHslider4));
float fSlow5 = (9.99999975e-06f * float(fHslider5));
float fSlow6 = (9.99999997e-07f * float(fHslider6));
float fSlow7 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider7))))));
float fSlow8 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider8))))));
float fSlow9 = (9.99999975e-06f * float(fHslider9));
float fSlow10 = (9.99999975e-06f * float(fHslider10));
float fSlow11 = (9.99999975e-06f * float(fHslider11));
float fSlow12 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider12))))));
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = float(input1[i]);
fRec0[0] = (fSlow0 + (0.999000013f * fRec0[1]));
fRec1[0] = (fSlow1 + (0.999000013f * fRec1[1]));
fRec10[0] = (fSlow2 + (0.999000013f * fRec10[1]));
float fTemp2 = std::min<float>(0.5f, std::max<float>(0.25f, (fRec10[0] + 0.150000006f)));
fRec18[0] = (fSlow3 + (0.999000013f * fRec18[1]));
fRec21[0] = (fSlow4 + (0.999000013f * fRec21[1]));
float fTemp3 = (fRec20[1] + (fConst1 * fRec21[0]));
fRec20[0] = (fTemp3 - float(int(fTemp3)));
int iTemp4 = (int((fConst0 * ((fRec18[0] * ftbl0faustFverbSIG0[int((65536.0f * (fRec20[0] + (0.25f - float(int((fRec20[0] + 0.25f)))))))]) + 0.0305097271f))) + -1);
float fTemp5 = ((fRec14[1] != 0.0f) ? (((fRec15[1] > 0.0f) & (fRec15[1] < 1.0f)) ? fRec14[1] : 0.0f) : (((fRec15[1] == 0.0f) & (iTemp4 != iRec16[1])) ? fConst2 : (((fRec15[1] == 1.0f) & (iTemp4 != iRec17[1])) ? fConst3 : 0.0f)));
fRec14[0] = fTemp5;
fRec15[0] = std::max<float>(0.0f, std::min<float>(1.0f, (fRec15[1] + fTemp5)));
iRec16[0] = (((fRec15[1] >= 1.0f) & (iRec17[1] != iTemp4)) ? iTemp4 : iRec16[1]);
iRec17[0] = (((fRec15[1] <= 0.0f) & (iRec16[1] != iTemp4)) ? iTemp4 : iRec17[1]);
fRec32[0] = (fSlow5 + (0.999000013f * fRec32[1]));
fVec0[(IOTA & 131071)] = (fTemp1 * fRec32[0]);
fRec33[0] = (fSlow6 + (0.999000013f * fRec33[1]));
int iTemp6 = std::min<int>(65536, std::max<int>(0, int((fConst0 * fRec33[0]))));
fRec34[0] = (fSlow7 + (0.999000013f * fRec34[1]));
fRec31[0] = (fVec0[((IOTA - iTemp6) & 131071)] + (fRec34[0] * fRec31[1]));
float fTemp7 = (1.0f - fRec34[0]);
fRec35[0] = (fSlow8 + (0.999000013f * fRec35[1]));
fRec30[0] = ((fRec31[0] * fTemp7) + (fRec35[0] * fRec30[1]));
float fTemp8 = (fRec35[0] + 1.0f);
float fTemp9 = (0.0f - (0.5f * fTemp8));
fRec36[0] = (fSlow9 + (0.999000013f * fRec36[1]));
float fTemp10 = (((0.5f * (fRec30[0] * fTemp8)) + (fRec30[1] * fTemp9)) - (fRec36[0] * fRec28[1]));
fVec1[(IOTA & 1023)] = fTemp10;
fRec28[0] = fVec1[((IOTA - iConst4) & 1023)];
float fRec29 = (fRec36[0] * fTemp10);
float fTemp11 = ((fRec29 + fRec28[1]) - (fRec36[0] * fRec26[1]));
fVec2[(IOTA & 1023)] = fTemp11;
fRec26[0] = fVec2[((IOTA - iConst5) & 1023)];
float fRec27 = (fRec36[0] * fTemp11);
fRec37[0] = (fSlow10 + (0.999000013f * fRec37[1]));
float fTemp12 = ((fRec27 + fRec26[1]) - (fRec37[0] * fRec24[1]));
fVec3[(IOTA & 4095)] = fTemp12;
fRec24[0] = fVec3[((IOTA - iConst6) & 4095)];
float fRec25 = (fRec37[0] * fTemp12);
float fTemp13 = ((fRec25 + fRec24[1]) - (fRec37[0] * fRec22[1]));
fVec4[(IOTA & 2047)] = fTemp13;
fRec22[0] = fVec4[((IOTA - iConst7) & 2047)];
float fRec23 = (fRec37[0] * fTemp13);
fRec38[0] = (fSlow11 + (0.999000013f * fRec38[1]));
float fTemp14 = (fRec22[1] + ((fRec10[0] * fRec5[((IOTA - iConst8) & 32767)]) + (fRec23 + (fRec38[0] * fRec12[1]))));
fVec5[(IOTA & 131071)] = fTemp14;
fRec12[0] = (((1.0f - fRec15[0]) * fVec5[((IOTA - std::min<int>(65536, std::max<int>(0, iRec16[0]))) & 131071)]) + (fRec15[0] * fVec5[((IOTA - std::min<int>(65536, std::max<int>(0, iRec17[0]))) & 131071)]));
float fRec13 = (0.0f - (fRec38[0] * fTemp14));
float fTemp15 = (fRec13 + fRec12[1]);
fVec6[(IOTA & 32767)] = fTemp15;
fRec39[0] = (fSlow12 + (0.999000013f * fRec39[1]));
fRec11[0] = (fVec6[((IOTA - iConst9) & 32767)] + (fRec39[0] * fRec11[1]));
float fTemp16 = (1.0f - fRec39[0]);
float fTemp17 = ((fTemp2 * fRec8[1]) + ((fRec10[0] * fRec11[0]) * fTemp16));
fVec7[(IOTA & 32767)] = fTemp17;
fRec8[0] = fVec7[((IOTA - iConst10) & 32767)];
float fRec9 = (0.0f - (fTemp2 * fTemp17));
fRec2[(IOTA & 32767)] = (fRec9 + fRec8[1]);
fRec3[(IOTA & 16383)] = (fRec11[0] * fTemp16);
fRec4[(IOTA & 32767)] = fTemp15;
int iTemp18 = (int((fConst0 * ((fRec18[0] * ftbl0faustFverbSIG0[int((65536.0f * fRec20[0]))]) + 0.025603978f))) + -1);
float fTemp19 = ((fRec45[1] != 0.0f) ? (((fRec46[1] > 0.0f) & (fRec46[1] < 1.0f)) ? fRec45[1] : 0.0f) : (((fRec46[1] == 0.0f) & (iTemp18 != iRec47[1])) ? fConst2 : (((fRec46[1] == 1.0f) & (iTemp18 != iRec48[1])) ? fConst3 : 0.0f)));
fRec45[0] = fTemp19;
fRec46[0] = std::max<float>(0.0f, std::min<float>(1.0f, (fRec46[1] + fTemp19)));
iRec47[0] = (((fRec46[1] >= 1.0f) & (iRec48[1] != iTemp18)) ? iTemp18 : iRec47[1]);
iRec48[0] = (((fRec46[1] <= 0.0f) & (iRec47[1] != iTemp18)) ? iTemp18 : iRec48[1]);
fVec8[(IOTA & 131071)] = (fTemp0 * fRec32[0]);
fRec58[0] = (fVec8[((IOTA - iTemp6) & 131071)] + (fRec34[0] * fRec58[1]));
fRec57[0] = ((fTemp7 * fRec58[0]) + (fRec35[0] * fRec57[1]));
float fTemp20 = (((0.5f * (fRec57[0] * fTemp8)) + (fTemp9 * fRec57[1])) - (fRec36[0] * fRec55[1]));
fVec9[(IOTA & 1023)] = fTemp20;
fRec55[0] = fVec9[((IOTA - iConst11) & 1023)];
float fRec56 = (fRec36[0] * fTemp20);
float fTemp21 = ((fRec56 + fRec55[1]) - (fRec36[0] * fRec53[1]));
fVec10[(IOTA & 1023)] = fTemp21;
fRec53[0] = fVec10[((IOTA - iConst12) & 1023)];
float fRec54 = (fRec36[0] * fTemp21);
float fTemp22 = ((fRec54 + fRec53[1]) - (fRec37[0] * fRec51[1]));
fVec11[(IOTA & 4095)] = fTemp22;
fRec51[0] = fVec11[((IOTA - iConst13) & 4095)];
float fRec52 = (fRec37[0] * fTemp22);
float fTemp23 = ((fRec52 + fRec51[1]) - (fRec37[0] * fRec49[1]));
fVec12[(IOTA & 2047)] = fTemp23;
fRec49[0] = fVec12[((IOTA - iConst14) & 2047)];
float fRec50 = (fRec37[0] * fTemp23);
float fTemp24 = (fRec49[1] + ((fRec10[0] * fRec2[((IOTA - iConst15) & 32767)]) + (fRec50 + (fRec38[0] * fRec43[1]))));
fVec13[(IOTA & 131071)] = fTemp24;
fRec43[0] = (((1.0f - fRec46[0]) * fVec13[((IOTA - std::min<int>(65536, std::max<int>(0, iRec47[0]))) & 131071)]) + (fRec46[0] * fVec13[((IOTA - std::min<int>(65536, std::max<int>(0, iRec48[0]))) & 131071)]));
float fRec44 = (0.0f - (fRec38[0] * fTemp24));
float fTemp25 = (fRec44 + fRec43[1]);
fVec14[(IOTA & 32767)] = fTemp25;
fRec42[0] = (fVec14[((IOTA - iConst16) & 32767)] + (fRec39[0] * fRec42[1]));
float fTemp26 = ((fTemp2 * fRec40[1]) + ((fRec10[0] * fTemp16) * fRec42[0]));
fVec15[(IOTA & 16383)] = fTemp26;
fRec40[0] = fVec15[((IOTA - iConst17) & 16383)];
float fRec41 = (0.0f - (fTemp2 * fTemp26));
fRec5[(IOTA & 32767)] = (fRec41 + fRec40[1]);
fRec6[(IOTA & 8191)] = (fTemp16 * fRec42[0]);
fRec7[(IOTA & 32767)] = fTemp25;
output0[i] = FAUSTFLOAT(((fTemp0 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec4[((IOTA - iConst18) & 32767)] + fRec4[((IOTA - iConst19) & 32767)]) + fRec2[((IOTA - iConst20) & 32767)]) - (((fRec3[((IOTA - iConst21) & 16383)] + fRec7[((IOTA - iConst22) & 32767)]) + fRec6[((IOTA - iConst23) & 8191)]) + fRec5[((IOTA - iConst24) & 32767)]))))));
output1[i] = FAUSTFLOAT(((fTemp1 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec7[((IOTA - iConst25) & 32767)] + fRec7[((IOTA - iConst26) & 32767)]) + fRec5[((IOTA - iConst27) & 32767)]) - (((fRec6[((IOTA - iConst28) & 8191)] + fRec4[((IOTA - iConst29) & 32767)]) + fRec3[((IOTA - iConst30) & 16383)]) + fRec2[((IOTA - iConst31) & 32767)]))))));
fRec0[1] = fRec0[0];
fRec1[1] = fRec1[0];
fRec10[1] = fRec10[0];
fRec18[1] = fRec18[0];
fRec21[1] = fRec21[0];
fRec20[1] = fRec20[0];
fRec14[1] = fRec14[0];
fRec15[1] = fRec15[0];
iRec16[1] = iRec16[0];
iRec17[1] = iRec17[0];
fRec32[1] = fRec32[0];
IOTA = (IOTA + 1);
fRec33[1] = fRec33[0];
fRec34[1] = fRec34[0];
fRec31[1] = fRec31[0];
fRec35[1] = fRec35[0];
fRec30[1] = fRec30[0];
fRec36[1] = fRec36[0];
fRec28[1] = fRec28[0];
fRec26[1] = fRec26[0];
fRec37[1] = fRec37[0];
fRec24[1] = fRec24[0];
fRec22[1] = fRec22[0];
fRec38[1] = fRec38[0];
fRec12[1] = fRec12[0];
fRec39[1] = fRec39[0];
fRec11[1] = fRec11[0];
fRec8[1] = fRec8[0];
fRec45[1] = fRec45[0];
fRec46[1] = fRec46[0];
iRec47[1] = iRec47[0];
iRec48[1] = iRec48[0];
fRec58[1] = fRec58[0];
fRec57[1] = fRec57[0];
fRec55[1] = fRec55[0];
fRec53[1] = fRec53[0];
fRec51[1] = fRec51[0];
fRec49[1] = fRec49[0];
fRec43[1] = fRec43[0];
fRec42[1] = fRec42[0];
fRec40[1] = fRec40[0];
}
}
};
#ifdef FAUST_UIMACROS
#define FAUST_LIST_ACTIVES(p) \
p(HORIZONTALSLIDER, Predelay, "Predelay", fHslider6, 0.0f, 0.0f, 300.0f, 1.0f) \
p(HORIZONTALSLIDER, Input_amount, "Input amount", fHslider5, 100.0f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Input_low_pass_cutoff, "Input low pass cutoff", fHslider7, 10000.0f, 1.0f, 20000.0f, 1.0f) \
p(HORIZONTALSLIDER, Input_high_pass_cutoff, "Input high pass cutoff", fHslider8, 100.0f, 1.0f, 1000.0f, 1.0f) \
p(HORIZONTALSLIDER, Input_diffusion_1, "Input diffusion 1", fHslider9, 75.0f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Input_diffusion_2, "Input diffusion 2", fHslider10, 62.5f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Tail_density, "Tail density", fHslider11, 70.0f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Decay, "Decay", fHslider2, 50.0f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Damping, "Damping", fHslider12, 5500.0f, 10.0f, 20000.0f, 1.0f) \
p(HORIZONTALSLIDER, Modulator_frequency, "Modulator frequency", fHslider4, 1.0f, 0.01f, 4.0f, 0.01f) \
p(HORIZONTALSLIDER, Modulator_depth, "Modulator depth", fHslider3, 0.5f, 0.0f, 10.0f, 0.10000000000000001f) \
p(HORIZONTALSLIDER, Dry, "Dry", fHslider0, 100.0f, 0.0f, 100.0f, 0.01f) \
p(HORIZONTALSLIDER, Wet, "Wet", fHslider1, 50.0f, 0.0f, 100.0f, 0.01f) \
#define FAUST_LIST_PASSIVES(p) \
#endif
#endif

View file

@ -0,0 +1,719 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "fverb"
version: "0.5"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustFverb_H__
#define __faustFverb_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
//[Before:class]
class faustFverbSIG0 {
//[Begin:class]
private:
int iRec36[2];
public:
int getNumInputsfaustFverbSIG0() {
return 0;
}
int getNumOutputsfaustFverbSIG0() {
return 1;
}
int getInputRatefaustFverbSIG0(int channel) {
int rate;
switch ((channel)) {
default: {
rate = -1;
break;
}
}
return rate;
}
int getOutputRatefaustFverbSIG0(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 0;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
void instanceInitfaustFverbSIG0(int sample_rate) {
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
iRec36[l23] = 0;
}
}
void fillfaustFverbSIG0(int count, float* table) {
for (int i = 0; (i < count); i = (i + 1)) {
iRec36[0] = (iRec36[1] + 1);
table[i] = std::sin((9.58738019e-05f * float((iRec36[0] + -1))));
iRec36[1] = iRec36[0];
}
}
};
static faustFverbSIG0* newfaustFverbSIG0() { return (faustFverbSIG0*)new faustFverbSIG0(); }
static void deletefaustFverbSIG0(faustFverbSIG0* dsp) { delete dsp; }
static float ftbl0faustFverbSIG0[65536];
#ifndef FAUSTCLASS
#define FAUSTCLASS faustFverb
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
class faustFverb {
private:
FAUSTFLOAT fHslider0;
float fRec0[2];
FAUSTFLOAT fHslider1;
float fRec1[2];
FAUSTFLOAT fHslider2;
float fRec10[2];
FAUSTFLOAT fHslider3;
float fRec24[2];
int IOTA;
float fVec0[131072];
int fSampleRate;
float fConst0;
FAUSTFLOAT fHslider4;
float fRec25[2];
float fConst1;
FAUSTFLOAT fHslider5;
float fRec26[2];
float fRec23[2];
FAUSTFLOAT fHslider6;
float fRec27[2];
float fRec22[2];
FAUSTFLOAT fHslider7;
float fRec28[2];
float fVec1[131072];
int iConst2;
float fRec20[2];
float fVec2[131072];
int iConst3;
float fRec18[2];
FAUSTFLOAT fHslider8;
float fRec29[2];
float fVec3[131072];
int iConst4;
float fRec16[2];
float fVec4[131072];
int iConst5;
float fRec14[2];
int iConst6;
FAUSTFLOAT fHslider9;
float fRec30[2];
float fVec5[131072];
FAUSTFLOAT fHslider10;
float fRec35[2];
FAUSTFLOAT fHslider11;
float fRec38[2];
float fRec37[2];
float fConst7;
float fConst8;
float fRec31[2];
float fRec32[2];
int iRec33[2];
int iRec34[2];
float fRec12[2];
float fVec6[131072];
int iConst9;
FAUSTFLOAT fHslider12;
float fRec39[2];
float fRec11[2];
float fVec7[131072];
int iConst10;
float fRec8[2];
float fRec2[131072];
float fRec3[131072];
float fRec4[131072];
float fVec8[131072];
float fRec54[2];
float fRec53[2];
float fVec9[131072];
int iConst11;
float fRec51[2];
float fVec10[131072];
int iConst12;
float fRec49[2];
float fVec11[131072];
int iConst13;
float fRec47[2];
float fVec12[131072];
int iConst14;
float fRec45[2];
int iConst15;
float fVec13[131072];
float fRec55[2];
float fRec56[2];
int iRec57[2];
int iRec58[2];
float fRec43[2];
float fVec14[131072];
int iConst16;
float fRec42[2];
float fVec15[131072];
int iConst17;
float fRec40[2];
float fRec5[131072];
float fRec6[131072];
float fRec7[131072];
int iConst18;
int iConst19;
int iConst20;
int iConst21;
int iConst22;
int iConst23;
int iConst24;
int iConst25;
int iConst26;
int iConst27;
int iConst28;
int iConst29;
int iConst30;
int iConst31;
public:
static constexpr int getNumInputs() {
return 2;
}
static constexpr int getNumOutputs() {
return 2;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
faustFverbSIG0* sig0 = newfaustFverbSIG0();
sig0->instanceInitfaustFverbSIG0(sample_rate);
sig0->fillfaustFverbSIG0(65536, ftbl0faustFverbSIG0);
deletefaustFverbSIG0(sig0);
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = float(fSampleRate);
fConst1 = (1.0f / fConst0);
iConst2 = std::min<int>(65536, std::max<int>(0, (int((0.00462820474f * fConst0)) + -1)));
iConst3 = std::min<int>(65536, std::max<int>(0, (int((0.00370316859f * fConst0)) + -1)));
iConst4 = std::min<int>(65536, std::max<int>(0, (int((0.013116831f * fConst0)) + -1)));
iConst5 = std::min<int>(65536, std::max<int>(0, (int((0.00902825873f * fConst0)) + -1)));
iConst6 = (std::min<int>(65536, std::max<int>(0, int((0.106280029f * fConst0)))) + 1);
fConst7 = (1.0f / float(int((0.00999999978f * fConst0))));
fConst8 = (0.0f - fConst7);
iConst9 = std::min<int>(65536, std::max<int>(0, int((0.141695514f * fConst0))));
iConst10 = std::min<int>(65536, std::max<int>(0, (int((0.0892443135f * fConst0)) + -1)));
iConst11 = std::min<int>(65536, std::max<int>(0, (int((0.00491448538f * fConst0)) + -1)));
iConst12 = std::min<int>(65536, std::max<int>(0, (int((0.00348745007f * fConst0)) + -1)));
iConst13 = std::min<int>(65536, std::max<int>(0, (int((0.0123527432f * fConst0)) + -1)));
iConst14 = std::min<int>(65536, std::max<int>(0, (int((0.00958670769f * fConst0)) + -1)));
iConst15 = (std::min<int>(65536, std::max<int>(0, int((0.124995798f * fConst0)))) + 1);
iConst16 = std::min<int>(65536, std::max<int>(0, int((0.149625346f * fConst0))));
iConst17 = std::min<int>(65536, std::max<int>(0, (int((0.0604818389f * fConst0)) + -1)));
iConst18 = std::min<int>(65536, std::max<int>(0, int((0.00893787201f * fConst0))));
iConst19 = std::min<int>(65536, std::max<int>(0, int((0.099929437f * fConst0))));
iConst20 = std::min<int>(65536, std::max<int>(0, int((0.067067638f * fConst0))));
iConst21 = std::min<int>(65536, std::max<int>(0, int((0.0642787516f * fConst0))));
iConst22 = std::min<int>(65536, std::max<int>(0, int((0.0668660328f * fConst0))));
iConst23 = std::min<int>(65536, std::max<int>(0, int((0.0062833908f * fConst0))));
iConst24 = std::min<int>(65536, std::max<int>(0, int((0.0358186886f * fConst0))));
iConst25 = std::min<int>(65536, std::max<int>(0, int((0.0118611604f * fConst0))));
iConst26 = std::min<int>(65536, std::max<int>(0, int((0.121870905f * fConst0))));
iConst27 = std::min<int>(65536, std::max<int>(0, int((0.0898155272f * fConst0))));
iConst28 = std::min<int>(65536, std::max<int>(0, int((0.041262053f * fConst0))));
iConst29 = std::min<int>(65536, std::max<int>(0, int((0.070931755f * fConst0))));
iConst30 = std::min<int>(65536, std::max<int>(0, int((0.0112563418f * fConst0))));
iConst31 = std::min<int>(65536, std::max<int>(0, int((0.00406572362f * fConst0))));
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(100.0f);
fHslider1 = FAUSTFLOAT(50.0f);
fHslider2 = FAUSTFLOAT(50.0f);
fHslider3 = FAUSTFLOAT(100.0f);
fHslider4 = FAUSTFLOAT(0.0f);
fHslider5 = FAUSTFLOAT(10000.0f);
fHslider6 = FAUSTFLOAT(100.0f);
fHslider7 = FAUSTFLOAT(75.0f);
fHslider8 = FAUSTFLOAT(62.5f);
fHslider9 = FAUSTFLOAT(70.0f);
fHslider10 = FAUSTFLOAT(0.5f);
fHslider11 = FAUSTFLOAT(1.0f);
fHslider12 = FAUSTFLOAT(5500.0f);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec10[l2] = 0.0f;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec24[l3] = 0.0f;
}
IOTA = 0;
for (int l4 = 0; (l4 < 131072); l4 = (l4 + 1)) {
fVec0[l4] = 0.0f;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec25[l5] = 0.0f;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec26[l6] = 0.0f;
}
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
fRec23[l7] = 0.0f;
}
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec27[l8] = 0.0f;
}
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec22[l9] = 0.0f;
}
for (int l10 = 0; (l10 < 2); l10 = (l10 + 1)) {
fRec28[l10] = 0.0f;
}
for (int l11 = 0; (l11 < 131072); l11 = (l11 + 1)) {
fVec1[l11] = 0.0f;
}
for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) {
fRec20[l12] = 0.0f;
}
for (int l13 = 0; (l13 < 131072); l13 = (l13 + 1)) {
fVec2[l13] = 0.0f;
}
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec18[l14] = 0.0f;
}
for (int l15 = 0; (l15 < 2); l15 = (l15 + 1)) {
fRec29[l15] = 0.0f;
}
for (int l16 = 0; (l16 < 131072); l16 = (l16 + 1)) {
fVec3[l16] = 0.0f;
}
for (int l17 = 0; (l17 < 2); l17 = (l17 + 1)) {
fRec16[l17] = 0.0f;
}
for (int l18 = 0; (l18 < 131072); l18 = (l18 + 1)) {
fVec4[l18] = 0.0f;
}
for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) {
fRec14[l19] = 0.0f;
}
for (int l20 = 0; (l20 < 2); l20 = (l20 + 1)) {
fRec30[l20] = 0.0f;
}
for (int l21 = 0; (l21 < 131072); l21 = (l21 + 1)) {
fVec5[l21] = 0.0f;
}
for (int l22 = 0; (l22 < 2); l22 = (l22 + 1)) {
fRec35[l22] = 0.0f;
}
for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) {
fRec38[l24] = 0.0f;
}
for (int l25 = 0; (l25 < 2); l25 = (l25 + 1)) {
fRec37[l25] = 0.0f;
}
for (int l26 = 0; (l26 < 2); l26 = (l26 + 1)) {
fRec31[l26] = 0.0f;
}
for (int l27 = 0; (l27 < 2); l27 = (l27 + 1)) {
fRec32[l27] = 0.0f;
}
for (int l28 = 0; (l28 < 2); l28 = (l28 + 1)) {
iRec33[l28] = 0;
}
for (int l29 = 0; (l29 < 2); l29 = (l29 + 1)) {
iRec34[l29] = 0;
}
for (int l30 = 0; (l30 < 2); l30 = (l30 + 1)) {
fRec12[l30] = 0.0f;
}
for (int l31 = 0; (l31 < 131072); l31 = (l31 + 1)) {
fVec6[l31] = 0.0f;
}
for (int l32 = 0; (l32 < 2); l32 = (l32 + 1)) {
fRec39[l32] = 0.0f;
}
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
fRec11[l33] = 0.0f;
}
for (int l34 = 0; (l34 < 131072); l34 = (l34 + 1)) {
fVec7[l34] = 0.0f;
}
for (int l35 = 0; (l35 < 2); l35 = (l35 + 1)) {
fRec8[l35] = 0.0f;
}
for (int l36 = 0; (l36 < 131072); l36 = (l36 + 1)) {
fRec2[l36] = 0.0f;
}
for (int l37 = 0; (l37 < 131072); l37 = (l37 + 1)) {
fRec3[l37] = 0.0f;
}
for (int l38 = 0; (l38 < 131072); l38 = (l38 + 1)) {
fRec4[l38] = 0.0f;
}
for (int l39 = 0; (l39 < 131072); l39 = (l39 + 1)) {
fVec8[l39] = 0.0f;
}
for (int l40 = 0; (l40 < 2); l40 = (l40 + 1)) {
fRec54[l40] = 0.0f;
}
for (int l41 = 0; (l41 < 2); l41 = (l41 + 1)) {
fRec53[l41] = 0.0f;
}
for (int l42 = 0; (l42 < 131072); l42 = (l42 + 1)) {
fVec9[l42] = 0.0f;
}
for (int l43 = 0; (l43 < 2); l43 = (l43 + 1)) {
fRec51[l43] = 0.0f;
}
for (int l44 = 0; (l44 < 131072); l44 = (l44 + 1)) {
fVec10[l44] = 0.0f;
}
for (int l45 = 0; (l45 < 2); l45 = (l45 + 1)) {
fRec49[l45] = 0.0f;
}
for (int l46 = 0; (l46 < 131072); l46 = (l46 + 1)) {
fVec11[l46] = 0.0f;
}
for (int l47 = 0; (l47 < 2); l47 = (l47 + 1)) {
fRec47[l47] = 0.0f;
}
for (int l48 = 0; (l48 < 131072); l48 = (l48 + 1)) {
fVec12[l48] = 0.0f;
}
for (int l49 = 0; (l49 < 2); l49 = (l49 + 1)) {
fRec45[l49] = 0.0f;
}
for (int l50 = 0; (l50 < 131072); l50 = (l50 + 1)) {
fVec13[l50] = 0.0f;
}
for (int l51 = 0; (l51 < 2); l51 = (l51 + 1)) {
fRec55[l51] = 0.0f;
}
for (int l52 = 0; (l52 < 2); l52 = (l52 + 1)) {
fRec56[l52] = 0.0f;
}
for (int l53 = 0; (l53 < 2); l53 = (l53 + 1)) {
iRec57[l53] = 0;
}
for (int l54 = 0; (l54 < 2); l54 = (l54 + 1)) {
iRec58[l54] = 0;
}
for (int l55 = 0; (l55 < 2); l55 = (l55 + 1)) {
fRec43[l55] = 0.0f;
}
for (int l56 = 0; (l56 < 131072); l56 = (l56 + 1)) {
fVec14[l56] = 0.0f;
}
for (int l57 = 0; (l57 < 2); l57 = (l57 + 1)) {
fRec42[l57] = 0.0f;
}
for (int l58 = 0; (l58 < 131072); l58 = (l58 + 1)) {
fVec15[l58] = 0.0f;
}
for (int l59 = 0; (l59 < 2); l59 = (l59 + 1)) {
fRec40[l59] = 0.0f;
}
for (int l60 = 0; (l60 < 131072); l60 = (l60 + 1)) {
fRec5[l60] = 0.0f;
}
for (int l61 = 0; (l61 < 131072); l61 = (l61 + 1)) {
fRec6[l61] = 0.0f;
}
for (int l62 = 0; (l62 < 131072); l62 = (l62 + 1)) {
fRec7[l62] = 0.0f;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
float fSlow0 = (9.99999975e-06f * float(fHslider0));
float fSlow1 = (9.99999975e-06f * float(fHslider1));
float fSlow2 = (9.99999975e-06f * float(fHslider2));
float fSlow3 = (9.99999975e-06f * float(fHslider3));
float fSlow4 = (9.99999997e-07f * float(fHslider4));
float fSlow5 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider5))))));
float fSlow6 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider6))))));
float fSlow7 = (9.99999975e-06f * float(fHslider7));
float fSlow8 = (9.99999975e-06f * float(fHslider8));
float fSlow9 = (9.99999975e-06f * float(fHslider9));
float fSlow10 = (9.99999997e-07f * float(fHslider10));
float fSlow11 = (0.00100000005f * float(fHslider11));
float fSlow12 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider12))))));
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = float(input1[i]);
fRec0[0] = (fSlow0 + (0.999000013f * fRec0[1]));
fRec1[0] = (fSlow1 + (0.999000013f * fRec1[1]));
fRec10[0] = (fSlow2 + (0.999000013f * fRec10[1]));
float fTemp2 = std::min<float>(0.5f, std::max<float>(0.25f, (fRec10[0] + 0.150000006f)));
fRec24[0] = (fSlow3 + (0.999000013f * fRec24[1]));
fVec0[(IOTA & 131071)] = (fTemp1 * fRec24[0]);
fRec25[0] = (fSlow4 + (0.999000013f * fRec25[1]));
int iTemp3 = std::min<int>(65536, std::max<int>(0, int((fConst0 * fRec25[0]))));
fRec26[0] = (fSlow5 + (0.999000013f * fRec26[1]));
fRec23[0] = (fVec0[((IOTA - iTemp3) & 131071)] + (fRec26[0] * fRec23[1]));
float fTemp4 = (1.0f - fRec26[0]);
fRec27[0] = (fSlow6 + (0.999000013f * fRec27[1]));
fRec22[0] = ((fRec23[0] * fTemp4) + (fRec27[0] * fRec22[1]));
float fTemp5 = (fRec27[0] + 1.0f);
float fTemp6 = (0.0f - (0.5f * fTemp5));
fRec28[0] = (fSlow7 + (0.999000013f * fRec28[1]));
float fTemp7 = (((0.5f * (fRec22[0] * fTemp5)) + (fRec22[1] * fTemp6)) - (fRec28[0] * fRec20[1]));
fVec1[(IOTA & 131071)] = fTemp7;
fRec20[0] = fVec1[((IOTA - iConst2) & 131071)];
float fRec21 = (fRec28[0] * fTemp7);
float fTemp8 = ((fRec21 + fRec20[1]) - (fRec28[0] * fRec18[1]));
fVec2[(IOTA & 131071)] = fTemp8;
fRec18[0] = fVec2[((IOTA - iConst3) & 131071)];
float fRec19 = (fRec28[0] * fTemp8);
fRec29[0] = (fSlow8 + (0.999000013f * fRec29[1]));
float fTemp9 = ((fRec19 + fRec18[1]) - (fRec29[0] * fRec16[1]));
fVec3[(IOTA & 131071)] = fTemp9;
fRec16[0] = fVec3[((IOTA - iConst4) & 131071)];
float fRec17 = (fRec29[0] * fTemp9);
float fTemp10 = ((fRec17 + fRec16[1]) - (fRec29[0] * fRec14[1]));
fVec4[(IOTA & 131071)] = fTemp10;
fRec14[0] = fVec4[((IOTA - iConst5) & 131071)];
float fRec15 = (fRec29[0] * fTemp10);
fRec30[0] = (fSlow9 + (0.999000013f * fRec30[1]));
float fTemp11 = (fRec14[1] + ((fRec10[0] * fRec5[((IOTA - iConst6) & 131071)]) + (fRec15 + (fRec30[0] * fRec12[1]))));
fVec5[(IOTA & 131071)] = fTemp11;
fRec35[0] = (fSlow10 + (0.999000013f * fRec35[1]));
fRec38[0] = (fSlow11 + (0.999000013f * fRec38[1]));
float fTemp12 = (fRec37[1] + (fConst1 * fRec38[0]));
fRec37[0] = (fTemp12 - float(int(fTemp12)));
int iTemp13 = (int((fConst0 * ((fRec35[0] * ftbl0faustFverbSIG0[int((65536.0f * (fRec37[0] + (0.25f - float(int((fRec37[0] + 0.25f)))))))]) + 0.0305097271f))) + -1);
float fTemp14 = ((fRec31[1] != 0.0f) ? (((fRec32[1] > 0.0f) & (fRec32[1] < 1.0f)) ? fRec31[1] : 0.0f) : (((fRec32[1] == 0.0f) & (iTemp13 != iRec33[1])) ? fConst7 : (((fRec32[1] == 1.0f) & (iTemp13 != iRec34[1])) ? fConst8 : 0.0f)));
fRec31[0] = fTemp14;
fRec32[0] = std::max<float>(0.0f, std::min<float>(1.0f, (fRec32[1] + fTemp14)));
iRec33[0] = (((fRec32[1] >= 1.0f) & (iRec34[1] != iTemp13)) ? iTemp13 : iRec33[1]);
iRec34[0] = (((fRec32[1] <= 0.0f) & (iRec33[1] != iTemp13)) ? iTemp13 : iRec34[1]);
float fTemp15 = fVec5[((IOTA - std::min<int>(65536, std::max<int>(0, iRec33[0]))) & 131071)];
fRec12[0] = (fTemp15 + (fRec32[0] * (fVec5[((IOTA - std::min<int>(65536, std::max<int>(0, iRec34[0]))) & 131071)] - fTemp15)));
float fRec13 = (0.0f - (fRec30[0] * fTemp11));
float fTemp16 = (fRec13 + fRec12[1]);
fVec6[(IOTA & 131071)] = fTemp16;
fRec39[0] = (fSlow12 + (0.999000013f * fRec39[1]));
fRec11[0] = (fVec6[((IOTA - iConst9) & 131071)] + (fRec39[0] * fRec11[1]));
float fTemp17 = (1.0f - fRec39[0]);
float fTemp18 = ((fTemp2 * fRec8[1]) + ((fRec10[0] * fRec11[0]) * fTemp17));
fVec7[(IOTA & 131071)] = fTemp18;
fRec8[0] = fVec7[((IOTA - iConst10) & 131071)];
float fRec9 = (0.0f - (fTemp2 * fTemp18));
fRec2[(IOTA & 131071)] = (fRec9 + fRec8[1]);
fRec3[(IOTA & 131071)] = (fRec11[0] * fTemp17);
fRec4[(IOTA & 131071)] = fTemp16;
fVec8[(IOTA & 131071)] = (fTemp0 * fRec24[0]);
fRec54[0] = (fVec8[((IOTA - iTemp3) & 131071)] + (fRec26[0] * fRec54[1]));
fRec53[0] = ((fTemp4 * fRec54[0]) + (fRec27[0] * fRec53[1]));
float fTemp19 = (((0.5f * (fRec53[0] * fTemp5)) + (fTemp6 * fRec53[1])) - (fRec28[0] * fRec51[1]));
fVec9[(IOTA & 131071)] = fTemp19;
fRec51[0] = fVec9[((IOTA - iConst11) & 131071)];
float fRec52 = (fRec28[0] * fTemp19);
float fTemp20 = ((fRec52 + fRec51[1]) - (fRec28[0] * fRec49[1]));
fVec10[(IOTA & 131071)] = fTemp20;
fRec49[0] = fVec10[((IOTA - iConst12) & 131071)];
float fRec50 = (fRec28[0] * fTemp20);
float fTemp21 = ((fRec50 + fRec49[1]) - (fRec29[0] * fRec47[1]));
fVec11[(IOTA & 131071)] = fTemp21;
fRec47[0] = fVec11[((IOTA - iConst13) & 131071)];
float fRec48 = (fRec29[0] * fTemp21);
float fTemp22 = ((fRec48 + fRec47[1]) - (fRec29[0] * fRec45[1]));
fVec12[(IOTA & 131071)] = fTemp22;
fRec45[0] = fVec12[((IOTA - iConst14) & 131071)];
float fRec46 = (fRec29[0] * fTemp22);
float fTemp23 = (fRec45[1] + ((fRec10[0] * fRec2[((IOTA - iConst15) & 131071)]) + (fRec46 + (fRec30[0] * fRec43[1]))));
fVec13[(IOTA & 131071)] = fTemp23;
int iTemp24 = (int((fConst0 * ((fRec35[0] * ftbl0faustFverbSIG0[int((65536.0f * fRec37[0]))]) + 0.025603978f))) + -1);
float fTemp25 = ((fRec55[1] != 0.0f) ? (((fRec56[1] > 0.0f) & (fRec56[1] < 1.0f)) ? fRec55[1] : 0.0f) : (((fRec56[1] == 0.0f) & (iTemp24 != iRec57[1])) ? fConst7 : (((fRec56[1] == 1.0f) & (iTemp24 != iRec58[1])) ? fConst8 : 0.0f)));
fRec55[0] = fTemp25;
fRec56[0] = std::max<float>(0.0f, std::min<float>(1.0f, (fRec56[1] + fTemp25)));
iRec57[0] = (((fRec56[1] >= 1.0f) & (iRec58[1] != iTemp24)) ? iTemp24 : iRec57[1]);
iRec58[0] = (((fRec56[1] <= 0.0f) & (iRec57[1] != iTemp24)) ? iTemp24 : iRec58[1]);
float fTemp26 = fVec13[((IOTA - std::min<int>(65536, std::max<int>(0, iRec57[0]))) & 131071)];
fRec43[0] = (fTemp26 + (fRec56[0] * (fVec13[((IOTA - std::min<int>(65536, std::max<int>(0, iRec58[0]))) & 131071)] - fTemp26)));
float fRec44 = (0.0f - (fRec30[0] * fTemp23));
float fTemp27 = (fRec44 + fRec43[1]);
fVec14[(IOTA & 131071)] = fTemp27;
fRec42[0] = (fVec14[((IOTA - iConst16) & 131071)] + (fRec39[0] * fRec42[1]));
float fTemp28 = ((fTemp2 * fRec40[1]) + ((fRec10[0] * fTemp17) * fRec42[0]));
fVec15[(IOTA & 131071)] = fTemp28;
fRec40[0] = fVec15[((IOTA - iConst17) & 131071)];
float fRec41 = (0.0f - (fTemp2 * fTemp28));
fRec5[(IOTA & 131071)] = (fRec41 + fRec40[1]);
fRec6[(IOTA & 131071)] = (fTemp17 * fRec42[0]);
fRec7[(IOTA & 131071)] = fTemp27;
output0[i] = FAUSTFLOAT(((fTemp0 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec4[((IOTA - iConst18) & 131071)] + fRec4[((IOTA - iConst19) & 131071)]) + fRec2[((IOTA - iConst20) & 131071)]) - (((fRec3[((IOTA - iConst21) & 131071)] + fRec7[((IOTA - iConst22) & 131071)]) + fRec6[((IOTA - iConst23) & 131071)]) + fRec5[((IOTA - iConst24) & 131071)]))))));
output1[i] = FAUSTFLOAT(((fTemp1 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec7[((IOTA - iConst25) & 131071)] + fRec7[((IOTA - iConst26) & 131071)]) + fRec5[((IOTA - iConst27) & 131071)]) - (((fRec6[((IOTA - iConst28) & 131071)] + fRec4[((IOTA - iConst29) & 131071)]) + fRec3[((IOTA - iConst30) & 131071)]) + fRec2[((IOTA - iConst31) & 131071)]))))));
fRec0[1] = fRec0[0];
fRec1[1] = fRec1[0];
fRec10[1] = fRec10[0];
fRec24[1] = fRec24[0];
IOTA = (IOTA + 1);
fRec25[1] = fRec25[0];
fRec26[1] = fRec26[0];
fRec23[1] = fRec23[0];
fRec27[1] = fRec27[0];
fRec22[1] = fRec22[0];
fRec28[1] = fRec28[0];
fRec20[1] = fRec20[0];
fRec18[1] = fRec18[0];
fRec29[1] = fRec29[0];
fRec16[1] = fRec16[0];
fRec14[1] = fRec14[0];
fRec30[1] = fRec30[0];
fRec35[1] = fRec35[0];
fRec38[1] = fRec38[0];
fRec37[1] = fRec37[0];
fRec31[1] = fRec31[0];
fRec32[1] = fRec32[0];
iRec33[1] = iRec33[0];
iRec34[1] = iRec34[0];
fRec12[1] = fRec12[0];
fRec39[1] = fRec39[0];
fRec11[1] = fRec11[0];
fRec8[1] = fRec8[0];
fRec54[1] = fRec54[0];
fRec53[1] = fRec53[0];
fRec51[1] = fRec51[0];
fRec49[1] = fRec49[0];
fRec47[1] = fRec47[0];
fRec45[1] = fRec45[0];
fRec55[1] = fRec55[0];
fRec56[1] = fRec56[0];
iRec57[1] = iRec57[0];
iRec58[1] = iRec58[0];
fRec43[1] = fRec43[0];
fRec42[1] = fRec42[0];
fRec40[1] = fRec40[0];
}
//[End:compute]
}
FAUSTFLOAT getPredelay() const { return fHslider4; }
void setPredelay(FAUSTFLOAT value) { fHslider4 = value; }
FAUSTFLOAT getInputAmount() const { return fHslider3; }
void setInputAmount(FAUSTFLOAT value) { fHslider3 = value; }
FAUSTFLOAT getInputLowPassCutoff() const { return fHslider5; }
void setInputLowPassCutoff(FAUSTFLOAT value) { fHslider5 = value; }
FAUSTFLOAT getInputHighPassCutoff() const { return fHslider6; }
void setInputHighPassCutoff(FAUSTFLOAT value) { fHslider6 = value; }
FAUSTFLOAT getInputDiffusion1() const { return fHslider7; }
void setInputDiffusion1(FAUSTFLOAT value) { fHslider7 = value; }
FAUSTFLOAT getInputDiffusion2() const { return fHslider8; }
void setInputDiffusion2(FAUSTFLOAT value) { fHslider8 = value; }
FAUSTFLOAT getTailDensity() const { return fHslider9; }
void setTailDensity(FAUSTFLOAT value) { fHslider9 = value; }
FAUSTFLOAT getDecay() const { return fHslider2; }
void setDecay(FAUSTFLOAT value) { fHslider2 = value; }
FAUSTFLOAT getDamping() const { return fHslider12; }
void setDamping(FAUSTFLOAT value) { fHslider12 = value; }
FAUSTFLOAT getModulatorFrequency() const { return fHslider11; }
void setModulatorFrequency(FAUSTFLOAT value) { fHslider11 = value; }
FAUSTFLOAT getModulatorDepth() const { return fHslider10; }
void setModulatorDepth(FAUSTFLOAT value) { fHslider10 = value; }
FAUSTFLOAT getDry() const { return fHslider0; }
void setDry(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getWet() const { return fHslider1; }
void setWet(FAUSTFLOAT value) { fHslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,7 +1,11 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
name: "gate"
Code generated with Faust 2.27.2 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -scal -ftz 0
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustGate_H__
@ -9,101 +13,77 @@ Compilation options: -lang cpp -inpl -scal -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustGate
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustGate {
//[Begin:class]
public:
float fConst0;
private:
FAUSTFLOAT fHslider0;
FAUSTFLOAT fHslider1;
int fSampleRate;
float fConst0;
float fConst1;
float fConst2;
float fRec3[2];
FAUSTFLOAT fHslider2;
int iVec0[2];
float fConst3;
FAUSTFLOAT fHslider3;
int iRec4[2];
float fRec1[2];
float fRec0[2];
public:
void metadata() {
}
int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
int getNumOutputs() {
static constexpr 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)sample_rate;
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = float(_oversampling);
fConst1 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
fConst2 = (1.0f / fConst1);
fConst3 = (fConst1 * fConst0);
fConst0 = float(fSampleRate);
fConst1 = (1.0f / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(0.0f);
fHslider1 = FAUSTFLOAT(0.0f);
fHslider2 = FAUSTFLOAT(0.0f);
fHslider3 = FAUSTFLOAT(0.0f);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0f;
}
@ -119,44 +99,45 @@ class faustGate {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec0[l4] = 0.0f;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
faustGate* clone() {
return new faustGate();
}
int getSampleRate() {
return fSampleRate;
}
void buildUserInterface() {
}
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
float fSlow0 = (fConst0 * float(fHslider0));
float fSlow1 = (fConst0 * float(fHslider1));
float fSlow0 = float(fHslider0);
float fSlow1 = float(fHslider1);
float fSlow2 = std::min<float>(fSlow0, fSlow1);
int iSlow3 = (std::fabs(fSlow2) < 1.1920929e-07f);
float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow3 ? 1.0f : fSlow2)))));
float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow3 ? 1.0f : fSlow2)))));
float fSlow5 = (1.0f - fSlow4);
float fSlow6 = std::pow(10.0f, (0.0500000007f * float(fHslider2)));
int iSlow7 = int((fConst3 * float(fHslider3)));
int iSlow7 = int((fConst0 * float(fHslider3)));
int iSlow8 = (std::fabs(fSlow0) < 1.1920929e-07f);
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow8 ? 1.0f : fSlow0)))));
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow8 ? 1.0f : fSlow0)))));
int iSlow10 = (std::fabs(fSlow1) < 1.1920929e-07f);
float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow10 ? 1.0f : fSlow1)))));
float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow10 ? 1.0f : fSlow1)))));
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
fRec3[0] = ((fRec3[1] * fSlow4) + (std::fabs(fTemp0) * fSlow5));
@ -175,22 +156,30 @@ class faustGate {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getThreshold() const { return fHslider2; }
void setThreshold(FAUSTFLOAT value) { fHslider2 = value; }
FAUSTFLOAT getAttack() const { return fHslider0; }
void setAttack(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getHold() const { return fHslider3; }
void setHold(FAUSTFLOAT value) { fHslider3 = value; }
FAUSTFLOAT getRelease() const { return fHslider1; }
void setRelease(FAUSTFLOAT value) { fHslider1 = value; }
//[End:class]
};
//[After:class]
#ifdef FAUST_UIMACROS
#define FAUST_LIST_ACTIVES(p) \
p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider2, 0.0f, -60.0f, 0.0f, 0.01f) \
p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 10.0f, 0.001f) \
p(HORIZONTALSLIDER, Hold, "Hold", fHslider3, 0.0f, 0.0f, 10.0f, 0.001f) \
p(HORIZONTALSLIDER, Release, "Release", fHslider1, 0.0f, 0.0f, 5.0f, 0.001f) \
#define FAUST_LIST_PASSIVES(p) \
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,135 +0,0 @@
/* ------------------------------------------------------------
name: "limiter"
Code generated with Faust 2.20.2 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustLimiter_H__
#define __faustLimiter_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLimiter
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
class faustLimiter {
private:
int fSampleRate;
float fConst0;
float fConst1;
float fConst2;
float fConst3;
float fConst4;
float fConst5;
float fConst6;
float fRec2[2];
float fRec1[2];
float fRec0[2];
float fRec5[2];
float fRec4[2];
float fRec3[2];
public:
static void classInit(int sample_rate)
{
(void)sample_rate;
}
void instanceConstants(int sample_rate)
{
fSampleRate = sample_rate;
fConst0 = (std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate))) * float(_oversampling));
fConst1 = std::exp((0.0f - (2500.0f / fConst0)));
fConst2 = (1.0f - fConst1);
fConst3 = std::exp((0.0f - (1250.0f / fConst0)));
fConst4 = (1.0f - fConst3);
fConst5 = std::exp((0.0f - (2.0f / fConst0)));
fConst6 = (1.0f - fConst5);
}
void instanceResetUserInterface()
{
}
void instanceClear()
{
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0f;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec5[l3] = 0.0f;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0f;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec3[l5] = 0.0f;
}
}
void init(int sample_rate)
{
classInit(sample_rate);
instanceInit(sample_rate);
}
void instanceInit(int sample_rate)
{
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
int getSampleRate()
{
return fSampleRate;
}
void compute(int count, const FAUSTFLOAT* const* inputs, FAUSTFLOAT* const* outputs)
{
const FAUSTFLOAT* input0 = inputs[0];
const FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = float(input1[i]);
float fTemp2 = std::fabs(fTemp0);
fRec2[0] = std::max<float>(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2)));
fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0]));
fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f)));
output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0]));
float fTemp3 = std::fabs(fTemp1);
fRec5[0] = std::max<float>(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3)));
fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0]));
fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f)));
output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0]));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec5[1] = fRec5[0];
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
}
};
#endif

View file

@ -0,0 +1,171 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
name: "limiter"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
------------------------------------------------------------ */
#ifndef __faustLimiter_H__
#define __faustLimiter_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLimiter
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLimiter {
//[Begin:class]
private:
int fSampleRate;
float fConst0;
float fConst1;
float fConst2;
float fConst3;
float fConst4;
float fConst5;
float fConst6;
float fRec2[2];
float fRec1[2];
float fRec0[2];
float fRec5[2];
float fRec4[2];
float fRec3[2];
public:
static constexpr int getNumInputs() {
return 2;
}
static constexpr int getNumOutputs() {
return 2;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = float(fSampleRate);
fConst1 = std::exp((0.0f - (2500.0f / fConst0)));
fConst2 = (1.0f - fConst1);
fConst3 = std::exp((0.0f - (1250.0f / fConst0)));
fConst4 = (1.0f - fConst3);
fConst5 = std::exp((0.0f - (2.0f / fConst0)));
fConst6 = (1.0f - fConst5);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0f;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0f;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0f;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec5[l3] = 0.0f;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0f;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec3[l5] = 0.0f;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
for (int i = 0; (i < count); i = (i + 1)) {
float fTemp0 = float(input0[i]);
float fTemp1 = float(input1[i]);
float fTemp2 = std::fabs(fTemp0);
fRec2[0] = std::max<float>(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2)));
fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0]));
fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f)));
output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0]));
float fTemp3 = std::fabs(fTemp1);
fRec5[0] = std::max<float>(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3)));
fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0]));
fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f)));
output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0]));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec5[1] = fRec5[0];
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
//[End:compute]
}
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,161 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec1[2];
double fRec0[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faust2chApf1p* clone() {
return new faust2chApf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual 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 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,152 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faust2chApf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
double fRec2[2];
public:
static constexpr int getNumInputs() {
return 2;
}
static constexpr int getNumOutputs() {
return 2;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
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];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf1p_H__
@ -11,100 +15,73 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf1p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBpf1p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec2[2];
double fRec1[2];
double fRec0[2];
double fRec4[2];
double fRec3[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -120,40 +97,41 @@ class faust2chBpf1p : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBpf1p* clone() {
return new faust2chBpf1p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
double fTemp2 = (1.0 - fRec2[0]);
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
@ -169,8 +147,21 @@ class faust2chBpf1p : public sfzFilterDsp {
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf2p_H__
@ -11,34 +15,38 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fRec2[2];
double fVec0[2];
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec3[2];
double fRec4[2];
double fVec1[2];
@ -52,71 +60,40 @@ class faust2chBpf2p : public sfzFilterDsp {
double fVec5[2];
double fRec8[2];
double fRec7[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -162,38 +139,39 @@ class faust2chBpf2p : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec7[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBpf2p* clone() {
return new faust2chBpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -238,8 +216,24 @@ class faust2chBpf2p : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[1] = fRec7[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf2pSv_H__
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec3[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
double fRec7[2];
double fRec8[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
@ -130,38 +107,39 @@ class faust2chBpf2pSv : public sfzFilterDsp {
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBpf2pSv* clone() {
return new faust2chBpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
@ -194,8 +172,24 @@ class faust2chBpf2pSv : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec8[1] = fRec8[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf4p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fRec5[2];
double fVec0[2];
@ -62,71 +70,40 @@ class faust2chBpf4p : public sfzFilterDsp {
double fVec11[2];
double fRec10[2];
double fRec9[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -202,38 +179,39 @@ class faust2chBpf4p : public sfzFilterDsp {
for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) {
fRec9[l24] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBpf4p* clone() {
return new faust2chBpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -298,8 +276,24 @@ class faust2chBpf4p : public sfzFilterDsp {
fRec10[1] = fRec10[0];
fRec9[1] = fRec9[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf6p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fRec7[2];
double fVec0[2];
@ -72,71 +80,40 @@ class faust2chBpf6p : public sfzFilterDsp {
double fVec17[2];
double fRec12[2];
double fRec11[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -242,38 +219,39 @@ class faust2chBpf6p : public sfzFilterDsp {
for (int l34 = 0; (l34 < 2); l34 = (l34 + 1)) {
fRec11[l34] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBpf6p* clone() {
return new faust2chBpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -358,8 +336,24 @@ class faust2chBpf6p : public sfzFilterDsp {
fRec12[1] = fRec12[0];
fRec11[1] = fRec11[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf1p_H__
@ -11,100 +15,73 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf1p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBrf1p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec2[2];
double fRec1[2];
double fRec0[2];
double fRec4[2];
double fRec3[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -120,40 +97,41 @@ class faust2chBrf1p : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBrf1p* clone() {
return new faust2chBrf1p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
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]))));
@ -166,8 +144,21 @@ class faust2chBrf1p : public sfzFilterDsp {
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf2p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBrf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -50,71 +58,40 @@ class faust2chBrf2p : public sfzFilterDsp {
double fVec5[2];
double fRec6[2];
double fRec5[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -154,37 +131,38 @@ class faust2chBrf2p : public sfzFilterDsp {
for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) {
fRec5[l12] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBrf2p* clone() {
return new faust2chBrf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (1.0 - fSlow0);
double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4);
@ -224,8 +202,24 @@ class faust2chBrf2p : public sfzFilterDsp {
fRec6[1] = fRec6[0];
fRec5[1] = fRec5[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf2pSv_H__
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chBrf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec5[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec6[2];
double fRec2[2];
double fRec3[2];
double fRec9[2];
double fRec10[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec5[l0] = 0.0;
}
@ -130,38 +107,39 @@ class faust2chBrf2pSv : public sfzFilterDsp {
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec10[l6] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chBrf2pSv* clone() {
return new faust2chBrf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
@ -196,8 +174,24 @@ class faust2chBrf2pSv : public sfzFilterDsp {
fRec9[1] = fRec9[0];
fRec10[1] = fRec10[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chEqHshelf_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
@ -21,26 +25,30 @@ static double faust2chEqHshelf_faustpower2_f(double value) {
return (value * value);
}
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chEqHshelf
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chEqHshelf : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -56,72 +64,41 @@ class faust2chEqHshelf : public sfzFilterDsp {
double fVec5[2];
double fRec8[2];
double fRec7[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -167,44 +144,45 @@ class faust2chEqHshelf : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec7[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chEqHshelf* clone() {
return new faust2chEqHshelf();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = (faust2chEqHshelf_faustpower2_f(fSlow1) + 1.0);
double fSlow6 = (fSlow1 + -1.0);
double fSlow7 = faust2chEqHshelf_faustpower2_f(fSlow6);
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
double fSlow9 = (fSlow3 * fSlow6);
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
double fSlow9 = (fSlow6 * fSlow3);
double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9));
double fSlow11 = (1.0 - fSlow0);
double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11);
@ -249,8 +227,27 @@ class faust2chEqHshelf : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[1] = fRec7[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chEqLshelf_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
@ -21,26 +25,30 @@ static double faust2chEqLshelf_faustpower2_f(double value) {
return (value * value);
}
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chEqLshelf
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chEqLshelf : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -56,72 +64,41 @@ class faust2chEqLshelf : public sfzFilterDsp {
double fVec5[2];
double fRec8[2];
double fRec7[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -167,44 +144,45 @@ class faust2chEqLshelf : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec7[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chEqLshelf* clone() {
return new faust2chEqLshelf();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = (fSlow1 + -1.0);
double fSlow6 = (fSlow3 * fSlow5);
double fSlow6 = (fSlow5 * fSlow3);
double fSlow7 = (faust2chEqLshelf_faustpower2_f(fSlow1) + 1.0);
double fSlow8 = faust2chEqLshelf_faustpower2_f(fSlow5);
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
double fSlow10 = (fSlow6 + fSlow9);
double fSlow11 = ((fSlow1 + fSlow10) + 1.0);
double fSlow12 = (1.0 - fSlow0);
@ -249,8 +227,27 @@ class faust2chEqLshelf : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[1] = fRec7[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chEqPeak_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
/* link with : "" */
#include <algorithm>
@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chEqPeak
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chEqPeak : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst3;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -54,73 +62,42 @@ class faust2chEqPeak : public sfzFilterDsp {
double fVec5[2];
double fRec7[2];
double fRec6[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
fConst3 = (2.1775860903036022 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
fPkShGain = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -163,45 +140,46 @@ class faust2chEqPeak : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec6[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chEqPeak* clone() {
return new faust2chEqPeak();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::max<double>(0.0, double(fCutoff));
double fSlow1 = std::max<double>(0.0, double(fHslider0));
double fSlow2 = (fConst2 * fSlow1);
double fSlow3 = std::sin(fSlow2);
double fSlow4 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3)))))));
double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow5 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3)))))));
double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5)));
double fSlow7 = (fSlow6 + 1.0);
double fSlow8 = (1.0 - fSlow0);
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8);
double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4));
double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5));
double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8);
double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8);
double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8);
@ -239,8 +217,27 @@ class faust2chEqPeak : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[1] = fRec6[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf1p_H__
@ -11,98 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf1p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHpf1p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
@ -112,40 +89,41 @@ class faust2chHpf1p : public sfzFilterDsp {
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec2[l2] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHpf1p* clone() {
return new faust2chHpf1p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
double fTemp2 = (fRec1[0] + 1.0);
double fTemp3 = (0.0 - (0.5 * fTemp2));
@ -156,8 +134,21 @@ class faust2chHpf1p : public sfzFilterDsp {
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf2p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -51,71 +59,40 @@ class faust2chHpf2p : public sfzFilterDsp {
double fVec5[2];
double fRec7[2];
double fRec6[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -158,38 +135,39 @@ class faust2chHpf2p : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec6[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHpf2p* clone() {
return new faust2chHpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -232,8 +210,24 @@ class faust2chHpf2p : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[1] = fRec6[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf2pSv_H__
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec4[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec3[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
double fRec7[2];
double fRec8[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec4[l0] = 0.0;
}
@ -130,38 +107,39 @@ class faust2chHpf2pSv : public sfzFilterDsp {
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHpf2pSv* clone() {
return new faust2chHpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
@ -194,8 +172,24 @@ class faust2chHpf2pSv : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec8[1] = fRec8[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf4p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec5[2];
@ -61,71 +69,40 @@ class faust2chHpf4p : public sfzFilterDsp {
double fVec11[2];
double fRec9[2];
double fRec8[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -198,38 +175,39 @@ class faust2chHpf4p : public sfzFilterDsp {
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
fRec8[l23] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHpf4p* clone() {
return new faust2chHpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -294,8 +272,24 @@ class faust2chHpf4p : public sfzFilterDsp {
fRec9[1] = fRec9[0];
fRec8[1] = fRec8[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf6p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec7[2];
@ -71,71 +79,40 @@ class faust2chHpf6p : public sfzFilterDsp {
double fVec17[2];
double fRec11[2];
double fRec10[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -238,38 +215,39 @@ class faust2chHpf6p : public sfzFilterDsp {
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
fRec10[l33] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHpf6p* clone() {
return new faust2chHpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -356,8 +334,24 @@ class faust2chHpf6p : public sfzFilterDsp {
fRec11[1] = fRec11[0];
fRec10[1] = fRec10[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHsh_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHsh
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chHsh : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -53,72 +61,41 @@ class faust2chHsh : public sfzFilterDsp {
double fVec5[2];
double fRec8[2];
double fRec7[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -164,48 +141,49 @@ class faust2chHsh : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec7[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chHsh* clone() {
return new faust2chHsh();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
double fSlow8 = (1.0 - fSlow0);
double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
double fSlow10 = (fSlow1 + fSlow6);
double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
double fSlow10 = (fSlow6 + fSlow5);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8);
double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8);
double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
@ -243,8 +221,27 @@ class faust2chHsh : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[1] = fRec7[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider1; }
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,162 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec1[2];
double fRec0[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faust2chLpf1p* clone() {
return new faust2chLpf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual 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 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,153 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faust2chLpf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
double fRec2[2];
public:
static constexpr int getNumInputs() {
return 2;
}
static constexpr int getNumOutputs() {
return 2;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
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];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf2p_H__
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chLpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
@ -51,71 +59,40 @@ class faust2chLpf2p : public sfzFilterDsp {
double fVec5[2];
double fRec7[2];
double fRec6[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -158,37 +135,38 @@ class faust2chLpf2p : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec6[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chLpf2p* clone() {
return new faust2chLpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -233,8 +211,24 @@ class faust2chLpf2p : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[1] = fRec6[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf2pSv_H__
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chLpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec3[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
double fRec7[2];
double fRec8[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
@ -130,38 +107,39 @@ class faust2chLpf2pSv : public sfzFilterDsp {
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chLpf2pSv* clone() {
return new faust2chLpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
@ -194,8 +172,24 @@ class faust2chLpf2pSv : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec8[1] = fRec8[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf4p_H__
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chLpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
@ -61,71 +69,40 @@ class faust2chLpf4p : public sfzFilterDsp {
double fVec11[2];
double fRec9[2];
double fRec8[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -198,37 +175,38 @@ class faust2chLpf4p : public sfzFilterDsp {
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
fRec8[l23] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chLpf4p* clone() {
return new faust2chLpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -295,8 +273,24 @@ class faust2chLpf4p : public sfzFilterDsp {
fRec9[1] = fRec9[0];
fRec8[1] = fRec8[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf6p_H__
@ -11,37 +15,41 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chLpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
double fRec7[2];
double fVec1[2];
double fVec0[2];
double fRec8[2];
double fVec1[2];
double fVec2[2];
double fRec9[2];
double fRec6[2];
@ -71,85 +79,54 @@ class faust2chLpf6p : public sfzFilterDsp {
double fVec17[2];
double fRec11[2];
double fRec10[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fVec0[l1] = 0.0;
fRec7[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec7[l2] = 0.0;
fVec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fVec1[l3] = 0.0;
fRec8[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec8[l4] = 0.0;
fVec1[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fVec2[l5] = 0.0;
@ -238,37 +215,38 @@ class faust2chLpf6p : public sfzFilterDsp {
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
fRec10[l33] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chLpf6p* clone() {
return new faust2chLpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -281,14 +259,14 @@ class faust2chLpf6p : public sfzFilterDsp {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec2[0] = (fSlow7 + (fSlow5 * fRec2[1]));
fVec0[0] = (fTemp0 * fRec2[0]);
fRec7[0] = ((fSlow5 * fRec7[1]) + fSlow8);
double fTemp2 = (fTemp0 * fRec7[0]);
fVec1[0] = fTemp2;
fVec0[0] = fTemp2;
fRec8[0] = ((fSlow5 * fRec8[1]) + fSlow9);
fVec2[0] = (fVec1[1] - (fRec8[0] * fRec5[1]));
fVec1[0] = (fVec0[1] - (fRec8[0] * fRec5[1]));
fVec2[0] = (fTemp0 * fRec2[0]);
fRec9[0] = ((fSlow5 * fRec9[1]) + fSlow10);
fRec6[0] = ((fVec0[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1]));
fRec6[0] = ((fVec1[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1]));
fRec5[0] = fRec6[0];
fVec3[0] = (fRec2[0] * fRec5[0]);
double fTemp3 = (fRec7[0] * fRec5[0]);
@ -323,10 +301,10 @@ class faust2chLpf6p : public sfzFilterDsp {
fRec10[0] = fRec11[0];
output1[i] = FAUSTFLOAT(fRec10[0]);
fRec2[1] = fRec2[0];
fVec0[1] = fVec0[0];
fRec7[1] = fRec7[0];
fVec1[1] = fVec1[0];
fVec0[1] = fVec0[0];
fRec8[1] = fRec8[0];
fVec1[1] = fVec1[0];
fVec2[1] = fVec2[0];
fRec9[1] = fRec9[0];
fRec6[1] = fRec6[0];
@ -357,8 +335,24 @@ class faust2chLpf6p : public sfzFilterDsp {
fRec11[1] = fRec11[0];
fRec10[1] = fRec10[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLsh_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLsh
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chLsh : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -53,72 +61,41 @@ class faust2chLsh : public sfzFilterDsp {
double fVec5[2];
double fRec8[2];
double fRec7[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -164,48 +141,49 @@ class faust2chLsh : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec7[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chLsh* clone() {
return new faust2chLsh();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
double fSlow7 = (fSlow1 + fSlow6);
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
double fSlow7 = (fSlow5 + fSlow6);
double fSlow8 = ((fSlow1 + fSlow7) + 1.0);
double fSlow9 = (1.0 - fSlow0);
double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9);
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9);
double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9);
double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
@ -243,8 +221,27 @@ class faust2chLsh : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[1] = fRec7[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider1; }
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chPeq_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chPeq
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chPeq : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -52,72 +60,41 @@ class faust2chPeq : public sfzFilterDsp {
double fVec5[2];
double fRec7[2];
double fRec6[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
fPkShGain = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -160,44 +137,45 @@ class faust2chPeq : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec6[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chPeq* clone() {
return new faust2chPeq();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1)));
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
double fSlow6 = (fSlow5 + 1.0);
double fSlow7 = (1.0 - fSlow0);
double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7);
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3));
double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7);
double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7);
double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7);
@ -235,8 +213,27 @@ class faust2chPeq : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[1] = fRec6[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider1; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chPink_H__
@ -11,120 +15,94 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chPink
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faust2chPink : public sfzFilterDsp {
//[Begin:class]
public:
private:
double fRec0[4];
double fRec1[4];
int fSampleRate;
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
case 1: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faust2chPink* clone() {
return new faust2chPink();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* input1 = inputs[1];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT const* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
for (int i = 0; (i < count); i = (i + 1)) {
@ -141,8 +119,18 @@ class faust2chPink : public sfzFilterDsp {
fRec1[j1] = fRec1[(j1 - 1)];
}
}
//[End:compute]
}
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,143 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faustApf1p* clone() {
return new faustApf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,142 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faustApf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,150 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec2[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faustBpf1p* clone() {
return new faustBpf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,149 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faustBpf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec2[2];
double fRec1[2];
double fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
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];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf2p_H__
@ -11,34 +15,38 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fRec2[2];
double fVec0[2];
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec3[2];
double fRec4[2];
double fVec1[2];
@ -47,63 +55,40 @@ class faustBpf2p : public sfzFilterDsp {
double fRec6[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -134,36 +119,37 @@ class faustBpf2p : public sfzFilterDsp {
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec0[l9] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBpf2p* clone() {
return new faustBpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -196,8 +182,24 @@ class faustBpf2p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf2pSv_H__
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec3[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
@ -114,36 +99,37 @@ class faustBpf2pSv : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBpf2pSv* clone() {
return new faustBpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
@ -164,8 +150,24 @@ class faustBpf2pSv : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf4p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fRec5[2];
double fVec0[2];
@ -52,63 +60,40 @@ class faustBpf4p : public sfzFilterDsp {
double fVec5[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -154,36 +139,37 @@ class faustBpf4p : public sfzFilterDsp {
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
fRec0[l14] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBpf4p* clone() {
return new faustBpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -226,8 +212,24 @@ class faustBpf4p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf6p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fRec7[2];
double fVec0[2];
@ -57,63 +65,40 @@ class faustBpf6p : public sfzFilterDsp {
double fVec8[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -174,36 +159,37 @@ class faustBpf6p : public sfzFilterDsp {
for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) {
fRec0[l19] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBpf6p* clone() {
return new faustBpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
@ -256,8 +242,24 @@ class faustBpf6p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,149 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec2[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faustBrf1p* clone() {
return new faustBrf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,148 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faustBrf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec2[2];
double fRec1[2];
double fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
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];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBrf2p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBrf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBrf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -45,63 +53,40 @@ class faustBrf2p : public sfzFilterDsp {
double fVec2[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -126,35 +111,36 @@ class faustBrf2p : public sfzFilterDsp {
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
fRec0[l7] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBrf2p* clone() {
return new faustBrf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (1.0 - fSlow0);
double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4);
@ -181,8 +167,24 @@ class faustBrf2p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBrf2pSv_H__
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBrf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustBrf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec5[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec6[2];
double fRec2[2];
double fRec3[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec5[l0] = 0.0;
}
@ -114,36 +99,37 @@ class faustBrf2pSv : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustBrf2pSv* clone() {
return new faustBrf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2);
@ -165,8 +151,24 @@ class faustBrf2pSv : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec3[1] = fRec3[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustEqHshelf_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
@ -21,26 +25,30 @@ static double faustEqHshelf_faustpower2_f(double value) {
return (value * value);
}
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustEqHshelf
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustEqHshelf : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -51,64 +59,41 @@ class faustEqHshelf : public sfzFilterDsp {
double fRec6[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -139,42 +124,43 @@ class faustEqHshelf : public sfzFilterDsp {
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec0[l9] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustEqHshelf* clone() {
return new faustEqHshelf();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = (faustEqHshelf_faustpower2_f(fSlow1) + 1.0);
double fSlow6 = (fSlow1 + -1.0);
double fSlow7 = faustEqHshelf_faustpower2_f(fSlow6);
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
double fSlow9 = (fSlow3 * fSlow6);
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
double fSlow9 = (fSlow6 * fSlow3);
double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9));
double fSlow11 = (1.0 - fSlow0);
double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11);
@ -207,8 +193,27 @@ class faustEqHshelf : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustEqLshelf_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
@ -21,26 +25,30 @@ static double faustEqLshelf_faustpower2_f(double value) {
return (value * value);
}
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustEqLshelf
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustEqLshelf : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -51,64 +59,41 @@ class faustEqLshelf : public sfzFilterDsp {
double fRec6[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -139,42 +124,43 @@ class faustEqLshelf : public sfzFilterDsp {
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec0[l9] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustEqLshelf* clone() {
return new faustEqLshelf();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = (fSlow1 + -1.0);
double fSlow6 = (fSlow3 * fSlow5);
double fSlow6 = (fSlow5 * fSlow3);
double fSlow7 = (faustEqLshelf_faustpower2_f(fSlow1) + 1.0);
double fSlow8 = faustEqLshelf_faustpower2_f(fSlow5);
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
double fSlow10 = (fSlow6 + fSlow9);
double fSlow11 = ((fSlow1 + fSlow10) + 1.0);
double fSlow12 = (1.0 - fSlow0);
@ -207,8 +193,27 @@ class faustEqLshelf : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustEqPeak_H__
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
/* link with : "" */
#include <algorithm>
@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustEqPeak
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustEqPeak : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst3;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -49,65 +57,42 @@ class faustEqPeak : public sfzFilterDsp {
double fVec2[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
fConst3 = (2.1775860903036022 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
fPkShGain = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
fVslider1 = FAUSTFLOAT(1.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -135,43 +120,44 @@ class faustEqPeak : public sfzFilterDsp {
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec0[l8] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustEqPeak* clone() {
return new faustEqPeak();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::max<double>(0.0, double(fCutoff));
double fSlow1 = std::max<double>(0.0, double(fHslider0));
double fSlow2 = (fConst2 * fSlow1);
double fSlow3 = std::sin(fSlow2);
double fSlow4 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3)))))));
double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow5 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3)))))));
double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5)));
double fSlow7 = (fSlow6 + 1.0);
double fSlow8 = (1.0 - fSlow0);
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8);
double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4));
double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5));
double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8);
double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8);
double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8);
@ -197,8 +183,27 @@ class faustEqPeak : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getBandwidth() const { return fVslider1; }
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,144 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faustHpf1p* clone() {
return new faustHpf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,143 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faustHpf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
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];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf2p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustHpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -46,63 +54,40 @@ class faustHpf2p : public sfzFilterDsp {
double fRec5[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -130,36 +115,37 @@ class faustHpf2p : public sfzFilterDsp {
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec0[l8] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustHpf2p* clone() {
return new faustHpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -189,8 +175,24 @@ class faustHpf2p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf2pSv_H__
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustHpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec4[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec3[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec4[l0] = 0.0;
}
@ -114,36 +99,37 @@ class faustHpf2pSv : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustHpf2pSv* clone() {
return new faustHpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2);
@ -164,8 +150,24 @@ class faustHpf2pSv : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf4p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustHpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec5[2];
@ -51,63 +59,40 @@ class faustHpf4p : public sfzFilterDsp {
double fVec5[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -150,36 +135,37 @@ class faustHpf4p : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec0[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustHpf4p* clone() {
return new faustHpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -220,8 +206,24 @@ class faustHpf4p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf6p_H__
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustHpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fRec2[2];
double fVec0[2];
double fRec7[2];
@ -56,63 +64,40 @@ class faustHpf6p : public sfzFilterDsp {
double fVec8[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -170,36 +155,37 @@ class faustHpf6p : public sfzFilterDsp {
for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
fRec0[l18] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustHpf6p* clone() {
return new faustHpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (1.0 - fSlow0);
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
@ -251,8 +237,24 @@ class faustHpf6p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHsh_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHsh
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustHsh : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -48,64 +56,41 @@ class faustHsh : public sfzFilterDsp {
double fRec6[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -136,46 +121,47 @@ class faustHsh : public sfzFilterDsp {
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec0[l9] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustHsh* clone() {
return new faustHsh();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
double fSlow8 = (1.0 - fSlow0);
double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
double fSlow10 = (fSlow1 + fSlow6);
double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
double fSlow10 = (fSlow6 + fSlow5);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8);
double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8);
double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
@ -201,8 +187,27 @@ class faustHsh : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider1; }
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,143 +0,0 @@
/* ------------------------------------------------------------
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 sfzFilterDsp {
public:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (1.0 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual 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;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual faustLpf1p* clone() {
return new faustLpf1p();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow1 + (fSlow0 * 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

View file

@ -0,0 +1,142 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
author: "Jean Pierre Cimalando"
license: "BSD-2-Clause"
name: "sfz_filters"
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -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
//[Before:class]
class faustLpf1p : public sfzFilterDsp {
//[Begin:class]
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fHslider0;
double fRec1[2];
double fRec0[2];
public:
static constexpr int getNumInputs() {
return 1;
}
static constexpr int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
//[Begin:classInit]
//[End:classInit]
}
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 / fConst0);
//[End:instanceConstants]
}
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
//[End:instanceResetUserInterface]
}
void instanceClear() {
//[Begin: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;
}
//[End:instanceClear]
}
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
int getSampleRate() {
return fSampleRate;
}
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf2p_H__
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf2p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLpf2p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
@ -46,63 +54,40 @@ class faustLpf2p : public sfzFilterDsp {
double fRec5[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -130,35 +115,36 @@ class faustLpf2p : public sfzFilterDsp {
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec0[l8] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustLpf2p* clone() {
return new faustLpf2p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -190,8 +176,24 @@ class faustLpf2p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf2pSv_H__
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf2pSv
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLpf2pSv : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fHslider0;
double fRec3[2];
FAUSTFLOAT fQ;
FAUSTFLOAT fVslider0;
double fRec4[2];
double fRec5[2];
double fRec1[2];
double fRec2[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (3.1415926535897931 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
@ -114,36 +99,37 @@ class faustLpf2pSv : public sfzFilterDsp {
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustLpf2pSv* clone() {
return new faustLpf2pSv();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (1.0 - fSlow0);
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
@ -164,8 +150,24 @@ class faustLpf2pSv : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf4p_H__
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf4p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLpf4p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
@ -51,63 +59,40 @@ class faustLpf4p : public sfzFilterDsp {
double fVec5[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -150,35 +135,36 @@ class faustLpf4p : public sfzFilterDsp {
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
fRec0[l13] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustLpf4p* clone() {
return new faustLpf4p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -221,8 +207,24 @@ class faustLpf4p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf6p_H__
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf6p
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLpf6p : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
double fConst2;
double fRec2[2];
double fVec0[2];
@ -56,63 +64,40 @@ class faustLpf6p : public sfzFilterDsp {
double fVec8[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -170,35 +155,36 @@ class faustLpf6p : public sfzFilterDsp {
for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
fRec0[l18] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustLpf6p* clone() {
return new faustLpf6p();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
@ -252,8 +238,24 @@ class faustLpf6p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLsh_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLsh
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustLsh : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fVslider0;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -48,64 +56,41 @@ class faustLsh : public sfzFilterDsp {
double fRec6[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fVslider0 = FAUSTFLOAT(0.0);
fHslider0 = FAUSTFLOAT(440.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -136,46 +121,47 @@ class faustLsh : public sfzFilterDsp {
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
fRec0[l9] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustLsh* clone() {
return new faustLsh();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow3 = std::cos(fSlow2);
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
double fSlow7 = (fSlow1 + fSlow6);
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
double fSlow7 = (fSlow5 + fSlow6);
double fSlow8 = ((fSlow1 + fSlow7) + 1.0);
double fSlow9 = (1.0 - fSlow0);
double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9);
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9);
double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9);
double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
@ -201,8 +187,27 @@ class faustLsh : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider1; }
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustPeq_H__
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#include <math.h>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustPeq
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustPeq : public sfzFilterDsp {
//[Begin:class]
public:
private:
int fSampleRate;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fPkShGain;
FAUSTFLOAT fHslider0;
FAUSTFLOAT fVslider0;
FAUSTFLOAT fVslider1;
double fRec2[2];
double fVec0[2];
double fRec3[2];
@ -47,64 +55,41 @@ class faustPeq : public sfzFilterDsp {
double fVec2[2];
double fRec1[2];
double fRec0[2];
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst0 = double(fSampleRate);
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (6.2831853071795862 / fConst0);
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
fPkShGain = FAUSTFLOAT(0.0);
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
fHslider0 = FAUSTFLOAT(440.0);
fVslider0 = FAUSTFLOAT(0.0);
fVslider1 = FAUSTFLOAT(0.0);
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
@ -132,42 +117,43 @@ class faustPeq : public sfzFilterDsp {
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
fRec0[l8] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustPeq* clone() {
return new faustPeq();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1)));
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
double fSlow6 = (fSlow5 + 1.0);
double fSlow7 = (1.0 - fSlow0);
double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7);
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3));
double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7);
double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7);
double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7);
@ -193,8 +179,27 @@ class faustPeq : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
//[End:compute]
}
FAUSTFLOAT getCutoff() const { return fHslider0; }
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
FAUSTFLOAT getResonance() const { return fVslider0; }
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
FAUSTFLOAT getPeakShelfGain() const { return fVslider1; }
void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; }
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS

View file

@ -1,9 +1,13 @@
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
/* ------------------------------------------------------------
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
Code generated with Faust 2.30.5 (https://faust.grame.fr)
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustPink_H__
@ -11,107 +15,89 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#endif
#include <algorithm>
#include <cmath>
#ifndef FAUSTCLASS
#ifndef FAUSTCLASS
#define FAUSTCLASS faustPink
#endif
#ifdef __APPLE__
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
//[Before:class]
class faustPink : public sfzFilterDsp {
//[Begin:class]
public:
private:
double fRec0[4];
int fSampleRate;
public:
void metadata(Meta* m) {
}
virtual int getNumInputs() {
static constexpr int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
static constexpr int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
case 0: {
rate = 1;
break;
}
default: {
rate = -1;
break;
}
}
return rate;
}
virtual 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) {
//[Begin:classInit]
//[End:classInit]
}
virtual void instanceConstants(int sample_rate) {
void instanceConstants(int sample_rate) {
//[Begin:instanceConstants]
fSampleRate = sample_rate;
//[End:instanceConstants]
}
virtual void instanceResetUserInterface() {
void instanceResetUserInterface() {
//[Begin:instanceResetUserInterface]
//[End:instanceResetUserInterface]
}
virtual void instanceClear() {
void instanceClear() {
//[Begin:instanceClear]
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
//[End:instanceClear]
}
virtual void init(int sample_rate) {
void init(int sample_rate) {
//[Begin:init]
classInit(sample_rate);
instanceInit(sample_rate);
//[End:init]
}
virtual void instanceInit(int sample_rate) {
void instanceInit(int sample_rate) {
//[Begin:instanceInit]
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
//[End:instanceInit]
}
virtual faustPink* clone() {
return new faustPink();
}
virtual int getSampleRate() {
int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
//[Begin:compute]
FAUSTFLOAT const* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
@ -121,8 +107,18 @@ class faustPink : public sfzFilterDsp {
fRec0[j0] = fRec0[(j0 - 1)];
}
}
//[End:compute]
}
//[End:class]
};
//[After:class]
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#undef FAUSTFLOAT
#undef FAUSTCLASS