diff --git a/src/mididevice.cpp b/src/mididevice.cpp index 05ee91e8..64297e1f 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -289,6 +289,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 9e144998..0beea890 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 cc625349..72f43c7f 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -98,6 +98,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); @@ -190,7 +191,9 @@ class CMiniDexed TGParameterPortamentoGlissando, TGParameterPortamentoTime, TGParameterMonoMode, - + + TGParameterEnabled, + TGParameterMWRange, TGParameterMWPitch, TGParameterMWAmplitude, @@ -273,7 +276,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 ed36cd4c..9a1fa4b9 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