Reply 320 of 370, by MrFlibble
- Rank
- Oldbie
ludicrous_peridot wrote on 2023-11-26, 14:32:That said - DMXOPL likely uses the same secondary instrument tricks of GENMIDI format as Vanilla Doom does, and implementing those is very difficult in current version of Allegro - well, at least for me 😉 . The result is that with DMX and MUSLib/MUSPlay more OPL chip channels are used than there are channels in the source MIDI, and there's nice polyphony to the sound which Allegro version is lacking.
I wonder if it might be possible to hook in APODMX into MBF somehow to achieve closer sound/music fidelity, or at least incorporate the code responsible for OPL music playback into the modified Allegro library?
Seeing as how gerwin has already used the Adlib driver from Duke Nukem 3D -- which I think is part of the Apogee Sound System as well (and APODMX is a DMX stand-in built upon the ASS) -- that would actually make some sense, it seems.
gerwin wrote on 2023-11-11, 19:13:Originally MBF used the Allegro build-in Midi-to-FM conversion table. The table is found in "Allegro\src\djgpp\fm_instr.h". When Allegro is build into its library form, this table is hardcoded in there. For the MBF 2.04 project I changed the fm_instr.h table to the Doom1 values.
For example the first line:
{ 0x00, 0x30, 0x14, 0x00, 0xf0, 0xf1, 0xf3, 0xf4, 0x01, 0x01, 0x0a, 0, 0, 0 }, // Acoustic Grand
For the sake of curiosity, I have tried to copy instrument patches from DMXOPL 1.11 into fm_instr.h, by initially comparing your table to the original Doom GENMIDI values. It turns out that I have correctly deduced in my previous post that all values are exactly the same except "Note offset 1" and Modulator 1's "Key Scale Level" parameters (I'm giving here their names as defined by OPL3BankEditor), which are set to 0 for all instruments both in the fm_instr.h table and in MBF_D2GM.IBK.
However, and here's the weird part, when I converted the DMXOPL instruments to the fm_instr.h table while setting Note offset 1 and Key Scale Level for all of them to 0, I still got the resulting music sounding off, just like with my initial IBK conversion attempts. Yet if I used OPL3BankEditor to convert the GENMIDI lump from Doom to IBK and loaded it with MBF's setup, it would sound the same as the original internal sounds from your fm_instr.h table, suggesting that maybe these two values which are set to 0 are actually hardcoded elsewhere? I can think of no other explanation for this oddity ATM.