Fix Program Change numbering and voice name printing

https://github.com/probonopd/MiniDexed/issues/11
pull/30/head
probonopd 3 years ago committed by GitHub
parent cdd603091b
commit d40051c7c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/minidexed.cpp

@ -146,10 +146,13 @@ void CMiniDexed::MIDIPacketHandler (unsigned nCable, u8 *pPacket, unsigned nLeng
if (pPacket[0] == MIDI_PROGRAM_CHANGE)
{
if(pPacket[1] < 1 || pPacket[1] > 32) {
return;
}
printf ("Loading voice %d\n", (unsigned) pPacket[1]);
s_pThis->loadVoiceParameters(voices_bank[0][(unsigned) pPacket[1]]);
// FIXME: The following 3 lines do not work yet
s_pThis->loadVoiceParameters(voices_bank[0][(unsigned) pPacket[1] - 1]);
char buf_name[11];
memset(reinterpret_cast<void*>(buf_name), 0, 11); // Initialize with 0x00 chars
s_pThis->setName(buf_name);
printf ("%s\n", buf_name);
return;

Loading…
Cancel
Save