ftp.nice.ch/pub/next/unix/audio/cmix.s.tar.gz#/cmix/lib/rsnset.m

This is rsnset.m in view mode; [Download] [Up]

#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]));
}

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