From be594f53efa9cdc3f83a52fb88af7ad1b30acfab Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Mon, 3 Apr 2023 22:17:31 +0100 Subject: [PATCH] Fix for Issue #468 - introducing Bank MSB/LSB messed up the UI parameter handling. (#469) --- src/minidexed.h | 2 ++ src/uimenu.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/minidexed.h b/src/minidexed.h index 8e8deaf..e49e7de 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -126,6 +126,7 @@ public: bool GetPerformanceSelectToLoad(void); bool SavePerformance (bool bSaveAsDeault); + // Must match the order in CUIMenu::TParameter enum TParameter { ParameterCompressorEnable, @@ -148,6 +149,7 @@ public: bool DeletePerformance(unsigned nID); bool DoDeletePerformance(void); + // Must match the order in CUIMenu::TGParameter enum TTGParameter { TGParameterVoiceBank, diff --git a/src/uimenu.cpp b/src/uimenu.cpp index bcea3e0..cc1d670 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -219,6 +219,8 @@ const CUIMenu::TParameter CUIMenu::s_GlobalParameter[CMiniDexed::ParameterUnknow const CUIMenu::TParameter CUIMenu::s_TGParameter[CMiniDexed::TGParameterUnknown] = { {0, CSysExFileLoader::MaxVoiceBankID, 1}, // TGParameterVoiceBank + {0, 0, 0}, // TGParameterVoiceBankMSB (not used in menus) + {0, 0, 0}, // TGParameterVoiceBankLSB (not used in menus) {0, CSysExFileLoader::VoicesPerBank-1, 1}, // TGParameterProgram {0, 127, 8, ToVolume}, // TGParameterVolume {0, 127, 8, ToPan}, // TGParameterPan @@ -249,7 +251,6 @@ const CUIMenu::TParameter CUIMenu::s_TGParameter[CMiniDexed::TGParameterUnknown] {0, 1, 1, ToOnOff}, //AT Pitch {0, 1, 1, ToOnOff}, //AT Amp {0, 1, 1, ToOnOff} //AT EGBias - }; // must match DexedVoiceParameters in Synth_Dexed @@ -1467,8 +1468,6 @@ void CUIMenu::EditTGParameterModulation (CUIMenu *pUIMenu, TMenuEvent Event) unsigned nController = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-1]; unsigned nParameter = pUIMenu->m_nCurrentParameter + nController; - - CMiniDexed::TTGParameter Param = (CMiniDexed::TTGParameter) nParameter; const TParameter &rParam = s_TGParameter[Param];