Update performance config when new voice is received via SysEx

md-perf
probonopd 7 days ago
parent d5d8ccd9f8
commit 3ce4445067
  1. 8
      src/mididevice.cpp
  2. 6
      src/minidexed.cpp
  3. 3
      src/minidexed.h

@ -816,9 +816,15 @@ void CMIDIDevice::HandleSystemExclusive(const uint8_t* pMessage, const size_t nL
LOGERR("Unknown SysEx message.");
break;
case 100:
// load sysex-data into voice memory
// Load sysex-data into voice memory
LOGDBG("One Voice bulk upload");
m_pSynthesizer->loadVoiceParameters(pMessage,nTG);
// Also update performance config so the new voice is not lost
if (m_pSynthesizer && m_pSynthesizer->GetPerformanceConfig()) {
uint8_t unpackedVoice[156];
m_pSynthesizer->GetCurrentVoiceData(unpackedVoice, nTG);
m_pSynthesizer->GetPerformanceConfig()->SetVoiceDataToTxt(unpackedVoice, nTG);
}
break;
case 200:
LOGDBG("Bank bulk upload.");

@ -2498,3 +2498,9 @@ bool CMiniDexed::InitNetwork()
return false;
}
}
void CMiniDexed::GetCurrentVoiceData(uint8_t* dest, unsigned nTG) {
if (nTG < m_nToneGenerators && m_pTG[nTG]) {
m_pTG[nTG]->getVoiceData(dest);
}
}

@ -244,9 +244,10 @@ public:
bool InitNetwork();
void UpdateNetwork();
public:
void LoadPerformanceParameters(void);
void GetCurrentVoiceData(uint8_t* dest, unsigned nTG);
private:
int16_t ApplyNoteLimits (int16_t pitch, unsigned nTG); // returns < 0 to ignore note
uint8_t m_uchOPMask[CConfig::AllToneGenerators];

Loading…
Cancel
Save