ftp.nice.ch/pub/next/unix/audio/cmix.s.tar.gz#/cmix/sys/gen9.c

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

#include "../H/ugens.h"

gen9(gen)

register struct gen *gen;

{
	int i,j;
	double sin();

	for(i = 0; i < gen->size; i++) gen->array[i] = 0;

	for(j = gen->nargs-1; j > 0; j -= 3) {
		if(gen->pvals[j-1] != 0) {
			for(i = 0; i < gen->size; i++) {
				gen->array[i] += (float) (sin(PI2*((float)i/
				((float) (gen->size)/gen->pvals[j-2]) +
				gen->pvals[j]/360.)) * gen->pvals[j-1]);
				}
			}
		}
	fnscl(gen);
}

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