| 65 | } |
| 66 | |
| 67 | void TremoloEffect::ProcessAudio(double time, ChannelBuffer* buffer) |
| 68 | { |
| 69 | PROFILER(TremoloEffect); |
| 70 | |
| 71 | if (!mEnabled) |
| 72 | return; |
| 73 | |
| 74 | float bufferSize = buffer->BufferSize(); |
| 75 | |
| 76 | ComputeSliders(0); |
| 77 | |
| 78 | if (mAmount > 0) |
| 79 | { |
| 80 | for (int i = 0; i < bufferSize; ++i) |
| 81 | { |
| 82 | //smooth out LFO a bit to avoid pops with square/saw LFOs |
| 83 | mWindow[mWindowPos] = mLFO.Value(i + kAntiPopWindowSize / 2); |
| 84 | mWindowPos = (mWindowPos + 1) % kAntiPopWindowSize; |
| 85 | float lfoVal = 0; |
| 86 | for (int j = 0; j < kAntiPopWindowSize; ++j) |
| 87 | lfoVal += mWindow[j]; |
| 88 | lfoVal /= kAntiPopWindowSize; |
| 89 | |
| 90 | for (int ch = 0; ch < buffer->NumActiveChannels(); ++ch) |
| 91 | buffer->GetChannel(ch)[i] *= (1 - (mAmount * (1 - lfoVal))); |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void TremoloEffect::DrawModule() |
| 97 | { |
nothing calls this directly
no test coverage detected