Add TGParameterEnabled

pull/743/head
Gergo Koteles 4 months ago
parent f654855c65
commit 98e9815c47
  1. 3
      src/mididevice.cpp
  2. 15
      src/minidexed.cpp
  3. 8
      src/minidexed.h
  4. 2
      src/uimenu.cpp

@ -319,6 +319,9 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
bool bSystemCCChecked = false; bool bSystemCCChecked = false;
for (unsigned nTG = 0; nTG < m_pConfig->GetToneGenerators() && !bSystemCCHandled; nTG++) for (unsigned nTG = 0; nTG < m_pConfig->GetToneGenerators() && !bSystemCCHandled; nTG++)
{ {
if (m_pSynthesizer->GetTGParameter (CMiniDexed::TGParameterEnabled, nTG) == 0)
continue;
if (ucStatus == MIDI_SYSTEM_EXCLUSIVE_BEGIN) if (ucStatus == MIDI_SYSTEM_EXCLUSIVE_BEGIN)
{ {
// MIDI SYSEX per MIDI channel // MIDI SYSEX per MIDI channel

@ -98,6 +98,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
m_nReverbSend[i] = 0; m_nReverbSend[i] = 0;
m_bEnabled[i] = 1;
// Active the required number of active TGs // Active the required number of active TGs
if (i<m_nToneGenerators) if (i<m_nToneGenerators)
{ {
@ -1033,6 +1035,7 @@ void CMiniDexed::SetTGParameter (TTGParameter Parameter, int nValue, unsigned nT
case TGParameterPortamentoGlissando: setPortamentoGlissando (nValue, nTG); break; case TGParameterPortamentoGlissando: setPortamentoGlissando (nValue, nTG); break;
case TGParameterPortamentoTime: setPortamentoTime (nValue, nTG); break; case TGParameterPortamentoTime: setPortamentoTime (nValue, nTG); break;
case TGParameterMonoMode: setMonoMode (nValue , nTG); break; case TGParameterMonoMode: setMonoMode (nValue , nTG); break;
case TGParameterEnabled: setEnabled (nValue, nTG); break;
case TGParameterMWRange: setModController(0, 0, nValue, nTG); break; case TGParameterMWRange: setModController(0, 0, nValue, nTG); break;
case TGParameterMWPitch: setModController(0, 1, nValue, nTG); break; case TGParameterMWPitch: setModController(0, 1, nValue, nTG); break;
@ -1090,6 +1093,7 @@ int CMiniDexed::GetTGParameter (TTGParameter Parameter, unsigned nTG)
case TGParameterPortamentoGlissando: return m_nPortamentoGlissando[nTG]; case TGParameterPortamentoGlissando: return m_nPortamentoGlissando[nTG];
case TGParameterPortamentoTime: return m_nPortamentoTime[nTG]; case TGParameterPortamentoTime: return m_nPortamentoTime[nTG];
case TGParameterMonoMode: return m_bMonoMode[nTG] ? 1 : 0; case TGParameterMonoMode: return m_bMonoMode[nTG] ? 1 : 0;
case TGParameterEnabled: return m_bEnabled[nTG] ? 1 : 0;
case TGParameterMWRange: return getModController(0, 0, nTG); case TGParameterMWRange: return getModController(0, 0, nTG);
case TGParameterMWPitch: return getModController(0, 1, nTG); case TGParameterMWPitch: return getModController(0, 1, nTG);
@ -1519,6 +1523,17 @@ void CMiniDexed::setMonoMode(uint8_t mono, uint8_t nTG)
m_UI.ParameterChanged (); m_UI.ParameterChanged ();
} }
void CMiniDexed::setEnabled (uint8_t enabled, uint8_t nTG)
{
assert (nTG < CConfig::AllToneGenerators);
if (nTG >= m_nToneGenerators) return; // Not an active TG
assert (m_pTG[nTG]);
m_bEnabled[nTG] = enabled != 0;
m_UI.ParameterChanged ();
}
void CMiniDexed::setPitchbendRange(uint8_t range, uint8_t nTG) void CMiniDexed::setPitchbendRange(uint8_t range, uint8_t nTG)
{ {
range = constrain (range, 0, 12); range = constrain (range, 0, 12);

@ -99,6 +99,7 @@ public:
void SetReverbSend (unsigned nReverbSend, unsigned nTG); // 0 .. 127 void SetReverbSend (unsigned nReverbSend, unsigned nTG); // 0 .. 127
void setMonoMode(uint8_t mono, uint8_t nTG); void setMonoMode(uint8_t mono, uint8_t nTG);
void setEnabled(uint8_t enabled, uint8_t nTG);
void setPitchbendRange(uint8_t range, uint8_t nTG); void setPitchbendRange(uint8_t range, uint8_t nTG);
void setPitchbendStep(uint8_t step, uint8_t nTG); void setPitchbendStep(uint8_t step, uint8_t nTG);
void setPortamentoMode(uint8_t mode, uint8_t nTG); void setPortamentoMode(uint8_t mode, uint8_t nTG);
@ -191,7 +192,9 @@ public:
TGParameterPortamentoGlissando, TGParameterPortamentoGlissando,
TGParameterPortamentoTime, TGParameterPortamentoTime,
TGParameterMonoMode, TGParameterMonoMode,
TGParameterEnabled,
TGParameterMWRange, TGParameterMWRange,
TGParameterMWPitch, TGParameterMWPitch,
TGParameterMWAmplitude, TGParameterMWAmplitude,
@ -274,7 +277,8 @@ private:
unsigned m_nPortamentoGlissando[CConfig::AllToneGenerators]; unsigned m_nPortamentoGlissando[CConfig::AllToneGenerators];
unsigned m_nPortamentoTime[CConfig::AllToneGenerators]; unsigned m_nPortamentoTime[CConfig::AllToneGenerators];
bool m_bMonoMode[CConfig::AllToneGenerators]; bool m_bMonoMode[CConfig::AllToneGenerators];
bool m_bEnabled[CConfig::AllToneGenerators];
unsigned m_nModulationWheelRange[CConfig::AllToneGenerators]; unsigned m_nModulationWheelRange[CConfig::AllToneGenerators];
unsigned m_nModulationWheelTarget[CConfig::AllToneGenerators]; unsigned m_nModulationWheelTarget[CConfig::AllToneGenerators];
unsigned m_nFootControlRange[CConfig::AllToneGenerators]; unsigned m_nFootControlRange[CConfig::AllToneGenerators];

@ -82,6 +82,7 @@ const CUIMenu::TMenuItem CUIMenu::s_TGMenu[] =
{"Pitch Bend", MenuHandler, s_EditPitchBendMenu}, {"Pitch Bend", MenuHandler, s_EditPitchBendMenu},
{"Portamento", MenuHandler, s_EditPortamentoMenu}, {"Portamento", MenuHandler, s_EditPortamentoMenu},
{"Poly/Mono", EditTGParameter, 0, CMiniDexed::TGParameterMonoMode}, {"Poly/Mono", EditTGParameter, 0, CMiniDexed::TGParameterMonoMode},
{"Enabled", EditTGParameter, 0, CMiniDexed::TGParameterEnabled},
{"Modulation", MenuHandler, s_ModulationMenu}, {"Modulation", MenuHandler, s_ModulationMenu},
{"Channel", EditTGParameter, 0, CMiniDexed::TGParameterMIDIChannel}, {"Channel", EditTGParameter, 0, CMiniDexed::TGParameterMIDIChannel},
{"Edit Voice", MenuHandler, s_EditVoiceMenu}, {"Edit Voice", MenuHandler, s_EditVoiceMenu},
@ -248,6 +249,7 @@ const CUIMenu::TParameter CUIMenu::s_TGParameter[CMiniDexed::TGParameterUnknown]
{0, 1, 1, ToPortaGlissando}, // TGParameterPortamentoGlissando {0, 1, 1, ToPortaGlissando}, // TGParameterPortamentoGlissando
{0, 99, 1}, // TGParameterPortamentoTime {0, 99, 1}, // TGParameterPortamentoTime
{0, 1, 1, ToPolyMono}, // TGParameterMonoMode {0, 1, 1, ToPolyMono}, // TGParameterMonoMode
{0, 1, 1, ToOnOff}, // TGParameterEnabled
{0, 99, 1}, //MW Range {0, 99, 1}, //MW Range
{0, 1, 1, ToOnOff}, //MW Pitch {0, 1, 1, ToOnOff}, //MW Pitch
{0, 1, 1, ToOnOff}, //MW Amp {0, 1, 1, ToOnOff}, //MW Amp

Loading…
Cancel
Save