Skip to content

Commit

Permalink
add hold mode
Browse files Browse the repository at this point in the history
  • Loading branch information
soyersoyer committed Jan 10, 2025
1 parent 04bb1c2 commit 7c15a25
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mididevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ LOGMODULE ("mididevice");
#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
Expand Down Expand Up @@ -425,6 +426,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;
Expand Down
9 changes: 9 additions & 0 deletions src/minidexed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,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);
Expand Down
1 change: 1 addition & 0 deletions src/minidexed.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class CMiniDexed

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);
Expand Down

0 comments on commit 7c15a25

Please sign in to comment.