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

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

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

gen17(gen)
register struct gen *gen;

/* Computes transfer function using Chebyshev polynomials
First argument (after number) is the index value for
which the function will create the harmonics specified by the following
arguments.  */
{       
	int i,j;
	float Tn,Tn1,Tn2,x,d,*f;
	d=(float)(gen->size/2-.5);
        for(i=0; i<gen->size; i++) {
	      x=(i/d-1.)/gen->pvals[0];
	      gen->array[i]=0;
	      Tn1=1;
	      Tn=x;
	      for (j=1; j<gen->nargs; j++) {
		  gen->array[i]=gen->pvals[j]*Tn+gen->array[i];
		  Tn2=Tn1;
		  Tn1=Tn;
		  Tn=2*Tn1*x-Tn2;
              }
        }
//	fnscl(gen);
}

		 

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