
#include "../H/ugens.h"
rsnset(cf,bw,scl,xinit,a)
float cf,bw,scl,xinit,*a;
{
	double exp(),cos(),sqrt();
	float c,temp;
	if(!xinit) {
		a[4] = 0;
		a[3] = 0;
		}
	a[2] = exp(-PI2 * bw/SR);
	temp = 1. - a[2];
	c = a[2] + 1;
	a[1] = 4. * a[2]/c * cos(PI2 * cf/SR);
	if(scl < 0) a[0] = 1;
	if(scl) a[0] = sqrt(temp/c*(c*c-a[1]*a[1]));
	if(!scl) a[0] = temp*sqrt(1.-a[1]*a[1]/(4.*a[2]));
}
