Compare commits
2 Commits
35a1bc5866
...
9474b4481e
Author | SHA1 | Date |
---|---|---|
Christopher Arndt | 9474b4481e | |
Christopher Arndt | b37954a27b |
|
@ -3,14 +3,14 @@
|
||||||
// This file was generated using the Faust compiler (https://faust.grame.fr),
|
// This file was generated using the Faust compiler (https://faust.grame.fr),
|
||||||
// and the Faust post-processor (https://github.com/SpotlightKid/faustpp).
|
// and the Faust post-processor (https://github.com/SpotlightKid/faustpp).
|
||||||
//
|
//
|
||||||
// Source: lpf.dsp
|
// Source: faustlpf.dsp
|
||||||
// Name: FaustLPF
|
// Name: FaustLPF
|
||||||
// Author: Christopher Arndt
|
// Author: Christopher Arndt
|
||||||
// Copyright: Christopher Arndt, 2024
|
// Copyright: Christopher Arndt, 2024
|
||||||
// License: MIT
|
// License: MIT
|
||||||
// Version: 0.1.0
|
// Version: 0.1.0
|
||||||
// FAUST version: 2.75.10
|
// FAUST version: 2.75.10
|
||||||
// FAUST compilation options: -a /home/chris/tmp/tmp9v2ck7tz.c -lang c -rui -ct 1 -fm def -cn faustlpf -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0 -vec -lv 0 -vs 32
|
// FAUST compilation options: -a /home/chris/tmp/tmpebxwoqng.c -lang c -rui -ct 1 -fm def -cn faustlpf -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0 -vec -lv 0 -vs 32
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,9 +79,9 @@ void deletefaustlpf(faustlpf* dsp) {
|
||||||
|
|
||||||
void metadatafaustlpf(MetaGlue* m) {
|
void metadatafaustlpf(MetaGlue* m) {
|
||||||
m->declare(m->metaInterface, "author", "Christopher Arndt");
|
m->declare(m->metaInterface, "author", "Christopher Arndt");
|
||||||
m->declare(m->metaInterface, "compile_options", "-a /home/chris/tmp/tmp9v2ck7tz.c -lang c -rui -ct 1 -fm def -cn faustlpf -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0 -vec -lv 0 -vs 32");
|
m->declare(m->metaInterface, "compile_options", "-a /home/chris/tmp/tmpebxwoqng.c -lang c -rui -ct 1 -fm def -cn faustlpf -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0 -vec -lv 0 -vs 32");
|
||||||
m->declare(m->metaInterface, "copyright", "Christopher Arndt, 2024");
|
m->declare(m->metaInterface, "copyright", "Christopher Arndt, 2024");
|
||||||
m->declare(m->metaInterface, "filename", "lpf.dsp");
|
m->declare(m->metaInterface, "filename", "faustlpf.dsp");
|
||||||
m->declare(m->metaInterface, "filters.lib/fir:author", "Julius O. Smith III");
|
m->declare(m->metaInterface, "filters.lib/fir:author", "Julius O. Smith III");
|
||||||
m->declare(m->metaInterface, "filters.lib/fir:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
|
m->declare(m->metaInterface, "filters.lib/fir:copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
|
||||||
m->declare(m->metaInterface, "filters.lib/fir:license", "MIT-style STK-4.3 license");
|
m->declare(m->metaInterface, "filters.lib/fir:license", "MIT-style STK-4.3 license");
|
||||||
|
|
|
@ -47,6 +47,11 @@ void initfaustlpf(faustlpf* dsp, int sample_rate);
|
||||||
void buildUserInterfacefaustlpf(faustlpf* dsp, UIGlue* ui_interface);
|
void buildUserInterfacefaustlpf(faustlpf* dsp, UIGlue* ui_interface);
|
||||||
void computefaustlpf(faustlpf* dsp, int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs);
|
void computefaustlpf(faustlpf* dsp, int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
FAUSTFLOAT init;
|
||||||
|
FAUSTFLOAT min;
|
||||||
|
FAUSTFLOAT max;
|
||||||
|
} ParameterRange;
|
||||||
|
|
||||||
int parameter_group(unsigned index) {
|
int parameter_group(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
@ -106,20 +111,31 @@ const char *parameter_symbol(unsigned index) {
|
||||||
|
|
||||||
const char *parameter_unit(unsigned index) {
|
const char *parameter_unit(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
return "Hz";
|
return "Hz";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ParameterRange *parameter_range(unsigned index) {
|
||||||
|
switch (index) {
|
||||||
|
|
||||||
|
case 0: {
|
||||||
|
static const ParameterRange range = { 15000.0, 16.0, 15000.0 };
|
||||||
|
return ⦥
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool parameter_is_trigger(unsigned index) {
|
bool parameter_is_trigger(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +143,7 @@ bool parameter_is_trigger(unsigned index) {
|
||||||
|
|
||||||
bool parameter_is_boolean(unsigned index) {
|
bool parameter_is_boolean(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +151,7 @@ bool parameter_is_boolean(unsigned index) {
|
||||||
|
|
||||||
bool parameter_is_enum(unsigned index) {
|
bool parameter_is_enum(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +159,7 @@ bool parameter_is_enum(unsigned index) {
|
||||||
|
|
||||||
bool parameter_is_integer(unsigned index) {
|
bool parameter_is_integer(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -151,34 +167,34 @@ bool parameter_is_integer(unsigned index) {
|
||||||
|
|
||||||
bool parameter_is_logarithmic(unsigned index) {
|
bool parameter_is_logarithmic(unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float get_parameter(faustlpf* dsp, unsigned index) {
|
FAUSTFLOAT get_parameter(faustlpf* dsp, unsigned index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
return dsp->fHslider0;
|
return dsp->fHslider0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
(void)dsp;
|
(void)dsp;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_parameter(faustlpf* dsp, unsigned index, float value) {
|
void set_parameter(faustlpf* dsp, unsigned index, FAUSTFLOAT value) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
dsp->fHslider0 = value;
|
dsp->fHslider0 = value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
(void)dsp;
|
(void)dsp;
|
||||||
(void)value;
|
(void)value;
|
||||||
|
@ -187,12 +203,12 @@ void set_parameter(faustlpf* dsp, unsigned index, float value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float get_cutoff(faustlpf* dsp) {
|
FAUSTFLOAT get_cutoff(faustlpf* dsp) {
|
||||||
return dsp->fHslider0;
|
return dsp->fHslider0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void set_cutoff(faustlpf* dsp, float value) {
|
void set_cutoff(faustlpf* dsp, FAUSTFLOAT value) {
|
||||||
dsp->fHslider0 = value;
|
dsp->fHslider0 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
type
|
type
|
||||||
faustlpf* = object
|
faustlpf* = object
|
||||||
|
ParameterRange* = object
|
||||||
|
init*, min*, max*: cfloat
|
||||||
SampleBuffer* = UncheckedArray[cfloat]
|
SampleBuffer* = UncheckedArray[cfloat]
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +13,7 @@ proc initfaustlpf*(dsp: ptr faustlpf, sample_rate: cint) {.importc.}
|
||||||
proc instanceClearfaustlpf*(dsp: ptr faustlpf) {.importc.}
|
proc instanceClearfaustlpf*(dsp: ptr faustlpf) {.importc.}
|
||||||
proc computefaustlpf*(dsp: ptr faustlpf, count: cint, inputs, outputs: ptr ptr SampleBuffer) {.importc.}
|
proc computefaustlpf*(dsp: ptr faustlpf, count: cint, inputs, outputs: ptr ptr SampleBuffer) {.importc.}
|
||||||
|
|
||||||
|
proc parameter_range*(index: cuint): ptr ParameterRange {.importc.}
|
||||||
proc parameter_group*(index: cuint): cint {.importc}
|
proc parameter_group*(index: cuint): cint {.importc}
|
||||||
proc parameter_is_boolean*(index: cuint): bool {.importc}
|
proc parameter_is_boolean*(index: cuint): bool {.importc}
|
||||||
proc parameter_is_enum*(index: cuint): bool {.importc}
|
proc parameter_is_enum*(index: cuint): bool {.importc}
|
||||||
|
|
|
@ -50,7 +50,7 @@ proc activate(instance: Lv2Handle) {.cdecl.} =
|
||||||
|
|
||||||
proc run(instance: Lv2Handle; nSamples: cuint) {.cdecl.} =
|
proc run(instance: Lv2Handle; nSamples: cuint) {.cdecl.} =
|
||||||
let plug = cast[ptr FaustLPFPlugin](instance)
|
let plug = cast[ptr FaustLPFPlugin](instance)
|
||||||
set_cutoff(plug.flt, plug.freq[])
|
plug.flt.set_cutoff(plug.freq[])
|
||||||
computefaustlpf(plug.flt, nSamples.cint, addr plug.input, addr plug.output)
|
computefaustlpf(plug.flt, nSamples.cint, addr plug.input, addr plug.output)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue