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

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

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

gen7(gen)
register struct gen *gen;
{
float amp2,amp1 = 0;
int   j,k,l;
int i = 0;
	amp2 = gen->pvals[0];
	for(k=1; k<gen->nargs; k += 2)   {
		amp1 = amp2;
		amp2 = gen->pvals[k+1];
		j = i + 1;
		i = j + gen->pvals[k] - 1;
		     for(l=j; l<=i; l++) {
				if(l <= gen->size)
				   gen->array[l-1] = amp1 +
				      (amp2-amp1)*(float)(l-j)/(i-j+1);
					}
			}
	fnscl(gen);
}

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