MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / process

Method process

Source/DSP/LfoEngine.cpp:128–142  ·  view source on GitHub ↗

Call this on every sample in processBlock. Returns a bipolar [-1, 1] signal.

Source from the content-addressed store, hash-verified

126
127// Call this on every sample in processBlock. Returns a bipolar [-1, 1] signal.
128float 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected