| 51 | } |
| 52 | |
| 53 | void FreqDelay::Process(double time) |
| 54 | { |
| 55 | PROFILER(FreqDelay); |
| 56 | |
| 57 | IAudioReceiver* target = GetTarget(); |
| 58 | |
| 59 | if (target == nullptr) |
| 60 | return; |
| 61 | |
| 62 | SyncBuffers(); |
| 63 | mDryBuffer.SetNumActiveChannels(GetBuffer()->NumActiveChannels()); |
| 64 | |
| 65 | int bufferSize = GetBuffer()->BufferSize(); |
| 66 | |
| 67 | mDryBuffer.CopyFrom(GetBuffer()); |
| 68 | mDelayEffect.ProcessAudio(time, GetBuffer()); |
| 69 | |
| 70 | for (int ch = 0; ch < GetBuffer()->NumActiveChannels(); ++ch) |
| 71 | { |
| 72 | Mult(mDryBuffer.GetChannel(ch), (1 - mDryWet), bufferSize); |
| 73 | Mult(GetBuffer()->GetChannel(ch), mDryWet, bufferSize); |
| 74 | Add(GetBuffer()->GetChannel(ch), mDryBuffer.GetChannel(ch), bufferSize); |
| 75 | Add(target->GetBuffer()->GetChannel(ch), GetBuffer()->GetChannel(ch), bufferSize); |
| 76 | GetVizBuffer()->WriteChunk(GetBuffer()->GetChannel(ch), bufferSize, ch); |
| 77 | } |
| 78 | |
| 79 | GetBuffer()->Reset(); |
| 80 | } |
| 81 | |
| 82 | void FreqDelay::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation) |
| 83 | { |
nothing calls this directly
no test coverage detected