Advertisement
Guest User

Untitled

a guest
May 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. void AGain::subProcess( int bufferOffset, int sampleFrames )
  2. {
  3.     // get parameter value.
  4.     float val = voltVal;
  5.  
  6.     // get pointers to in/output buffers.
  7.     float* input1   = bufferOffset + X.getBuffer();
  8.     float* input2   = bufferOffset + Y.getBuffer();
  9.     float* output1  = bufferOffset + result.getBuffer();
  10.  
  11.     float threshLow, threshHi = 0;
  12.     while( --sampleFrames >= 0 )
  13.     {
  14.         threshLow = *input1 - threshold;
  15.         threshHi = *input1 + threshold;
  16.  
  17.         if((*input2 >= threshLow) && (*input2 <= threshHi))
  18.         {
  19.             *output1 = val;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement