diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 8ce5ca2..968320a 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -432,16 +432,13 @@ void CMiniDexed::BankSelectPerformance (unsigned nBank) { nBank=constrain((int)nBank,0,16383); - if (m_nParameter[ParameterPerformanceSelectChannel] != CMIDIDevice::Disabled) + if (GetPerformanceConfig ()->IsValidPerformanceBank(nBank)) { - if (GetPerformanceConfig ()->IsValidPerformanceBank(nBank)) - { - // Only change if we have the bank loaded - m_nVoiceBankIDPerformance = nBank; - SetNewPerformanceBank (nBank); + // Only change if we have the bank loaded + m_nVoiceBankIDPerformance = nBank; + SetNewPerformanceBank (nBank); - m_UI.ParameterChanged (); - } + m_UI.ParameterChanged (); } } diff --git a/src/performanceconfig.cpp b/src/performanceconfig.cpp index 53a3eeb..8cd6275 100644 --- a/src/performanceconfig.cpp +++ b/src/performanceconfig.cpp @@ -1,4 +1,3 @@ - // // performanceconfig.cpp // diff --git a/src/uimenu.cpp b/src/uimenu.cpp index e09e301..82a426a 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -1390,6 +1390,12 @@ void CUIMenu::PerformanceMenu (CUIMenu *pUIMenu, TMenuEvent Event) unsigned nLastPerformance = pUIMenu->m_pMiniDexed->GetLastPerformance(); unsigned nValue = pUIMenu->m_nSelectedPerformanceID; unsigned nStart = nValue; + if (pUIMenu->m_pMiniDexed->IsValidPerformance(nValue) != true) + { + // A bank change has left the selected performance out of sync + nValue = pUIMenu->m_pMiniDexed->GetActualPerformanceID(); + pUIMenu->m_nSelectedPerformanceID = nValue; + } std::string Value; if (Event == MenuEventUpdate)