SHARE
TWEET

Untitled

a guest Feb 18th, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // Apply delay
  2.         for (unsigned iSample = 0; iSample < numSamples; ++iSample)
  3.         {
  4.             const float left  = *pLeftIn++;
  5.             const float right = *pRightIn++;
  6.  
  7.             const float monaural = left*0.5f + right*0.5f;
  8.  
  9.             const float feedbackOffs = 0.1f;
  10.             const float feedbackL    = feedbackOffs;
  11.             const float feedbackR    = -feedbackOffs;;
  12.             const float feed         = 1.f-feedbackOffs;
  13.  
  14.             m_delayLineL.Write(feed*left, feedbackL);
  15.             m_delayLineM.Write(monaural, 0.f);
  16.             m_delayLineR.Write(feed*right, feedbackR);
  17.  
  18.             const float delay = 1.5f;
  19.  
  20.             const float delayedL = m_delayLineL.Read(delay);
  21.             const float delayedM = m_delayLineM.Read(delay);
  22.             const float delayedR = m_delayLineR.Read(delay);
  23.  
  24.             const float crossBleed = 0.01f*(delayedL+delayedM+delayedR);
  25.  
  26.             pLeftOut[iSample]  = delayedL*0.99f + crossBleed;
  27.             pRightOut[iSample] = delayedR*0.99f + crossBleed;
  28.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top