diff --git a/src/sfizz/LFO.cpp b/src/sfizz/LFO.cpp index 636ba74f..547e296c 100644 --- a/src/sfizz/LFO.cpp +++ b/src/sfizz/LFO.cpp @@ -330,16 +330,22 @@ void LFO::generatePhase(unsigned nth, absl::Span phases, NumericIdgetModulationByKey(beatsKey); + freqMod = modMatrix->getModulationByKey(freqKey); + } + if (beatClock && beatClock->isPlaying() && beats > 0) { // generate using the beat clock float beatRatio = (ratio > 0) ? (1.0f / ratio) : 0.0f; - const float* beatsMod = nullptr; - if (modMatrix && id && regionId) { - ModKey beatsKey = ModKey::createNXYZ(ModId::LFOBeats, regionId, id.number()); - beatsMod = modMatrix->getModulationByKey(beatsKey); - } - if (!beatsMod) beatClock->calculatePhase(beats * beatRatio, phases.data()); else { @@ -358,12 +364,6 @@ void LFO::generatePhase(unsigned nth, absl::Span phases, NumericIdgetModulationByKey(freqKey); - } - if (!freqMod) { for (size_t i = 0; i < numFrames; ++i) { phases[i] = phase;