Call this on every sample in processBlock. Returns a bipolar [-1, 1] signal.
| 126 | |
| 127 | // Call this on every sample in processBlock. Returns a bipolar [-1, 1] signal. |
| 128 | float LfoEngine::process() |
| 129 | { |
| 130 | // Get the unipolar [0, 1] value from the pre-calculated wavetable |
| 131 | const float unipolarOutput = wavetable.getUnchecked(phase * (wavetable.getNumPoints() - 1)); |
| 132 | |
| 133 | // Advance the phase using the externally calculated delta |
| 134 | phase += phaseDelta; |
| 135 | |
| 136 | if (phase >= 1.0f) |
| 137 | phase -= 1.0f; |
| 138 | |
| 139 | // Convert the output to bipolar [-1, 1] for modulation |
| 140 | lastOutput = unipolarOutput; |
| 141 | return unipolarOutput; |
| 142 | } |
| 143 | |
| 144 | // Call this from your processor before each block to set the LFO speed. |
| 145 | // The processor is responsible for calculating the correct delta for Hz or BPM sync. |
nothing calls this directly
no outgoing calls
no test coverage detected