diff --git a/src/midi.h b/src/midi.h index 4538df7..e106a3a 100644 --- a/src/midi.h +++ b/src/midi.h @@ -30,11 +30,15 @@ #define MIDI_CC_MODULATION 1 #define MIDI_CC_BREATH_CONTROLLER 2 #define MIDI_CC_FOOT_PEDAL 4 +#define MIDI_CC_PORTAMENTO_TIME 5 #define MIDI_CC_VOLUME 7 #define MIDI_CC_PAN_POSITION 10 #define MIDI_CC_EXPRESSION 11 #define MIDI_CC_BANK_SELECT_LSB 32 #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 c5e23ae..7d3b4a0 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -386,6 +386,10 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign m_pSynthesizer->ControllersRefresh (nTG); break; + case MIDI_CC_PORTAMENTO_TIME: + m_pSynthesizer->setPortamentoTime (maplong (pMessage[2], 0, 127, 0, 99), nTG); + break; + case MIDI_CC_BREATH_CONTROLLER: m_pSynthesizer->setBreathController (pMessage[2], nTG); m_pSynthesizer->ControllersRefresh (nTG); @@ -417,6 +421,18 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign case MIDI_CC_BANK_SUSTAIN: m_pSynthesizer->setSustain (pMessage[2] >= 64, nTG); break; + + case MIDI_CC_SOSTENUTO: + m_pSynthesizer->setSostenuto (pMessage[2] >= 64, nTG); + break; + + case MIDI_CC_PORTAMENTO: + 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); diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 674fbb3..0063b11 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -899,6 +899,24 @@ void CMiniDexed::setSustain(bool sustain, unsigned nTG) m_pTG[nTG]->setSustain (sustain); } +void CMiniDexed::setSostenuto(bool sostenuto, unsigned nTG) +{ + assert (nTG < CConfig::AllToneGenerators); + if (nTG >= m_nToneGenerators) return; // Not an active TG + + assert (m_pTG[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 4193ad8..b1622d0 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -93,6 +93,8 @@ public: void keydown (int16_t pitch, uint8_t velocity, unsigned nTG); 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);