Next  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Variable Delay Line

   static double A[N];
   static double *rptr = A; // read ptr
   static double *wptr = A; // write ptr

   double setdelay(int M) {
       rptr = wptr - M;
       while (rptr < A) { rptr += N }
   }

   double delayline(double x)
   {
     double y;
     A[wptr++] = x; 
     y = A[rptr++];
     if ((wptr-A) >= N) { wptr -= N }
     if ((rptr-A) >= N) { rptr -= N }
     return y;
   }
Note separate read- and write-pointers



Subsections
Next  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download DelayVar.pdf
Download DelayVar_2up.pdf
Download DelayVar_4up.pdf

``Time Varying Delay Effects'', by Julius O. Smith III, (From Lecture Overheads, Music 420).
Copyright © 2008-02-08 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [Automatic-links disclaimer]