Advertisement
henke37

dropDouble interpolator

May 1st, 2015
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. counter_t increment=42;
  2. counter_t threshold=9001;
  3. counter_t counter=0;
  4. sample_t curSample=0;
  5.  
  6. sample_t dropDoubleInterpolateNextSample() {
  7.     counter+=increment;
  8.     while(counter>threshold) {
  9.         counter-=threshold;
  10.         curSample=readNextSample();
  11.     }
  12.     return curSample;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement