SHARE
TWEET

Untitled

a guest May 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Top