From 98e9815c47c07a52fedd15f9a8a4bbdbabcdef55 Mon Sep 17 00:00:00 2001 From: Gergo Koteles Date: Tue, 10 Dec 2024 04:02:58 +0100 Subject: [PATCH] Add TGParameterEnabled --- src/mididevice.cpp | 3 +++ src/minidexed.cpp | 15 +++++++++++++++ src/minidexed.h | 8 ++++++-- src/uimenu.cpp | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/mididevice.cpp b/src/mididevice.cpp index d6ffc755..20215d25 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -319,6 +319,9 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign bool bSystemCCChecked = false; 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) { // MIDI SYSEX per MIDI channel diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 05fb0fad..c29fbb84 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -98,6 +98,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_nReverbSend[i] = 0; + m_bEnabled[i] = 1; + // Active the required number of active TGs if (i= 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) { range = constrain (range, 0, 12); diff --git a/src/minidexed.h b/src/minidexed.h index 5845d3b9..66e53ded 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -99,6 +99,7 @@ class CMiniDexed void SetReverbSend (unsigned nReverbSend, unsigned nTG); // 0 .. 127 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 setPitchbendStep(uint8_t step, uint8_t nTG); void setPortamentoMode(uint8_t mode, uint8_t nTG); @@ -191,7 +192,9 @@ class CMiniDexed TGParameterPortamentoGlissando, TGParameterPortamentoTime, TGParameterMonoMode, - + + TGParameterEnabled, + TGParameterMWRange, TGParameterMWPitch, TGParameterMWAmplitude, @@ -274,7 +277,8 @@ class CMiniDexed unsigned m_nPortamentoGlissando[CConfig::AllToneGenerators]; unsigned m_nPortamentoTime[CConfig::AllToneGenerators]; bool m_bMonoMode[CConfig::AllToneGenerators]; - + bool m_bEnabled[CConfig::AllToneGenerators]; + unsigned m_nModulationWheelRange[CConfig::AllToneGenerators]; unsigned m_nModulationWheelTarget[CConfig::AllToneGenerators]; unsigned m_nFootControlRange[CConfig::AllToneGenerators]; diff --git a/src/uimenu.cpp b/src/uimenu.cpp index efaf21f6..bcef4237 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -82,6 +82,7 @@ const CUIMenu::TMenuItem CUIMenu::s_TGMenu[] = {"Pitch Bend", MenuHandler, s_EditPitchBendMenu}, {"Portamento", MenuHandler, s_EditPortamentoMenu}, {"Poly/Mono", EditTGParameter, 0, CMiniDexed::TGParameterMonoMode}, + {"Enabled", EditTGParameter, 0, CMiniDexed::TGParameterEnabled}, {"Modulation", MenuHandler, s_ModulationMenu}, {"Channel", EditTGParameter, 0, CMiniDexed::TGParameterMIDIChannel}, {"Edit Voice", MenuHandler, s_EditVoiceMenu}, @@ -248,6 +249,7 @@ const CUIMenu::TParameter CUIMenu::s_TGParameter[CMiniDexed::TGParameterUnknown] {0, 1, 1, ToPortaGlissando}, // TGParameterPortamentoGlissando {0, 99, 1}, // TGParameterPortamentoTime {0, 1, 1, ToPolyMono}, // TGParameterMonoMode + {0, 1, 1, ToOnOff}, // TGParameterEnabled {0, 99, 1}, //MW Range {0, 1, 1, ToOnOff}, //MW Pitch {0, 1, 1, ToOnOff}, //MW Amp