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

Method Process

Source/PitchChorus.cpp:51–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void 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
91void PitchChorus::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
92{

Callers

nothing calls this directly

Calls 9

ClearFunction · 0.85
BufferCopyFunction · 0.85
AddFunction · 0.85
BufferSizeMethod · 0.80
GetChannelMethod · 0.80
GetBufferMethod · 0.80
WriteChunkMethod · 0.80
ValueMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected