Wohlstand / OPL3BankEditor

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

DMX: Percussion corrupts when saved #6

Closed sneakernets closed 7 years ago

sneakernets commented 7 years ago

On the new beta I downloaded this week, percussion is pretty much destroyed when I saved. I lost all my drums. :\

file here: https://github.com/sneakernets/DMXOPL/blob/master/GENMIDI.op2

older file with drums: https://github.com/sneakernets/DMXOPL/blob/09fd1ce689910e9df08d0fd0c7f27064df1d8180/GENMIDI.op2

Wohlstand commented 7 years ago

That strong... wait a sec....

Wohlstand commented 7 years ago

That weird, I had to open source bank, then I had to save it as new file, and then reopened editor and got drums fine. Very weird... 🤔 What did you do after opening the file, and before you saved file? Maybe the associative import is glitchy (there are two options for import: associative to replace instruments by similar ID in same bank, and replacing one selected instrument)

Wohlstand commented 7 years ago

Okay, I think, I can understand why drums are broken: possibly TmpBank class did the damage. Oh, yeah, 🤦‍ I know what happen: I accidentally used the uninitialized array as source while saved bank, will fix that... That class I did to correctly save banks are has less instruments than bank must have (for example, you are saving AdLib BNK with smaller set of instruments than DMX/TMB allows: there are allows strictly 128 melodic and 128 percussions (DMX allows less percussions, only in range of GeneralMidi, reserved drum slots are removed))

Wohlstand commented 7 years ago

Fixed, try out the fix! 😉

sneakernets commented 7 years ago

thanks, will do! You'll be credited in my DMX bank release. Hopefully it can be included in ADLMidi in the future...

Wohlstand commented 7 years ago

thanks, will do! You'll be credited in my DMX bank release. Hopefully it can be included in ADLMidi in the future...

Yeah, I'll include that, and also I going to rework it with making it be real time MIDI playing library and make it's MIDI playing thing be a separated library/application that uses ADLMIDI core and keeps the set of banks. And yeah, I gonna use this MIDI playing thing with multiple MIDI devices: OPNMIDI and FluidLite (small lite implementation of FluidSynth even without own MIDI player, only real-time event accepting), because ADLMIDI's MIDI playing thing does supports loop points (myself I keeping in the mind the idea to make ALSA daemon over ADLMIDI to use it with MIDI editors, and also the VLC plugin, which requires each decoder to be real-time)

Wohlstand commented 7 years ago

P.S. Use the same link to download fresh version, because Appveyor uploads that automatically, and I'll add that link into readme

sneakernets commented 7 years ago

thanks :D

Wohlstand commented 7 years ago

Please 😉 Can you confirm that bug is gone on your side,? I'll close this when you confirm fix

sneakernets commented 7 years ago

I'll check ASAP, I'll likely be able to check in the morning. My main computer is only accessible in the daylight hours.

sneakernets commented 7 years ago

FIXED.

sneakernets commented 7 years ago

I think I've run into YET ANOTHER PROBLEM with this. Check this out. First playthrough is with ADLMidi, the 2nd is with Doom.exe. What the heck? My hats aren't doing right at all 😢

https://vocaroo.com/i/s1dOHs21EQ9J

Wohlstand commented 7 years ago

Does OPL3 wave forms are working with vanilla Doom? I bet, if it tries to set OPL2 mode, those voices would be turned off. Doom usually turns OPL2 mode with 9-voices mono mode

sneakernets commented 7 years ago

Yes, OPL3 waveforms work with vanilla Doom, but these hats aren't using OPL3 waveforms, so that can't be it. :\

sneakernets commented 7 years ago

Here's the file that was used: GENMIDI.zip

sneakernets commented 7 years ago

The ones in question are Closed High-Hat, Pedal High-Hat, and Open High-Hat

Wohlstand commented 7 years ago

Did you tested Doom on real hardware or on emulator?

Wohlstand commented 7 years ago

Nuked OPL3 (used in this editor and in current version of libADLMIDI) even is very accurate, DosBox's emulator is not, therefore needs a different pitch to have right sounding, hihats are very sensitive

sneakernets commented 7 years ago

I've used real hardware to test it (my Toshiba laptop), nuked's OPL3 core as well.

Wohlstand commented 7 years ago

Just for a test, try to use Windows 98 version of my bank editor, it uses OPL3 chip directly (through Watcom-built dll which works on Windows 9x only). One note: if sound will be same as Nuked, and different from Doom, that means Doom has different pitch multiplier value which is not matching with that I used in bank editor and in libADLMIDI and I need to check something right. I also have PC with Sound Blaster 16 sound card where OPL3 chip is used.

sneakernets commented 7 years ago

Yeah it's fine! I used SLADE to look at the GENMIDI and on my closed hi-hat, it claims note offset is -7 instead of 5 on the second voice, and -12 on the first voice (instead of 0). I could be reading this wrong, but I'm going to modify it manually with slade and see if I can "fix" it.

EDIT: Wow SLADE is broken in that regard, nevermind that route. I'll send a bug report about that to judd.

sneakernets commented 7 years ago

One quick question, can I save my op2 as another format and then convert that back when/if there is a fix for this? I don't wanna lose the GENMIDI I've made so far. 😥

Wohlstand commented 7 years ago

You can use my WOPL format which I created to support everything supported by editor.

sneakernets commented 7 years ago

awesome.