Fix: Invalid handling of .syx file indexes (#34)

Indexes of voice banks are zero-based now in any case (for the user
and internally). In CSysExFileLoader::Load() do not decrement file
index any more to calculate internal voice bank index. Do not
increment internal index, when generating user messages.
pull/37/head
Rene Stange 3 years ago committed by GitHub
parent d86a45324f
commit d5e98e625a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/sysexfileloader.cpp

@ -80,11 +80,9 @@ void CSysExFileLoader::Load (void)
continue; continue;
} }
nBank--; // zero-based internally
if (m_pVoiceBank[nBank]) if (m_pVoiceBank[nBank])
{ {
LOGWARN ("Bank #%u already loaded", nBank+1); LOGWARN ("Bank #%u already loaded", nBank);
continue; continue;
} }
@ -105,7 +103,7 @@ void CSysExFileLoader::Load (void)
&& m_pVoiceBank[nBank]->Format == 0x09 && m_pVoiceBank[nBank]->Format == 0x09
&& m_pVoiceBank[nBank]->StatusEnd == 0xF7) && m_pVoiceBank[nBank]->StatusEnd == 0xF7)
{ {
LOGDBG ("Bank #%u successfully loaded", nBank+1); LOGDBG ("Bank #%u successfully loaded", nBank);
} }
else else
{ {

Loading…
Cancel
Save