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

Support for exporting a single bank #21

Closed sneakernets closed 6 years ago

sneakernets commented 6 years ago

I'm trying to make a "GM" version of my GS bank of DMXOPL, and I can't figure out how to do that without losing some of the percussion instruments that aren't in the DMX OP2 file.

Any ideas?

Wohlstand commented 6 years ago

If you are exporting as OP2, then it's a limitation of OP2 format itself which doesn't store all 127 drums: 80 of them only. It allows to store drums from kick up to open triangle.

sneakernets commented 6 years ago

Okay, I noticed that some older ADLMIDI implementations were having issues importing my latest release, and I wondered if it was due to that. Also there's no real way to tell if a bank doesn't have an instrument set or not, since even if an instrument has all 0 in all parameters, it still gets played anyway (which is total silence)

I dunno if I would call that a bug though. It is slightly annoying nonetheless.

Wohlstand commented 6 years ago

Anyway, which "older" implementations you are mean? Speaking about original ADLMIDI, it constantly using detune factor for all instruments. Only since some version I have implemented the detune factor for second voices are now valid everywhere. Also, in current libADLMIDI I have completely re-written gen_adldata tool which uses a different generation logic and supports multi-threading to speed-up a whole progress.

sneakernets commented 6 years ago

Well, This is the problem: some midis I use have specific instruments in banks that DMXOPL WOPL set does not have yet, but the bank the midi looks for does exist. I just haven't gotten around to making that voice yet, so it's zeroed out. As a consequence, the notes simply don't play, and I don't notice since ADLMIDIPLAY doesn't tell me about it.

So until I make those instruments the midi specifially asks for, I wish there was a way to have some sort of "fall-back" in the meantime, but since that isn't the case, I'd like to be able to have just one bank of melodic and one bank of percussion so I can see the debug messages and know which voices I need to work on.

I hope that makes sense!

Wohlstand commented 6 years ago

Can you send me that MIDI file which reproduces this to let me review the case? The fallback is already given: if bank doesn't exists or zeroed, GM bank is getting to be used. Same rule works for both percussions and melodic channels.

If some sort of bugs are existing, I'll try to fix them.

sneakernets commented 6 years ago

https://www.vgmusic.com/music/console/nintendo/snes/Actraiser_Ancient_XG.mid

The french horn does not play with the latest GENMIDI(GS).WOPL in my DMXOPL respository.

Wohlstand commented 6 years ago

I think, that may happen as instrument isn't marked as "blank". Therefore I must to implement a marking of "blank" instruments (by measurer's calculation result) to turn fallback. If you are using different bank and it lacks instruments in middle (In real, WOPL banks gives no "blank" instrument entries and silent instruments are working as regular instruments.... which are playing silence). Resolving of this will not affect the format itself as I will only add a flag into existing variable (one byte-length variable is able to hold 8 different flags).

The same system works well in both ADL and OPN MIDI libraries, and I have well-tested percussion banks only on OPNMIDI side (look my xg.wopn bank), but I have never tested melodic side, and you just now have pointed me a big mess I must to fix!

Wohlstand commented 6 years ago

The trouble with silent instruments on a non-zero banks has been resolved! https://github.com/Wohlstand/OPL3BankEditor/commit/027e20b73148604d945a84ef16fd3f279de2b279 https://github.com/Wohlstand/OPL3BankEditor/commit/47c58393d504708c556a90ded3ad937e4a8108a5 https://github.com/Wohlstand/OPL3BankEditor/commit/a20a9451284a777c7fdc1173dbd457a157e30cf7

https://github.com/Wohlstand/libADLMIDI/commit/ab3a2fc025197749a74a6f7cdeb10d93819f2863

Note: To let your bank work fine, you must run in latest editor the Edit -> Re-Calculate sounding delays menu item to automatically mark all blank instruments in the bank. Then, fallback will work.

Also, that bug was reproducible on OPNMIDI too, which I also fixed by poring of changes I made on libADLMIDI.

What about of force GM exporting, I'll add that a bit later.

Wohlstand commented 6 years ago

Made! https://github.com/Wohlstand/OPL3BankEditor/commit/a82fdccef828e97f88e69f78f40fa970b9c0fb32

To save GM WOPL bank, choose in the formats list the "Standard OPL3 GM bank by Wohlstand" which will result the GM bank. If you have currently more that one bank of each type (melodic or percussion), you will receive a question to confirm saving or reject.

@sneakernets , please try to test the result and confirm, is it works or any bugs are presented?

sneakernets commented 6 years ago

I will check tonight! Thank you!

Wohlstand commented 6 years ago

I'll close this as feature has been implemented and no response was received.