Is simultaneous advanced wave synthesis possible with TVout ?

Much appreciated ! I modified my low-pass filter code from an example on Microchip forums and I'm not even certain how well it works with audio.

This is the code from the PC version that uses floats. I don't even really understand what it does, but I can see the results on the scope though: it dampens down signals progressively more as you go up in frequency. The problem is that at times it causes horrible distortion (signal goes bezerk & over limits), and I haven't figured out how to keep it under control.

The reason why the calculations have been spread out on many lines was precisely because I was stepping through the code trying to figure out how TAU and DT affect the result.

In fact, if you could point me yet again to some theory on how low-pass filters work, I'd be very interested in learning more.
I know synthesizers can control the lo-pass filter with an envelope, but what are the mathematical parameters that are being manipulated ?

// Low pass filter

#define SF10 (10)
#define SCALE10 (2^SF10)
#define DT (0.01f) // time, was 0.01 originally
#define TAU (0.9f) // time constant in sec/rad, was 0.9 originally
                    // 0.9 = distorts at 70 hz, vol = 62
                    // 0.45 = distorts at 180 hz
                    // 0.12 = distorts at 440 hz
#define K ((float)DT/((float)TAU+(float)DT))
#define K_SCALE10 (K*(float)SCALE10) // Note this is 102, truncation of 0.4 doesn't affect filter really
#define FILTER_IC (long)(0.0*SCALE10) // Note this is 0 as a long

// low pass filter
int lag1order( int x, long last_y, float tau, int amp )
{
long x_scaled;
float temp;
static long y_scaled;

temp = K;
temp = K_SCALE10;
y_scaled = last_y;
x_scaled = x*SCALE10;
temp = x_scaled - y_scaled;
temp = temp * ((float)DT/((float)tau+(float)DT))* (float)SCALE10;
temp = temp / SCALE10;
y_scaled = y_scaled + temp;
return(y_scaled*amp/SCALE10);
}