This is rflange.m in view mode; [Download] [Up]
#import "/musr/H/ugens.h" #import <objc/objc.h> #import "/musr/objc/Delay.h" #import "/musr/H/sfheader.h" #define SIZE 1024 #define MAXDEL 8192 int NBYTES = 32768; extern SFHEADER sfdesc[NFILES]; float array[SIZE]; double flange(p,n_args) float *p; { id delaySig; int k,j,count,input,output,nsamps,i; int nchans; float wait,atten,tabs[2],xin[2],out[2]; float outx,sig,old,gain; double pow(); float left,right; delaySig = [Delay create]; [delaySig size:.1 sRate:SR]; input = 0; output = 1; nsamps = setnote(p[0],p[1],output); setnote(p[2],p[1],input); left = right = .5; gain = p[3]; tableset(p[1],SIZE,tabs); count = SR/200; j=0; for(i=0; i<nsamps; i++) { if(!j--) { wait = table(i,array,tabs); j=count; } GETIN(xin,input); old = [delaySig get:wait]; out[0] = old * gain + xin[0]; [delaySig put:out[0]]; WIPEOUT(out,output); } endnote(output); } double sl(p,n_args) float *p; { int i; 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.