diff --git a/UI.hpp b/UI.hpp index 85b8cb6..7a32daf 100644 --- a/UI.hpp +++ b/UI.hpp @@ -30,7 +30,6 @@ #include "disp_plus.h" #include "effect_modulated_delay.h" #include "effect_stereo_mono.h" -#include "mixer8.h" #ifdef USE_PLATEREVERB #include "effect_platervbstereo.h" #else @@ -85,8 +84,8 @@ extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; extern AudioMixer4 microdexed_peak_mixer; extern AudioAnalyzePeak microdexed_peak; #if defined(USE_FX) -extern AudioMixer8 reverb_mixer_r; -extern AudioMixer8 reverb_mixer_l; +extern AudioMixer4 reverb_mixer_r; +extern AudioMixer4 reverb_mixer_l; #ifdef USE_PLATEREVERB extern AudioEffectPlateReverb reverb; #else @@ -6113,7 +6112,6 @@ void locate_previous_non_favorite() if (configuration.performance.voice[selected_instance_id] == 0) { configuration.performance.voice[selected_instance_id] = 32; //+1 - //configuration.performance.bank[selected_instance_id]--; if (configuration.performance.bank[selected_instance_id] < 1 ) configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1; @@ -6141,20 +6139,38 @@ void locate_previous_favorite() { configuration.performance.bank[selected_instance_id] = MAX_BANKS - 1; configuration.performance.voice[selected_instance_id] = 32; - } + } else + + if (configuration.performance.voice[selected_instance_id] == 0 && configuration.performance.bank[selected_instance_id] < MAX_BANKS - 1 ) + { //if at begin of any other bank + configuration.performance.bank[selected_instance_id]--; + configuration.performance.voice[selected_instance_id] = 32; - if (configuration.performance.voice[selected_instance_id] >= 1 && configuration.performance.bank[selected_instance_id] >= 0) { + } + + if (configuration.performance.voice[selected_instance_id] >= 0 && configuration.performance.bank[selected_instance_id] >= 0) { lcd.setCursor(3, 0); lcd.print("= 1 && favsearcher < 18); + selected_instance_id) == false && configuration.performance.voice[selected_instance_id] >= 1 && favsearcher < 36); // if found, we are done. else quick check in previous banks @@ -6182,31 +6198,72 @@ void locate_previous_favorite() } void locate_next_favorite() + { - //find next fav in current bank - lcd.setCursor(3, 0); - lcd.print(">SEARCHING"); - do { - configuration.performance.voice[selected_instance_id]++; - if (configuration.performance.voice[selected_instance_id] > 31) { + bool RollOver = false; + if (configuration.performance.voice[selected_instance_id] > 30 && configuration.performance.bank[selected_instance_id] >= MAX_BANKS - 1 ) + { //if at end of all banks + configuration.performance.bank[selected_instance_id] = 0; + configuration.performance.voice[selected_instance_id] = 0; + RollOver = true; + + } else if (configuration.performance.voice[selected_instance_id] > 30 && configuration.performance.bank[selected_instance_id] < MAX_BANKS - 1 ) + { //if at end of any other bank + configuration.performance.bank[selected_instance_id]++; + configuration.performance.voice[selected_instance_id] = 0; + } + + if (configuration.performance.voice[selected_instance_id] <= 30 && configuration.performance.bank[selected_instance_id] <= MAX_BANKS ) { + + lcd.setCursor(3, 0); + lcd.print(">SEARCHING"); + + do { //first find next fav in current bank + + if (RollOver == false) configuration.performance.voice[selected_instance_id]++; else RollOver = true; + favsearcher++; + + } while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], + selected_instance_id) == false && configuration.performance.voice[selected_instance_id] <= 32 && favsearcher < 36); + + // if found, we are done. else quick check in next banks + + if ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], + selected_instance_id) == false && + configuration.performance.bank[selected_instance_id] < MAX_BANKS && favsearcher < 170) + { configuration.performance.voice[selected_instance_id] = 0; - configuration.performance.bank[selected_instance_id]++; - if (configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1) - configuration.performance.bank[selected_instance_id] = 0; - do { //seek for next bank + do { //seek in next bank + configuration.performance.bank[selected_instance_id]++; - if (configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1) + if ( configuration.performance.bank[selected_instance_id] > MAX_BANKS - 1 && favsearcher < 190) + { configuration.performance.bank[selected_instance_id] = 0; + configuration.performance.voice[selected_instance_id] = 0; + } + favsearcher++; - } while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false && favsearcher < 132); + } while (quick_check_favorites_in_bank(configuration.performance.bank[selected_instance_id], selected_instance_id) == false && + favsearcher < 132 ); + + if ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], + selected_instance_id) == false && configuration.performance.voice[selected_instance_id] <= 32 && favsearcher < 190) + { + do { //last bank to search if a fav can be found + + configuration.performance.voice[selected_instance_id]++; + favsearcher++; + } while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], + selected_instance_id) == false && favsearcher < 170); + } } - favsearcher++; - } while ( check_favorite(configuration.performance.bank[selected_instance_id], configuration.performance.voice[selected_instance_id], - selected_instance_id) == false && favsearcher < 170); + + } favsearcher = 0; + } void locate_next_non_favorite()