kfcn = 2.0 * (double)p->freq / (double)play_mode->rate; kp = ((-2.7528 * kfcn + 3.0429) * kfcn + 1.718) * kfcn - 0.9984; kp1 = kp + 1.0; kp1h = 0.5 * kp1; kres = p->res * (((-2.7079 * kp1 + 10.963) * kp1 - 14.934) * kp1 + 8.4974); value = 1.0 + (p->dist * (1.5 + 2.0 * kres * (1.0 - kfcn)));
if(p->freq != p->last_freq || p->dist != p->last_dist || p->res != p->last_res) { if(p->last_freq == 0) {	 p->ay1 = p->ay2 = p->aout = p->lastin = 0; } p->last_freq = p->freq, p->last_dist = p->dist, p->last_res = p->res;
void calc_filter_lpf18(filter_lpf18 *p){	double kfcn, kp, kp1, kp1h, kres, value;	kfcn = 2.0 * (double)p->freq / (double)play_mode->rate;	kp = ((-2.7528 * kfcn + 3.0429) * kfcn + 1.718) * kfcn - 0.9984;	kp1 = kp + 1.0;	kp1h = 0.5 * kp1;	kres = p->res * (((-2.7079 * kp1 + 10.963) * kp1 - 14.934) * kp1 + 8.4974);    value = 1.0 + (p->dist * (1.5 + 2.0 * kres * (1.0 - kfcn)));	p->kp = kp, p->kp1h = kp1h, p->kres = kres, p->value = value;}