Low pass filter and MIDI note to frequency in C


float lp(float x, float a,float* mem)
{
*mem += a * (x - *mem);
return *mem;
}


float midifreq(int note)
{
return (1 << ((note - 69) / 12)) * 440.0; }