Wohlstand / OPN2BankEditor

A small cross-platform editor of the OPN2 FM banks of different formats (Downloads in README below)
GNU General Public License v3.0
40 stars 8 forks source link

[Bug]Instrument list keeps jumping to GM1 Melodic bank after changing LSB #103

Closed freq-mod closed 3 years ago

freq-mod commented 3 years ago

This bug is weird, it seems to occur consistently, yet with many prerequisites. Only steps to replicate I can come up with:

  1. Open this bank: toho.zip (WIP Pc-98 bank, might be used as example libOPNMIDI FM bank when it's finished)
  2. Change MIDI standard to "Roland GS"
  3. Go to SC-88 Map Var 16
  4. Change LSB to 3 and then back to 2
  5. You will be thrown to default GM1 bank.

There might be other ways to replicate this behaviour, I guess.

Wohlstand commented 3 years ago

:thinking: 2020-11-28_23-50-57.mp4.zip

freq-mod commented 3 years ago

It's only bank 16 that does that, look: ice_video_20201128-220621_edit_0.zip

Wohlstand commented 3 years ago

Didn't reproduced at me... maybe I should try this at my Win8.1 computer?

Wohlstand commented 3 years ago

BLAK MAGIK!!! 2020-11-29_00-17-23.mp4.zip

It reproduced on Windows build ran on Wine!

Wohlstand commented 3 years ago

Okay, that damn happens on Windows, because the list of banks gets be cleaned-up:

void BankEditor::reloadBanks()
{
    ui->bank_no->clear();
    int countOfBanks = 1;
    bool isDrum = isDrumsMode();
    if(isDrum)
        countOfBanks = ((m_bank.countDrums() - 1) / 128) + 1;
    else
        countOfBanks = ((m_bank.countMelodic() - 1) / 128) + 1;
    for(int i = 0; i < countOfBanks; i++)
    {
        ui->bank_no->addItem(QString(), i);
        refreshBankName(i);
    }
}

because the instrument names reloading call do calling the "setMelodic()" call that calls "reloadBanks()"

:thinking:

Wohlstand commented 3 years ago

And I know why: QListWidget item search by wildcard sux: I found a different way to iterate items inside of it, gonna to try...

Wohlstand commented 3 years ago

@freq-mod , just now I made a fix, please verify the work! :fox_face:

Wohlstand commented 3 years ago

// I feel, I need to apply the same fix to OPL3-BE too...

Wohlstand commented 3 years ago

Done at OPL3-BE too.

freq-mod commented 3 years ago

Looks like that bug is gone, thanks!