MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Process

Method Process

Source/FreqDelay.cpp:53–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void 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
82void FreqDelay::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
83{

Callers

nothing calls this directly

Calls 11

MultFunction · 0.85
AddFunction · 0.85
SetNumActiveChannelsMethod · 0.80
NumActiveChannelsMethod · 0.80
BufferSizeMethod · 0.80
GetChannelMethod · 0.80
GetBufferMethod · 0.80
WriteChunkMethod · 0.80
CopyFromMethod · 0.45
ProcessAudioMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected