This is flange.c in view mode; [Download] [Up]
#include "../H/ugens.h"
#define SIZE 1024
#define MAXDEL 44100
int NBYTES = 32768;
float array[SIZE];
double flange(p,n_args)
float *p;
{
int j,count,input,output,nsamps,i,delvals[2];
float rvt,wait,atten,tabs[2],delayline[MAXDEL],xin[2],out[2],old;
double pow();
input = 0; output = 1;
nsamps = setnote(p[0],p[1],input);
setnote(p[2],p[1],output);
delset(delayline,delvals,(MAXDEL-1)/SR);
tableset(p[1],SIZE,tabs);
count = SR/200;
rvt = p[3];
j=0;
for(i=0; i<nsamps; i++) {
if(!j--) {
wait = 1./table(i,array,tabs);
j=count;
atten = pow(.001,(wait/rvt));
}
GETIN(xin,input);
old = delget(delayline,wait,delvals) * atten;
out[0] = xin[0] + old;
delput(out[0], delayline,delvals);
ADDOUT(out,output);
}
nsamps = rvt * SR;
for(i=0; i<nsamps; i++) {
old = delget(delayline,wait,delvals) * atten;
out[0] = old;
delput(out[0], delayline,delvals);
ADDOUT(out,output);
}
endnote(output);
}
double sl(p,n_args)
float *p;
{
setline(p,n_args,SIZE,array);
}
profile()
{
UG_INTRO("flange",flange);
UG_INTRO("setline",sl);
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.