fix shuffle edge case for -5 ticks

pull/32/head
midilab 1 year ago
parent c9bb9c4d9f
commit 7ae223888b
  1. 6
      src/uClock.cpp

@ -296,15 +296,17 @@ int8_t inline uClockClass::processShuffle()
shuffle_shoot_ctrl = true; shuffle_shoot_ctrl = true;
mod6_shuffle_counter = shuffle_shoot_ctrl ? mod6_counter - shff : 1; mod6_shuffle_counter = shuffle_shoot_ctrl ? mod6_counter - shff : 1;
shuffle_length_ctrl -= shff; shuffle_length_ctrl -= shff;
if (shuffle_length_ctrl == 0)
shuffle_length_ctrl = 1;
} else if (shff < 0) { } else if (shff < 0) {
if (shuffle_shoot_ctrl == false && mod6_counter == 0) if (shuffle_shoot_ctrl == false && mod6_counter == 0)
shuffle_shoot_ctrl = true; shuffle_shoot_ctrl = true;
mod6_shuffle_counter = shff - mod6_counter == -6 ? shuffle_shoot_ctrl ? 0 : 1 : 1; mod6_shuffle_counter = shff - mod6_counter == -6 ? shuffle_shoot_ctrl ? 0 : 1 : 1;
shuffle_length_ctrl += shff; shuffle_length_ctrl += shff;
if (shuffle_length_ctrl == 0)
shuffle_length_ctrl = -1;
} }
} }
if (shuffle_length_ctrl == 0)
shuffle_length_ctrl = 1;
return mod6_shuffle_counter; return mod6_shuffle_counter;
} }

Loading…
Cancel
Save