unkargherth ·
Hi all!!
I'm new here. my name is Unkargherth. Is posible you know me Before from my work in SE
Well. Wanted to start with something simpler so i ported a 24 db Low pass from music dsp source code archive to SM
It's very posible that can ve optimized and modified in some ways. If you find any, please share it here
Sorry. I has no hosting now so i post the code directly
polyin in; polyin cut; polyin q; polyout low;
float bfreq,invf,res; float pole1,pole2,pole3,pole4; float binSH,bfp,prevfp,bin,intfp;
bfreq = cut; invf = bfreq * (-1); res = q * 5; binSH = in;
// Loop starts here prevfp = bfp; bfp = (bfp * 0.418 ) + ( (res * pole4 ) * 0.582 );
intfp = ( bfp * 0.36 ) + ( prevfp * 0.64 ); bin = binSH + (-1.0 * intfp ); pole1 = ( bin * bfreq ) + (pole1 * (1 + invf ) ); // clip -1..1 pole1 = min(pole1,1.0); pole1 = max(pole1,-1.0);
pole2 = (pole1 * bfreq ) + (pole2 * (1 + invf )); pole3 = (pole2 * bfreq ) + (pole3 * (1 + invf )); pole4 = (pole3 * bfreq ) + (pole4 * (1 + invf )); // Loop (second pass) starts here prevfp = bfp; bfp = (bfp * 0.418 ) + ( (res * pole4 ) * 0.582 );
intfp = ( bfp * 0.36 ) + ( prevfp * 0.64 ); bin = binSH + (-1.0 * intfp ); pole1 = ( bin * bfreq ) + (pole1 * (1 + invf ) ); // clip -1..1 pole1 = min(pole1,1.0); pole1 = max(pole1,-1.0);
pole2 = (pole1 * bfreq ) + (pole2 * (1 + invf )); pole3 = (pole2 * bfreq ) + (pole3 * (1 + invf )); pole4 = (pole3 * bfreq ) + (pole4 * (1 + invf )); // Loop ends here
low = pole4;
...waiting your comments.