/* * Moog-like resonant LPF * Implemented by Andre Sklenar , www.juicelab.cz . * * Filter design from http://www.musicdsp.com . */ #ifndef MOOG_VCF_HXX_INCLUDED #define MOOG_VCF_HXX_INCLUDED #include #include class MoogVCF { public: MoogVCF() { cutoff = 16000; res = 0.5; f=k=p=scale=r=0; y1=y2=y3=y4=oldIn=oldY1=oldY2=oldY3=0; in=oldIn=0; pureInput=drivenInput=processedInput=0; } void recalc(float cutoff, float reso, int sr, float nDrive) { f = 2*cutoff/sr; k=2*std::sin(f*M_PI/2)-1; p = (k+1)*0.5; scale = std::pow(2.71828, (1-p)*1.386249); r = reso*scale; drive = nDrive; } float process (float input) { //run the shit //for (long i=0; i