#include "svfilter.h"

#include "nodelib/basics.h"
#include "audio/audioengine.h"

using Xybrid::NodeLib::SVFilter;
using Xybrid::NodeLib::GenericSVFilter;
using Xybrid::Data::AudioFrame;
using namespace Xybrid::Audio;

template class Xybrid::NodeLib::GenericSVFilter<AudioFrame>;
template class Xybrid::NodeLib::GenericSVFilter<double>;
/*
template<typename DT>
void GenericSVFilter<DT>::process(DT in, double cutoff, double resonance, int ovs) {
    if (ovs <= 0) return;
    cutoff = std::max(cutoff, 1.0);
    resonance = std::max(resonance, 0.01);

    double f = 2.0 * std::sin(PI * cutoff / (audioEngine->curSampleRate() * ovs));
    double q = std::sqrt(1.0 - std::atan(std::sqrt(resonance)) * 2.0 / PI);
    double damp = std::sqrt(q);

    for (int i = 0; i < ovs; i++) {
        low += band*f;
        high = in*damp - low - band*q;
        band += high*f;
    }
    notch = high+low;
}
*/
