wait for late shuffle to get caught up

pull/42/head
James Gray 3 months ago
parent 24c8cdfb40
commit 1bdaa5c3b3
  1. 19
      src/uClock.cpp

@ -404,17 +404,20 @@ bool inline uClockClass::processTrackShuffle(uint8_t track)
if (track_shuffles[track].shuffle_shoot_ctrl == false && mod_track_step_counter[track] == 0) if (track_shuffles[track].shuffle_shoot_ctrl == false && mod_track_step_counter[track] == 0)
track_shuffles[track].shuffle_shoot_ctrl = true; track_shuffles[track].shuffle_shoot_ctrl = true;
//if (mod_track_step_counter[track] == mod_step_ref-1)
if (shff >= 0) { if (shff >= 0) {
mod_shuffle = mod_track_step_counter[track] - shff; mod_shuffle = mod_track_step_counter[track] - shff;
// any late shuffle? we should skip next mod_track_step_counter == 0 // any late shuffle? we should skip next mod_track_step_counter == 0
if (track_shuffles[track].last_shff < 0 && mod_track_step_counter[track] != 1) if (track_shuffles[track].last_shff < 0 && mod_track_step_counter[track] != 1) {
if (track_shuffles[track].shuffle_shoot_ctrl == true)
track_shuffles[track].shuffle_shoot_ctrl = false;
return false; return false;
}
} else if (shff < 0) { } else if (shff < 0) {
mod_shuffle = mod_track_step_counter[track] - (mod_step_ref + shff); mod_shuffle = mod_track_step_counter[track] - (mod_step_ref + shff);
//if (last_shff < 0 && mod_track_step_counter[track] != 1)
// return false;
track_shuffles[track].shuffle_shoot_ctrl = true; track_shuffles[track].shuffle_shoot_ctrl = true;
} }
@ -422,13 +425,15 @@ bool inline uClockClass::processTrackShuffle(uint8_t track)
// shuffle_shoot_ctrl helps keep track if we have shoot or not a note for the step space of ppqn/4 pulses // shuffle_shoot_ctrl helps keep track if we have shoot or not a note for the step space of ppqn/4 pulses
if (mod_shuffle == 0 && track_shuffles[track].shuffle_shoot_ctrl == true) { if (mod_shuffle == 0 && track_shuffles[track].shuffle_shoot_ctrl == true) {
// keep track of next note shuffle for current note lenght control track_shuffles[track].shuffle_shoot_ctrl = false;
// // keep track of next note shuffle for current note lenght control
track_shuffles[track].shuffle_length_ctrl = track_shuffles[track].shuffle.step[(track_step_counter[track]+1)%track_shuffles[track].shuffle.size]; track_shuffles[track].shuffle_length_ctrl = track_shuffles[track].shuffle.step[(track_step_counter[track]+1)%track_shuffles[track].shuffle.size];
if (shff > 0) if (shff > 0)
track_shuffles[track].shuffle_length_ctrl -= shff; track_shuffles[track].shuffle_length_ctrl -= shff;
if (shff < 0) if (shff < 0)
track_shuffles[track].shuffle_length_ctrl += shff; track_shuffles[track].shuffle_length_ctrl += shff;
track_shuffles[track].shuffle_shoot_ctrl = false;
return true; return true;
} }

Loading…
Cancel
Save