home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Education Sampler 1992 [NeXTSTEP]
/
Education_1992_Sampler.iso
/
SoundAndMusic
/
cmix
/
lib
/
dliget.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-25
|
376b
|
21 lines
extern float SR;
float dliget(a,wait,l)
float *a,wait;
int *l;
{
/* get interpolated value from delay line, wait seconds old */
register im1;
float x = wait * SR;
register i = x;
float frac = x - i;
i = *l - i;
im1 = i - 1;
if(i <= 0) {
if(i < 0) i += *(l+1);
if(i < 0) return(0.);
if(im1 < 0) im1 += *(l+1);
}
return(*(a+i) + frac * (*(a+im1) - *(a+i)));
}