Skip to content

Commit

Permalink
fix: apply GroupFeatureState changes to glitcheffect to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Sep 15, 2024
1 parent 37fbee7 commit 694542d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/effects/backends/builtin/glitcheffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,16 @@ void GlitchEffect::processChannel(

int delay_frames;
double min_delay;
if (groupFeatures.has_beat_length_sec) {
if (groupFeatures.beat_length.has_value()) {
if (m_pQuantizeParameter->toBool()) {
period = roundToFraction(period, 8);
if (m_pTripletParameter->toBool()) {
period /= 3.0;
}
}
period = std::max(period, 1 / 8.0);
delay_frames = static_cast<int>(period * groupFeatures.beat_length_sec *
engineParameters.sampleRate());
min_delay = 1 / 8.0 * groupFeatures.beat_length_sec * engineParameters.sampleRate();
delay_frames = static_cast<int>(period * groupFeatures.beat_length->frames);
min_delay = 1 / 8.0 * groupFeatures.beat_length->frames;
} else {
delay_frames = static_cast<int>(period * engineParameters.sampleRate());
min_delay = 1 / 8.0 * engineParameters.sampleRate();
Expand Down

0 comments on commit 694542d

Please sign in to comment.