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

Method Poll

Source/IModulator.cpp:109–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void IModulator::Poll()
110{
111 if (Active())
112 {
113 mLastPollValue = Value();
114 const float kBlendRate = -9.65784f;
115 float blend = exp2(kBlendRate / ofGetFrameRate()); //framerate-independent blend
116 mSmoothedValue = mSmoothedValue * blend + mLastPollValue * (1 - blend);
117 for (int i = 0; i < (int)mTargets.size(); ++i)
118 {
119 if (mTargets[i].RequiresManualPolling())
120 {
121 if (mTargets[i].mUIControlTarget->ModulatorUsesLiteralValue())
122 mTargets[i].mUIControlTarget->SetValue(mLastPollValue, NextBufferTime(false));
123 else
124 mTargets[i].mUIControlTarget->SetFromMidiCC(mLastPollValue, NextBufferTime(false), true);
125 }
126 }
127 }
128}
129
130float IModulator::GetRecentChange() const
131{

Callers

nothing calls this directly

Calls 8

ValueClass · 0.85
ofGetFrameRateFunction · 0.85
NextBufferTimeFunction · 0.85
sizeMethod · 0.80
RequiresManualPollingMethod · 0.80
SetValueMethod · 0.45
SetFromMidiCCMethod · 0.45

Tested by

no test coverage detected