| 49 | } |
| 50 | |
| 51 | void PitchChorus::Process(double time) |
| 52 | { |
| 53 | PROFILER(PitchChorus); |
| 54 | |
| 55 | if (!mEnabled) |
| 56 | return; |
| 57 | |
| 58 | ComputeSliders(0); |
| 59 | SyncBuffers(); |
| 60 | |
| 61 | int bufferSize = GetBuffer()->BufferSize(); |
| 62 | IAudioReceiver* target = GetTarget(); |
| 63 | if (target) |
| 64 | { |
| 65 | Clear(mOutputBuffer, gBufferSize); |
| 66 | for (int i = 0; i < kNumShifters; ++i) |
| 67 | { |
| 68 | if (mShifters[i].mOn || mShifters[i].mRamp.Value(time) > 0) |
| 69 | { |
| 70 | BufferCopy(gWorkBuffer, GetBuffer()->GetChannel(0), bufferSize); |
| 71 | mShifters[i].mShifter.Process(gWorkBuffer, bufferSize); |
| 72 | double timeCopy = time; |
| 73 | for (int j = 0; j < bufferSize; ++j) |
| 74 | { |
| 75 | mOutputBuffer[j] += gWorkBuffer[j] * mShifters[i].mRamp.Value(timeCopy); |
| 76 | timeCopy += gInvSampleRateMs; |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | if (mPassthrough) |
| 82 | Add(mOutputBuffer, GetBuffer()->GetChannel(0), bufferSize); |
| 83 | Add(target->GetBuffer()->GetChannel(0), mOutputBuffer, bufferSize); |
| 84 | } |
| 85 | |
| 86 | GetVizBuffer()->WriteChunk(mOutputBuffer, bufferSize, 0); |
| 87 | |
| 88 | GetBuffer()->Reset(); |
| 89 | } |
| 90 | |
| 91 | void PitchChorus::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation) |
| 92 | { |
nothing calls this directly
no test coverage detected