diff --git a/performance/000008_AmpUpright.ini b/performance/000008_AmpUpright.ini index 17016a1..3b10a92 100644 --- a/performance/000008_AmpUpright.ini +++ b/performance/000008_AmpUpright.ini @@ -1,9 +1,9 @@ BankNumber1=2 -VoiceNumber1=6 -MIDIChannel1=0 -Volume1=47 +VoiceNumber1=2 +MIDIChannel1=1 +Volume1=87 Pan1=0 -Detune1=0 +Detune1=2 Cutoff1=99 Resonance1=0 NoteLimitLow1=0 @@ -15,7 +15,7 @@ PitchBendStep1=0 PortamentoMode1=0 PortamentoGlissando1=0 PortamentoTime1=0 -VoiceData1=5F 15 00 26 5C 3E 60 00 30 05 0A 03 00 04 00 01 55 00 01 00 07 4D 48 48 22 32 62 00 00 27 00 14 00 01 00 00 04 5F 01 02 00 0A 59 3C 17 23 63 5E 00 00 2E 03 02 03 03 03 00 01 5E 01 00 00 00 5F 1C 06 23 63 59 4B 00 05 00 63 00 01 02 00 06 4F 00 05 00 09 58 5C 47 3F 63 43 5B 5A 27 0C 14 03 00 02 00 01 5A 00 01 00 05 58 1C 1B 32 63 5A 00 00 11 63 05 03 00 02 00 03 63 00 01 00 07 00 00 00 00 32 32 32 32 0A 05 01 0E 05 00 00 00 00 01 18 41 31 31 50 6E 34 4D 46 78 64 74 +VoiceData1=43 0B 0B 2A 63 58 00 00 02 00 4E 03 01 06 00 00 50 00 05 00 0E 45 0A 0D 2A 63 58 00 00 22 08 09 03 00 01 00 04 51 00 01 00 0B 4E 49 33 37 63 3A 00 00 33 0C 0B 03 03 01 00 02 5C 01 06 09 06 40 15 07 2C 63 4F 00 00 1E 00 00 00 00 07 00 03 63 00 01 00 08 42 0B 00 27 63 4F 00 00 20 00 09 00 00 03 00 01 4C 00 01 01 00 40 15 07 2C 63 4F 00 00 1E 00 00 00 00 07 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 08 07 01 23 00 00 00 01 00 02 18 50 69 61 6E 6F 42 6F 20 31 5C 55 MonoMode1=0 ModulationWheelRange1=99 ModulationWheelTarget1=1 @@ -53,11 +53,11 @@ BreathControlTarget2=0 AftertouchRange2=99 AftertouchTarget2=0 BankNumber3=2 -VoiceNumber3=2 -MIDIChannel3=1 -Volume3=87 +VoiceNumber3=6 +MIDIChannel3=0 +Volume3=47 Pan3=0 -Detune3=2 +Detune3=0 Cutoff3=99 Resonance3=0 NoteLimitLow3=0 @@ -69,7 +69,7 @@ PitchBendStep3=0 PortamentoMode3=0 PortamentoGlissando3=0 PortamentoTime3=0 -VoiceData3=43 0B 0B 2A 63 58 00 00 02 00 4E 03 01 06 00 00 50 00 05 00 0E 45 0A 0D 2A 63 58 00 00 22 08 09 03 00 01 00 04 51 00 01 00 0B 4E 49 33 37 63 3A 00 00 33 0C 0B 03 03 01 00 02 5C 01 06 09 06 40 15 07 2C 63 4F 00 00 1E 00 00 00 00 07 00 03 63 00 01 00 08 42 0B 00 27 63 4F 00 00 20 00 09 00 00 03 00 01 4C 00 01 01 00 40 15 07 2C 63 4F 00 00 1E 00 00 00 00 07 00 02 63 00 01 00 03 63 63 63 63 32 32 32 32 08 07 01 23 00 00 00 01 00 02 18 50 69 61 6E 6F 42 6F 20 31 5C 55 +VoiceData3=5F 15 00 26 5C 3E 60 00 30 05 0A 03 00 04 00 01 55 00 01 00 07 4D 48 48 22 32 62 00 00 27 00 14 00 01 00 00 04 5F 01 02 00 0A 59 3C 17 23 63 5E 00 00 2E 03 02 03 03 03 00 01 5E 01 00 00 00 5F 1C 06 23 63 59 4B 00 05 00 63 00 01 02 00 06 4F 00 05 00 09 58 5C 47 3F 63 43 5B 5A 27 0C 14 03 00 02 00 01 5A 00 01 00 05 58 1C 1B 32 63 5A 00 00 11 63 05 03 00 02 00 03 63 00 01 00 07 00 00 00 00 32 32 32 32 0A 05 01 0E 05 00 00 00 00 01 18 41 31 31 50 6E 34 4D 46 78 64 74 MonoMode3=0 ModulationWheelRange3=99 ModulationWheelTarget3=1 diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 4e4ba11..136b47b 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -57,6 +57,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_bLoadPerformanceBusy(false) { assert (m_pConfig); + + m_bPerformanceProgramChange = m_pConfig->GetPerformanceProgramChange(); for (unsigned i = 0; i < CConfig::ToneGenerators; i++) { @@ -464,7 +466,7 @@ void CMiniDexed::ProgramChangePerformance (unsigned nProgram, unsigned nTG) { assert (m_pConfig); - if (m_pConfig-GetPerformanceProgramChange()) + if (m_bPerformanceProgramChange) { // Program Change messages change Performances. // @@ -1468,8 +1470,12 @@ unsigned CMiniDexed::GetLastPerformance() bool CMiniDexed::GetPerformanceProgramChange (void) { - assert (m_pConfig); - return m_pConfig->GetPerformanceProgramChange(); + return m_bPerformanceProgramChange; +} + +void CMiniDexed::SetPerformanceProgramChange (bool bPerfPC) +{ + m_bPerformanceProgramChange = bPerfPC; } unsigned CMiniDexed::GetActualPerformanceID() diff --git a/src/minidexed.h b/src/minidexed.h index 315cc15..f09c5ca 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -127,6 +127,7 @@ public: bool GetPerformanceSelectToLoad(void); bool SavePerformance (bool bSaveAsDeault); bool GetPerformanceProgramChange (void); + void SetPerformanceProgramChange (bool bPerfPC); // Must match the order in CUIMenu::TParameter enum TParameter @@ -139,6 +140,7 @@ public: ParameterReverbLowPass, ParameterReverbDiffusion, ParameterReverbLevel, + ParameterPerformanceProgramChange, ParameterUnknown }; @@ -307,6 +309,7 @@ private: unsigned m_nDeletePerformanceID; bool m_bLoadPerformanceBusy; bool m_bSaveAsDeault; + bool m_bPerformanceProgramChange; }; #endif diff --git a/src/uimenu.cpp b/src/uimenu.cpp index 7acce30..82652cf 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -324,7 +324,8 @@ const CUIMenu::TMenuItem CUIMenu::s_PerformanceMenu[] = { {"Load", PerformanceMenu, 0, 0}, {"Save", MenuHandler, s_SaveMenu}, - {"Delete", PerformanceMenu, 0, 1}, + {"Delete", PerformanceMenu, 0, 1}, + {"Program Change", EditPerformanceProgramChange, 0, 0}, {0} }; @@ -1208,21 +1209,23 @@ void CUIMenu::PgmUpDownHandler (TMenuEvent Event) // Program Up/Down acts on performances unsigned nLastPerformance = m_pMiniDexed->GetLastPerformance(); unsigned nPerformance = m_pMiniDexed->GetActualPerformanceID(); - LOGNOTE("Performance actual=%d, last=%d", nPerformance, nLastPerformance); + //LOGNOTE("Performance actual=%d, last=%d", nPerformance, nLastPerformance); if (Event == MenuEventPgmDown) { if (nPerformance > 0) { - m_pMiniDexed->SetNewPerformance(nPerformance-1); - LOGNOTE("Performance new=%d, last=%d", nPerformance-1, nLastPerformance); + m_nSelectedPerformanceID = nPerformance-1; + m_pMiniDexed->SetNewPerformance(m_nSelectedPerformanceID); + //LOGNOTE("Performance new=%d, last=%d", m_nSelectedPerformanceID, nLastPerformance); } } else { if (nPerformance < nLastPerformance-1) { - m_pMiniDexed->SetNewPerformance(nPerformance+1); - LOGNOTE("Performance new=%d, last=%d", nPerformance+1, nLastPerformance); + m_nSelectedPerformanceID = nPerformance+1; + m_pMiniDexed->SetNewPerformance(m_nSelectedPerformanceID); + //LOGNOTE("Performance new=%d, last=%d", m_nSelectedPerformanceID, nLastPerformance); } } } @@ -1230,10 +1233,10 @@ void CUIMenu::PgmUpDownHandler (TMenuEvent Event) { // Program Up/Down acts on voices within a TG. - // If we're on anything apart from the root menu, + // If we're not in the root menu, then see if we are already in a TG menu, // then find the current TG number. Otherwise assume TG1 (nTG=0). unsigned nTG = 0; - if (m_MenuStackMenu[0] == s_MainMenu) { + if (m_MenuStackMenu[0] == s_MainMenu && (m_pCurrentMenu == s_TGMenu) || (m_MenuStackMenu[1] == s_TGMenu)) { nTG = m_nMenuStackSelection[0]; } assert (nTG < CConfig::ToneGenerators); @@ -1487,6 +1490,39 @@ void CUIMenu::PerformanceMenu (CUIMenu *pUIMenu, TMenuEvent Event) } } +void CUIMenu::EditPerformanceProgramChange (CUIMenu *pUIMenu, TMenuEvent Event) +{ + bool bPerfPC = pUIMenu->m_pMiniDexed->GetPerformanceProgramChange(); + switch (Event) + { + case MenuEventUpdate: + break; + + case MenuEventStepDown: + case MenuEventStepUp: + bPerfPC = !bPerfPC; + pUIMenu->m_pMiniDexed->SetPerformanceProgramChange(bPerfPC); + break; + + default: + return; + } + + string PPC (" ="); + string Value; + if (bPerfPC) { + Value = "Performance"; + } else { + Value = "Voices"; + } + + pUIMenu->m_pUI->DisplayWrite (PPC.c_str (), + pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, + Value.c_str (), + true, true); +} + + void CUIMenu::InputTxt (CUIMenu *pUIMenu, TMenuEvent Event) { unsigned nTG=0; diff --git a/src/uimenu.h b/src/uimenu.h index 2b70cfe..059c1ae 100644 --- a/src/uimenu.h +++ b/src/uimenu.h @@ -91,6 +91,7 @@ private: static void EditTGParameterModulation (CUIMenu *pUIMenu, TMenuEvent Event); static void PerformanceMenu (CUIMenu *pUIMenu, TMenuEvent Event); static void SavePerformanceNewFile (CUIMenu *pUIMenu, TMenuEvent Event); + static void EditPerformanceProgramChange (CUIMenu *pUIMenu, TMenuEvent Event); static std::string GetGlobalValueString (unsigned nParameter, int nValue); static std::string GetTGValueString (unsigned nTGParameter, int nValue);