| 107 | } |
| 108 | |
| 109 | void 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 | |
| 130 | float IModulator::GetRecentChange() const |
| 131 | { |
nothing calls this directly
no test coverage detected