diff --git a/src/effects/backends/builtin/metronomeeffect.cpp b/src/effects/backends/builtin/metronomeeffect.cpp index 21c318c53e7..68c8d375333 100644 --- a/src/effects/backends/builtin/metronomeeffect.cpp +++ b/src/effects/backends/builtin/metronomeeffect.cpp @@ -137,11 +137,11 @@ void MetronomeEffect::processChannel( if (shouldSync && hasBeatInfo) { double beatFractionBufferEnd = *groupFeatures.beat_fraction_buffer_end; - std::optional beatLengthAndScratch = groupFeatures.beat_length; - if (!beatLengthAndScratch.has_value() || beatLengthAndScratch->scratch_rate == 0.0) { + GroupFeatureBeatLength beatLengthAndScratch = *groupFeatures.beat_length; + if (beatLengthAndScratch.scratch_rate == 0.0) { return; } - double beatLength = beatLengthAndScratch->frames / beatLengthAndScratch->scratch_rate; + double beatLength = beatLengthAndScratch.frames / beatLengthAndScratch.scratch_rate; const bool needsPreviousBeat = beatLength < 0; double beatToBufferEndFrames = std::abs(beatLength) * (needsPreviousBeat ? (1 - beatFractionBufferEnd)