diff --git a/src/midi.h b/src/midi.h index 19a94c2..e106a3a 100644 --- a/src/midi.h +++ b/src/midi.h @@ -38,6 +38,7 @@ #define MIDI_CC_BANK_SUSTAIN 64 #define MIDI_CC_PORTAMENTO 65 #define MIDI_CC_SOSTENUTO 66 +#define MIDI_CC_HOLD2 69 #define MIDI_CC_RESONANCE 71 #define MIDI_CC_FREQUENCY_CUTOFF 74 #define MIDI_CC_REVERB_LEVEL 91 diff --git a/src/mididevice.cpp b/src/mididevice.cpp index 1d11e4f..7d3b4a0 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -430,6 +430,10 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign m_pSynthesizer->setPortamentoMode (pMessage[2] >= 64, nTG); break; + case MIDI_CC_HOLD2: + m_pSynthesizer->setHoldMode (pMessage[2] >= 64, nTG); + break; + case MIDI_CC_RESONANCE: m_pSynthesizer->SetResonance (maplong (pMessage[2], 0, 127, 0, 99), nTG); break; diff --git a/src/minidexed.cpp b/src/minidexed.cpp index ff7116e..0063b11 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -908,6 +908,15 @@ void CMiniDexed::setSostenuto(bool sostenuto, unsigned nTG) m_pTG[nTG]->setSostenuto (sostenuto); } +void CMiniDexed::setHoldMode(bool holdmode, unsigned nTG) +{ + assert (nTG < CConfig::AllToneGenerators); + if (nTG >= m_nToneGenerators) return; // Not an active TG + + assert (m_pTG[nTG]); + m_pTG[nTG]->setHold (holdmode); +} + void CMiniDexed::panic(uint8_t value, unsigned nTG) { assert (nTG < CConfig::AllToneGenerators); diff --git a/src/minidexed.h b/src/minidexed.h index 86b3199..b1622d0 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -94,6 +94,7 @@ public: void setSustain (bool sustain, unsigned nTG); void setSostenuto (bool sostenuto, unsigned nTG); + void setHoldMode(bool holdmode, unsigned nTG); void panic (uint8_t value, unsigned nTG); void notesOff (uint8_t value, unsigned nTG); void setModWheel (uint8_t value, unsigned nTG);