ftp.nice.ch/pub/next/unix/audio/Cmix.N.s.tar.gz#/cmix/lib/resontest.c

This is resontest.c in view mode; [Download] [Up]

#define      PI2    6.2831853
#include <math.h>
#define SR 22050
main()
{
	float a[10];
	rsnset(100.,.1,0.,0.,a);
}


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);
printf("%f %f\n",a[2],a[1]);
	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]));
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.