Add API to copy Biquad parameters
This is handy for stereo or higher-order plugin configurations, the coefficients have to be calculated only once.
This commit is contained in:
parent
b411eeb74e
commit
a946046532
@ -248,6 +248,9 @@ namespace ARDOUR { namespace DSP {
|
||||
/** setup filter, set coefficients directly */
|
||||
void configure (double a1, double a2, double b0, double b1, double b2);
|
||||
|
||||
/* copy coefficients from other instance, retain state */
|
||||
void configure (Biquad const&);
|
||||
|
||||
/** filter transfer function (filter response for spectrum visualization)
|
||||
* @param freq frequency
|
||||
* @return gain at given frequency in dB (clamped to -120..+120)
|
||||
|
@ -196,6 +196,16 @@ Biquad::configure (double a1, double a2, double b0, double b1, double b2)
|
||||
_b2 = b2;
|
||||
}
|
||||
|
||||
void
|
||||
Biquad::configure (Biquad const& other)
|
||||
{
|
||||
_a1 = other._a1;
|
||||
_a2 = other._a2;
|
||||
_b0 = other._b0;
|
||||
_b1 = other._b1;
|
||||
_b2 = other._b2;
|
||||
}
|
||||
|
||||
void
|
||||
Biquad::compute (Type type, double freq, double Q, double gain)
|
||||
{
|
||||
|
@ -2790,7 +2790,7 @@ LuaBindings::common (lua_State* L)
|
||||
.addConstructor <void (*) (double)> ()
|
||||
.addFunction ("run", &DSP::Biquad::run)
|
||||
.addFunction ("compute", &DSP::Biquad::compute)
|
||||
.addFunction ("configure", &DSP::Biquad::configure)
|
||||
.addFunction ("configure", (void (DSP::Biquad::*) (DSP::Biquad const&))&DSP::Biquad::configure)
|
||||
.addFunction ("reset", &DSP::Biquad::reset)
|
||||
.addFunction ("dB_at_freq", &DSP::Biquad::dB_at_freq)
|
||||
.endClass ()
|
||||
|
Loading…
Reference in New Issue
Block a user