From e550736dbb862d8333a4d7f2ede9804a3d48326c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Oct 2011 05:22:14 +0000 Subject: Add 'blip', an LV2 port of the LADSPA 'blop' collection. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blip.lv2@3525 a436a847-0d15-0410-975c-d299462d15a1 --- src/lp4pole_filter.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/lp4pole_filter.c (limited to 'src/lp4pole_filter.c') diff --git a/src/lp4pole_filter.c b/src/lp4pole_filter.c new file mode 100644 index 0000000..7d54691 --- /dev/null +++ b/src/lp4pole_filter.c @@ -0,0 +1,55 @@ +/* + lp4pole filter admin. + Copyright 2011 David Robillard + Copyright 2003 Mike Rawes + + See lp4pole_filter.h for history + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this software. If not, see . +*/ + +#include +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include "lp4pole_filter.h" + +LP4PoleFilter* +lp4pole_new(double sample_rate) +{ + LP4PoleFilter* lpf; + + lpf = (LP4PoleFilter*)malloc(sizeof(LP4PoleFilter)); + + if (lpf) { + lpf->inv_nyquist = 2.0f / sample_rate; + lp4pole_init(lpf); + } + + return lpf; +} + +void +lp4pole_cleanup(LP4PoleFilter* lpf) +{ + if (lpf) { + free(lpf); + } +} + +void +lp4pole_init(LP4PoleFilter* lpf) +{ + lpf->in1 = lpf->in2 = lpf->in3 = lpf->in4 = 0.0f; + lpf->out1 = lpf->out2 = lpf->out3 = lpf->out4 = 0.0f; + lpf->max_abs_in = 0.0f; +} -- cgit v1.2.1