From 85a4d9953b6527b2986632cbc5444bc8b1dd11a6 Mon Sep 17 00:00:00 2001 From: arsamus Date: Sun, 15 May 2022 05:01:14 -0300 Subject: [PATCH] Support for Portamento and Pitch Bender parameters (#206) Thanks @arsamus --- src/minidexed.cpp | 60 +++++++++++++++++++----- src/minidexed.h | 10 ++++ src/performance.ini | 45 ++++++++++++++++++ src/performanceconfig.cpp | 98 ++++++++++++++++++++++++++++++++++++++- src/performanceconfig.h | 17 ++++++- src/serialmididevice.cpp | 1 - src/uimenu.cpp | 98 ++++++++++++++++++++++++++++++++++++++- src/uimenu.h | 7 ++- 8 files changed, 319 insertions(+), 17 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 80393f0..21e79f1 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -63,6 +63,11 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_nCutoff[i] = 99; m_nResonance[i] = 0; m_nMIDIChannel[i] = CMIDIDevice::Disabled; + m_nPitchBendRange[i] = 2; + m_nPitchBendStep[i] = 0; + m_nPortamentoMode[i] = 0; + m_nPortamentoGlissando[i] = 0; + m_nPortamentoTime[i] = 0; m_nNoteLimitLow[i] = 0; m_nNoteLimitHigh[i] = 127; @@ -166,7 +171,7 @@ bool CMiniDexed::Initialize (void) m_pTG[i]->setTranspose (24); - m_pTG[i]->setPBController (12, 1); + m_pTG[i]->setPBController (2, 0); m_pTG[i]->setMWController (99, 7, 0); tg_mixer->pan(i,mapfloat(m_nPan[i],0,127,0.0f,1.0f)); @@ -187,6 +192,11 @@ bool CMiniDexed::Initialize (void) SetMasterTune (m_PerformanceConfig.GetDetune (nTG), nTG); SetCutoff (m_PerformanceConfig.GetCutoff (nTG), nTG); SetResonance (m_PerformanceConfig.GetResonance (nTG), nTG); + setPitchbendRange (m_PerformanceConfig.GetPitchBendRange (nTG), nTG); + setPitchbendStep (m_PerformanceConfig.GetPitchBendStep (nTG), nTG); + setPortamentoMode (m_PerformanceConfig.GetPortamentoMode (nTG), nTG); + setPortamentoGlissando (m_PerformanceConfig.GetPortamentoGlissando (nTG), nTG); + setPortamentoTime (m_PerformanceConfig.GetPortamentoTime (nTG), nTG); m_nNoteLimitLow[nTG] = m_PerformanceConfig.GetNoteLimitLow (nTG); m_nNoteLimitHigh[nTG] = m_PerformanceConfig.GetNoteLimitHigh (nTG); @@ -434,6 +444,8 @@ void CMiniDexed::SetResonance (int nResonance, unsigned nTG) m_UI.ParameterChanged (); } + + void CMiniDexed::SetMIDIChannel (uint8_t uchChannel, unsigned nTG) { assert (nTG < CConfig::ToneGenerators); @@ -652,6 +664,11 @@ void CMiniDexed::SetTGParameter (TTGParameter Parameter, int nValue, unsigned nT case TGParameterMasterTune: SetMasterTune (nValue, nTG); break; case TGParameterCutoff: SetCutoff (nValue, nTG); break; case TGParameterResonance: SetResonance (nValue, nTG); break; + case TGParameterPitchBendRange: setPitchbendRange (nValue, nTG); break; + case TGParameterPitchBendStep: setPitchbendStep (nValue, nTG); break; + case TGParameterPortamentoMode: setPortamentoMode (nValue, nTG); break; + case TGParameterPortamentoGlissando: setPortamentoGlissando (nValue, nTG); break; + case TGParameterPortamentoTime: setPortamentoTime (nValue, nTG); break; case TGParameterMIDIChannel: assert (0 <= nValue && nValue <= 255); @@ -681,6 +698,11 @@ int CMiniDexed::GetTGParameter (TTGParameter Parameter, unsigned nTG) case TGParameterResonance: return m_nResonance[nTG]; case TGParameterMIDIChannel: return m_nMIDIChannel[nTG]; case TGParameterReverbSend: return m_nReverbSend[nTG]; + case TGParameterPitchBendRange: return m_nPitchBendRange[nTG]; + case TGParameterPitchBendStep: return m_nPitchBendStep[nTG]; + case TGParameterPortamentoMode: return m_nPortamentoMode[nTG]; + case TGParameterPortamentoGlissando: return m_nPortamentoGlissando[nTG]; + case TGParameterPortamentoTime: return m_nPortamentoTime[nTG]; default: assert (0); @@ -922,6 +944,11 @@ bool CMiniDexed::SavePerformance (void) m_PerformanceConfig.SetDetune (m_nMasterTune[nTG], nTG); m_PerformanceConfig.SetCutoff (m_nCutoff[nTG], nTG); m_PerformanceConfig.SetResonance (m_nResonance[nTG], nTG); + m_PerformanceConfig.SetPitchBendRange (m_nPitchBendRange[nTG], nTG); + m_PerformanceConfig.SetPitchBendStep (m_nPitchBendStep[nTG], nTG); + m_PerformanceConfig.SetPortamentoMode (m_nPortamentoMode[nTG], nTG); + m_PerformanceConfig.SetPortamentoGlissando (m_nPortamentoGlissando[nTG], nTG); + m_PerformanceConfig.SetPortamentoTime (m_nPortamentoTime[nTG], nTG); m_PerformanceConfig.SetNoteLimitLow (m_nNoteLimitLow[nTG], nTG); m_PerformanceConfig.SetNoteLimitHigh (m_nNoteLimitHigh[nTG], nTG); @@ -954,50 +981,61 @@ void CMiniDexed::setMonoMode(uint8_t mono, uint8_t nTG) void CMiniDexed::setPitchbendRange(uint8_t range, uint8_t nTG) { + range = constrain (range, 0, 12); assert (nTG < CConfig::ToneGenerators); assert (m_pTG[nTG]); - - m_pTG[nTG]->setPitchbendRange(constrain(range, 0, 12)); + m_nPitchBendRange[nTG] = range; + + m_pTG[nTG]->setPitchbendRange(range); m_pTG[nTG]->ControllersRefresh(); m_UI.ParameterChanged (); } void CMiniDexed::setPitchbendStep(uint8_t step, uint8_t nTG) { + step= constrain (step, 0, 12); assert (nTG < CConfig::ToneGenerators); assert (m_pTG[nTG]); - - m_pTG[nTG]->setPitchbendStep(constrain(step, 0, 12)); + m_nPitchBendStep[nTG] = step; + + m_pTG[nTG]->setPitchbendStep(step); m_pTG[nTG]->ControllersRefresh(); m_UI.ParameterChanged (); } void CMiniDexed::setPortamentoMode(uint8_t mode, uint8_t nTG) { + mode= constrain (mode, 0, 1); + assert (nTG < CConfig::ToneGenerators); assert (m_pTG[nTG]); - - m_pTG[nTG]->setPortamentoMode(constrain(mode, 0, 1)); + m_nPortamentoMode[nTG] = mode; + + m_pTG[nTG]->setPortamentoMode(mode); m_pTG[nTG]->ControllersRefresh(); m_UI.ParameterChanged (); } void CMiniDexed::setPortamentoGlissando(uint8_t glissando, uint8_t nTG) { + glissando = constrain (glissando, 0, 1); assert (nTG < CConfig::ToneGenerators); assert (m_pTG[nTG]); - - m_pTG[nTG]->setPortamentoGlissando(constrain(glissando, 0, 1)); + m_nPortamentoGlissando[nTG] = glissando; + + m_pTG[nTG]->setPortamentoGlissando(glissando); m_pTG[nTG]->ControllersRefresh(); m_UI.ParameterChanged (); } void CMiniDexed::setPortamentoTime(uint8_t time, uint8_t nTG) { + time = constrain (time, 0, 99); assert (nTG < CConfig::ToneGenerators); assert (m_pTG[nTG]); - - m_pTG[nTG]->setPortamentoTime(constrain(time, 0, 99)); + m_nPortamentoTime[nTG] = time; + + m_pTG[nTG]->setPortamentoTime(time); m_pTG[nTG]->ControllersRefresh(); m_UI.ParameterChanged (); } diff --git a/src/minidexed.h b/src/minidexed.h index 4aeb42f..66beb35 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -130,6 +130,11 @@ public: TGParameterResonance, TGParameterMIDIChannel, TGParameterReverbSend, + TGParameterPitchBendRange, + TGParameterPitchBendStep, + TGParameterPortamentoMode, + TGParameterPortamentoGlissando, + TGParameterPortamentoTime, TGParameterUnknown }; @@ -177,6 +182,11 @@ private: int m_nCutoff[CConfig::ToneGenerators]; int m_nResonance[CConfig::ToneGenerators]; unsigned m_nMIDIChannel[CConfig::ToneGenerators]; + unsigned m_nPitchBendRange[CConfig::ToneGenerators]; + unsigned m_nPitchBendStep[CConfig::ToneGenerators]; + unsigned m_nPortamentoMode[CConfig::ToneGenerators]; + unsigned m_nPortamentoGlissando[CConfig::ToneGenerators]; + unsigned m_nPortamentoTime[CConfig::ToneGenerators]; unsigned m_nNoteLimitLow[CConfig::ToneGenerators]; unsigned m_nNoteLimitHigh[CConfig::ToneGenerators]; diff --git a/src/performance.ini b/src/performance.ini index d1fcff1..bdd3d66 100644 --- a/src/performance.ini +++ b/src/performance.ini @@ -15,6 +15,11 @@ #NoteLimitHigh#=127 # 0 .. 127, C-2 .. G8 #NoteShift#=0 # -24 .. 24 #ReverbSend#=0 # 0 .. 99 +#PitchBendRange#=2 # 0 .. 12 +#PitchBendStep#=0 # 0 .. 12 +#PortamentoMode#=0 # 0 .. 1 +#PortamentoGlissando#=0 # 0 .. 1 +#PortamentoTime#=0 # 0 .. 99 # TG1 BankNumber1=0 @@ -29,6 +34,11 @@ NoteLimitLow1=0 NoteLimitHigh1=127 NoteShift1=0 ReverbSend1=99 +PitchBendRange1=2 +PitchBendStep1=0 +PortamentoMode1=0 +PortamentoGlissando1=0 +PortamentoTime1=0 # TG2 BankNumber2=0 @@ -43,6 +53,11 @@ NoteLimitLow2=0 NoteLimitHigh2=127 NoteShift2=0 ReverbSend2=70 +PitchBendRange2=2 +PitchBendStep2=0 +PortamentoMode2=0 +PortamentoGlissando2=0 +PortamentoTime2=0 # TG3 BankNumber3=0 @@ -57,6 +72,11 @@ NoteLimitLow3=0 NoteLimitHigh3=127 NoteShift3=0 ReverbSend3=0 +PitchBendRange3=2 +PitchBendStep3=0 +PortamentoMode3=0 +PortamentoGlissando3=0 +PortamentoTime3=0 # TG4 BankNumber4=0 @@ -71,6 +91,11 @@ NoteLimitLow4=0 NoteLimitHigh4=127 NoteShift4=0 ReverbSend4=0 +PitchBendRange4=2 +PitchBendStep4=0 +PortamentoMode4=0 +PortamentoGlissando4=0 +PortamentoTime4=0 # TG5 BankNumber5=0 @@ -85,6 +110,11 @@ NoteLimitLow5=0 NoteLimitHigh5=127 NoteShift5=0 ReverbSend5=0 +PitchBendRange5=2 +PitchBendStep5=0 +PortamentoMode5=0 +PortamentoGlissando5=0 +PortamentoTime5=0 # TG6 BankNumber6=0 @@ -99,6 +129,11 @@ NoteLimitLow6=0 NoteLimitHigh6=127 NoteShift6=0 ReverbSend6=0 +PitchBendRange6=2 +PitchBendStep6=0 +PortamentoMode6=0 +PortamentoGlissando6=0 +PortamentoTime6=0 # TG7 BankNumber7=0 @@ -113,6 +148,11 @@ NoteLimitLow7=0 NoteLimitHigh7=127 NoteShift7=0 ReverbSend7=0 +PitchBendRange7=2 +PitchBendStep7=0 +PortamentoMode7=0 +PortamentoGlissando7=0 +PortamentoTime7=0 # TG8 BankNumber8=0 @@ -127,6 +167,11 @@ NoteLimitLow8=0 NoteLimitHigh8=127 NoteShift8=0 ReverbSend8=0 +PitchBendRange8=2 +PitchBendStep8=0 +PortamentoMode8=0 +PortamentoGlissando8=0 +PortamentoTime8=0 # Effects #CompressorEnable=1 # 0: off, 1: on diff --git a/src/performanceconfig.cpp b/src/performanceconfig.cpp index 1204103..5c381ec 100644 --- a/src/performanceconfig.cpp +++ b/src/performanceconfig.cpp @@ -98,7 +98,22 @@ bool CPerformanceConfig::Load (void) PropertyName.Format ("ReverbSend%u", nTG+1); m_nReverbSend[nTG] = m_Properties.GetNumber (PropertyName, 50); - } + + PropertyName.Format ("PitchBendRange%u", nTG+1); + m_nPitchBendRange[nTG] = m_Properties.GetNumber (PropertyName, 2); + + PropertyName.Format ("PitchBendStep%u", nTG+1); + m_nPitchBendStep[nTG] = m_Properties.GetNumber (PropertyName, 0); + + PropertyName.Format ("PortamentoMode%u", nTG+1); + m_nPortamentoMode[nTG] = m_Properties.GetNumber (PropertyName, 0); + + PropertyName.Format ("PortamentoGlissando%u", nTG+1); + m_nPortamentoGlissando[nTG] = m_Properties.GetNumber (PropertyName, 0); + + PropertyName.Format ("PortamentoTime%u", nTG+1); + m_nPortamentoTime[nTG] = m_Properties.GetNumber (PropertyName, 0); + } m_bCompressorEnable = m_Properties.GetNumber ("CompressorEnable", 1) != 0; @@ -169,7 +184,22 @@ bool CPerformanceConfig::Save (void) PropertyName.Format ("ReverbSend%u", nTG+1); m_Properties.SetNumber (PropertyName, m_nReverbSend[nTG]); - } + + PropertyName.Format ("PitchBendRange%u", nTG+1); + m_Properties.SetNumber (PropertyName, m_nPitchBendRange[nTG]); + + PropertyName.Format ("PitchBendStep%u", nTG+1); + m_Properties.SetNumber (PropertyName, m_nPitchBendStep[nTG]); + + PropertyName.Format ("PortamentoMode%u", nTG+1); + m_Properties.SetNumber (PropertyName, m_nPortamentoMode[nTG]); + + PropertyName.Format ("PortamentoGlissando%u", nTG+1); + m_Properties.SetNumber (PropertyName, m_nPortamentoGlissando[nTG]); + + PropertyName.Format ("PortamentoTime%u", nTG+1); + m_Properties.SetNumber (PropertyName, m_nPortamentoTime[nTG]); + } m_Properties.SetNumber ("CompressorEnable", m_bCompressorEnable ? 1 : 0); @@ -407,3 +437,67 @@ void CPerformanceConfig::SetReverbLevel (unsigned nValue) { m_nReverbLevel = nValue; } +// Pitch bender and portamento: +void CPerformanceConfig::SetPitchBendRange (unsigned nValue, unsigned nTG) +{ + assert (nTG < CConfig::ToneGenerators); + m_nPitchBendRange[nTG] = nValue; +} + +unsigned CPerformanceConfig::GetPitchBendRange (unsigned nTG) const +{ + assert (nTG < CConfig::ToneGenerators); + return m_nPitchBendRange[nTG]; +} + + +void CPerformanceConfig::SetPitchBendStep (unsigned nValue, unsigned nTG) +{ + assert (nTG < CConfig::ToneGenerators); + m_nPitchBendStep[nTG] = nValue; +} + +unsigned CPerformanceConfig::GetPitchBendStep (unsigned nTG) const +{ + assert (nTG < CConfig::ToneGenerators); + return m_nPitchBendStep[nTG]; +} + + +void CPerformanceConfig::SetPortamentoMode (unsigned nValue, unsigned nTG) +{ + assert (nTG < CConfig::ToneGenerators); + m_nPortamentoMode[nTG] = nValue; +} + +unsigned CPerformanceConfig::GetPortamentoMode (unsigned nTG) const +{ + assert (nTG < CConfig::ToneGenerators); + return m_nPortamentoMode[nTG]; +} + + +void CPerformanceConfig::SetPortamentoGlissando (unsigned nValue, unsigned nTG) +{ + assert (nTG < CConfig::ToneGenerators); + m_nPortamentoGlissando[nTG] = nValue; +} + +unsigned CPerformanceConfig::GetPortamentoGlissando (unsigned nTG) const +{ + assert (nTG < CConfig::ToneGenerators); + return m_nPortamentoGlissando[nTG]; +} + + +void CPerformanceConfig::SetPortamentoTime (unsigned nValue, unsigned nTG) +{ + assert (nTG < CConfig::ToneGenerators); + m_nPortamentoTime[nTG] = nValue; +} + +unsigned CPerformanceConfig::GetPortamentoTime (unsigned nTG) const +{ + assert (nTG < CConfig::ToneGenerators); + return m_nPortamentoTime[nTG]; +} diff --git a/src/performanceconfig.h b/src/performanceconfig.h index 2d18344..bf7617a 100644 --- a/src/performanceconfig.h +++ b/src/performanceconfig.h @@ -50,7 +50,12 @@ public: unsigned GetNoteLimitHigh (unsigned nTG) const; // 0 .. 127 int GetNoteShift (unsigned nTG) const; // -24 .. 24 unsigned GetReverbSend (unsigned nTG) const; // 0 .. 127 - + unsigned GetPitchBendRange (unsigned nTG) const; // 0 .. 12 + unsigned GetPitchBendStep (unsigned nTG) const; // 0 .. 12 + unsigned GetPortamentoMode (unsigned nTG) const; // 0 .. 1 + unsigned GetPortamentoGlissando (unsigned nTG) const; // 0 .. 1 + unsigned GetPortamentoTime (unsigned nTG) const; // 0 .. 99 + void SetBankNumber (unsigned nValue, unsigned nTG); void SetVoiceNumber (unsigned nValue, unsigned nTG); void SetMIDIChannel (unsigned nValue, unsigned nTG); @@ -63,6 +68,11 @@ public: void SetNoteLimitHigh (unsigned nValue, unsigned nTG); void SetNoteShift (int nValue, unsigned nTG); void SetReverbSend (unsigned nValue, unsigned nTG); + void SetPitchBendRange (unsigned nValue, unsigned nTG); + void SetPitchBendStep (unsigned nValue, unsigned nTG); + void SetPortamentoMode (unsigned nValue, unsigned nTG); + void SetPortamentoGlissando (unsigned nValue, unsigned nTG); + void SetPortamentoTime (unsigned nValue, unsigned nTG); // Effects bool GetCompressorEnable (void) const; @@ -98,6 +108,11 @@ private: unsigned m_nNoteLimitHigh[CConfig::ToneGenerators]; int m_nNoteShift[CConfig::ToneGenerators]; int m_nReverbSend[CConfig::ToneGenerators]; + unsigned m_nPitchBendRange[CConfig::ToneGenerators]; + unsigned m_nPitchBendStep[CConfig::ToneGenerators]; + unsigned m_nPortamentoMode[CConfig::ToneGenerators]; + unsigned m_nPortamentoGlissando[CConfig::ToneGenerators]; + unsigned m_nPortamentoTime[CConfig::ToneGenerators]; bool m_bCompressorEnable; bool m_bReverbEnable; diff --git a/src/serialmididevice.cpp b/src/serialmididevice.cpp index 3d44699..ec819d0 100644 --- a/src/serialmididevice.cpp +++ b/src/serialmididevice.cpp @@ -157,7 +157,6 @@ void CSerialMIDIDevice::Process (void) } } } - void CSerialMIDIDevice::Send (const u8 *pMessage, size_t nLength, unsigned nCable) { m_SendBuffer.Write (pMessage, nLength); diff --git a/src/uimenu.cpp b/src/uimenu.cpp index 51344d9..c12bd39 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -68,6 +68,8 @@ const CUIMenu::TMenuItem CUIMenu::s_TGMenu[] = {"Detune", EditTGParameter, 0, CMiniDexed::TGParameterMasterTune}, {"Cutoff", EditTGParameter, 0, CMiniDexed::TGParameterCutoff}, {"Resonance", EditTGParameter, 0, CMiniDexed::TGParameterResonance}, + {"Pitch Bend", MenuHandler, s_EditPitchBendMenu}, + {"Portamento", MenuHandler, s_EditPortamentoMenu}, {"Channel", EditTGParameter, 0, CMiniDexed::TGParameterMIDIChannel}, {"Edit Voice", MenuHandler, s_EditVoiceMenu}, {0} @@ -82,6 +84,21 @@ const CUIMenu::TMenuItem CUIMenu::s_EffectsMenu[] = {0} }; +const CUIMenu::TMenuItem CUIMenu::s_EditPitchBendMenu[] = +{ + {"Bend Range", EditTGParameter2, 0, CMiniDexed::TGParameterPitchBendRange}, + {"Bend Step", EditTGParameter2, 0, CMiniDexed::TGParameterPitchBendStep}, + {0} +}; + +const CUIMenu::TMenuItem CUIMenu::s_EditPortamentoMenu[] = +{ + {"Mode", EditTGParameter2, 0, CMiniDexed::TGParameterPortamentoMode}, + {"Glissando", EditTGParameter2, 0, CMiniDexed::TGParameterPortamentoGlissando}, + {"Time", EditTGParameter2, 0, CMiniDexed::TGParameterPortamentoTime}, + {0} +}; + #ifdef ARM_ALLOW_MULTI_CORE const CUIMenu::TMenuItem CUIMenu::s_ReverbMenu[] = @@ -186,7 +203,12 @@ const CUIMenu::TParameter CUIMenu::s_TGParameter[CMiniDexed::TGParameterUnknown] {0, 99, 1}, // TGParameterCutoff {0, 99, 1}, // TGParameterResonance {0, CMIDIDevice::ChannelUnknown-1, 1, ToMIDIChannel}, // TGParameterMIDIChannel - {0, 99, 1} // TGParameterReverbSend + {0, 99, 1}, // TGParameterReverbSend + {0, 12, 1}, // TGParameterPitchBendRange + {0, 12, 1}, // TGParameterPitchBendStep + {0, 1, 1, ToPortaMode}, // TGParameterPortamentoMode + {0, 1, 1, ToPortaGlissando}, // TGParameterPortamentoGlissando + {0, 99, 1} // TGParameterPortamentoTime }; // must match DexedVoiceParameters in Synth_Dexed @@ -559,6 +581,60 @@ void CUIMenu::EditTGParameter (CUIMenu *pUIMenu, TMenuEvent Event) nValue > rParam.Minimum, nValue < rParam.Maximum); } +void CUIMenu::EditTGParameter2 (CUIMenu *pUIMenu, TMenuEvent Event) // second menu level. Redundant code but in order to not modified original code +{ + + unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-2]; + + CMiniDexed::TTGParameter Param = (CMiniDexed::TTGParameter) pUIMenu->m_nCurrentParameter; + const TParameter &rParam = s_TGParameter[Param]; + + int nValue = pUIMenu->m_pMiniDexed->GetTGParameter (Param, nTG); + + switch (Event) + { + case MenuEventUpdate: + break; + + case MenuEventStepDown: + nValue -= rParam.Increment; + if (nValue < rParam.Minimum) + { + nValue = rParam.Minimum; + } + pUIMenu->m_pMiniDexed->SetTGParameter (Param, nValue, nTG); + break; + + case MenuEventStepUp: + nValue += rParam.Increment; + if (nValue > rParam.Maximum) + { + nValue = rParam.Maximum; + } + pUIMenu->m_pMiniDexed->SetTGParameter (Param, nValue, nTG); + break; + + case MenuEventPressAndStepDown: + case MenuEventPressAndStepUp: + pUIMenu->TGShortcutHandler (Event); + return; + + default: + return; + } + + string TG ("TG"); + TG += to_string (nTG+1); + + string Value = GetTGValueString (Param, pUIMenu->m_pMiniDexed->GetTGParameter (Param, nTG)); + + pUIMenu->m_pUI->DisplayWrite (TG.c_str (), + pUIMenu->m_pParentMenu[pUIMenu->m_nCurrentMenuItem].Name, + Value.c_str (), + nValue > rParam.Minimum, nValue < rParam.Maximum); + +} + void CUIMenu::EditVoiceParameter (CUIMenu *pUIMenu, TMenuEvent Event) { unsigned nTG = pUIMenu->m_nMenuStackParameter[pUIMenu->m_nCurrentMenuDepth-2]; @@ -922,6 +998,26 @@ string CUIMenu::ToOscillatorDetune (int nValue) return Result; } +string CUIMenu::ToPortaMode (int nValue) +{ + switch (nValue) + { + case 0: return "Fingered"; + case 1: return "Full time"; + default: return to_string (nValue); + } +}; + +string CUIMenu::ToPortaGlissando (int nValue) +{ + switch (nValue) + { + case 0: return "Off"; + case 1: return "On"; + default: return to_string (nValue); + } +}; + void CUIMenu::TGShortcutHandler (TMenuEvent Event) { assert (m_nCurrentMenuDepth >= 2); diff --git a/src/uimenu.h b/src/uimenu.h index f48f659..b130e4c 100644 --- a/src/uimenu.h +++ b/src/uimenu.h @@ -83,6 +83,7 @@ private: static void EditVoiceParameter (CUIMenu *pUIMenu, TMenuEvent Event); static void EditOPParameter (CUIMenu *pUIMenu, TMenuEvent Event); static void SavePerformance (CUIMenu *pUIMenu, TMenuEvent Event); + static void EditTGParameter2 (CUIMenu *pUIMenu, TMenuEvent Event); static std::string GetGlobalValueString (unsigned nParameter, int nValue); static std::string GetTGValueString (unsigned nTGParameter, int nValue); @@ -101,6 +102,8 @@ private: static std::string ToKeyboardCurve (int nValue); static std::string ToOscillatorMode (int nValue); static std::string ToOscillatorDetune (int nValue); + static std::string ToPortaMode (int nValue); + static std::string ToPortaGlissando (int nValue); void TGShortcutHandler (TMenuEvent Event); void OPShortcutHandler (TMenuEvent Event); @@ -132,7 +135,9 @@ private: static const TMenuItem s_EditVoiceMenu[]; static const TMenuItem s_OperatorMenu[]; static const TMenuItem s_SaveMenu[]; - + static const TMenuItem s_EditPitchBendMenu[]; + static const TMenuItem s_EditPortamentoMenu[]; + static const TParameter s_GlobalParameter[]; static const TParameter s_TGParameter[]; static const TParameter s_VoiceParameter[];