VOGONS


Reply 300 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member
MrFlibble wrote on 2023-11-14, 17:19:
ludicrous_peridot wrote on 2023-11-14, 15:35:

One thing on the OP2-enabled allegro I've shared, it it breaks how percussion sounds.

I hope you get this fixed soon, I really like the idea of directly using GENMIDI.op2, as originally intended in vanilla.

Thanks for your interest. I may have used "breaks" as the wrong word to describe this, but I was somewhat surprised about how certain Doom II tracks sounded in OPL with "my" version of libAllegro. I have also listened to them in vanilla ID DOOM2.EXE and for me they still sound rather awful.
So, I have done some clean-up and ensured that for percussion note offset is taken into account same as it was done for instruments, and listened again and reuploaded in the post above. I still find percussion somewhat off, but at this stage I don't have any smart way of testing this and with my own ears I can hear vanilla, MUSPlay and my port all sound different with the same songs/sound banks, so I think I am likely overdoing this.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 301 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
ludicrous_peridot wrote on 2023-11-15, 10:29:

So, I have done some clean-up and ensured that for percussion note offset is taken into account same as it was done for instruments, and listened again and reuploaded in the post above. I still find percussion somewhat off, but at this stage I don't have any smart way of testing this and with my own ears I can hear vanilla, MUSPlay and my port all sound different with the same songs/sound banks, so I think I am likely overdoing this.

Thanks! So far I only tried Tartar to listen what Freedoom GENMIDI sounds like, and I didn't notice anything particularly off yet. It didn't sound exactly like in PrBoom, but I haven't used that port for a while and it might use some additional music/emulation settings when out of the box.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 302 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member
MrFlibble wrote on 2023-11-15, 12:49:

Thanks! So far I only tried Tartar to listen what Freedoom GENMIDI sounds like, and I didn't notice anything particularly off yet. It didn't sound exactly like in PrBoom, but I haven't used that port for a while and it might use some additional music/emulation settings when out of the box.

Hey, thanks. Though it was worth mentioning that while updated libAllegro has been uploaded, I have not posted any new builds of tartar for a few days. I'd like to take a break and listen to more OPL music before doing that. 😀

Also, took the IBKs you published on Doomworld and tried two things:
1. Loaded into Tartar with both IBKs specified in allegro config (even commented out loading GENMIDI lump for that) and ran freshly downloaded Freedoom phase 2
2. Ran same IWAD with 1.11 DMXOPL.WAD in "normal" Tartar without any IBKs.
Listening to the two, I'd say, while they sound different, a lot of it seems to come from pitch difference, IBK version often using a higher pitch. I did not found instruments or drums sounding radically different between the two performances, so your IBK conversion seems to be pretty solid.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 303 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
ludicrous_peridot wrote on 2023-11-15, 15:49:

Listening to the two, I'd say, while they sound different, a lot of it seems to come from pitch difference

Yes, that's exactly how I hear the difference as well.

Just to clarify, the Allegro version you're using in Tartar is based on gerwin's one from MBF here, right? It seems like gerwin's edits have affected how Allegro processes IBKs, making the standard ones, like the stock IBKs or the one I converted from DMXOPL GENMIDI, sound with a different pitch.

This is also further supported by reversing the test: if you take MBF_D2GM.IBK from MBF 2.04 and use it with MBF 2.03 or BOOM 2.02, the opposite effect will take place and the pitch will be much lower.

I wonder what changes were made to result in this behaviour, and if it is possible to restore the default IBK usage in the modified Allegro library without rolling back all of the other improvements? 'Cause I think it's still a nice feature to have, even if not widely used so far. It could potentially allow to customize music playback even more without the need to juggle between formats and/or loading extra WADs.

MrFlibble wrote on 2023-11-14, 17:19:

Perhaps setting them to zero after conversion via OPL3BankEditor might "fix" the IBK for use with MBF 2.04.

BTW, I forgot to mention that I tried to do exactly that but I guess the differences are more fundamental, because the edited IBK still sounded wrong.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 304 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

I continued using your IBKs as test case and made some progress:

1. Have figured out OP2 loading code did not correctly read scale levels, which I (hopefully) fixed
2. Also changed the way levels are assigned to be more in line with LibMUS (well, they kind of were in principle, but I wrote "less optimized" and more explicit code for this)
3. Changed ibk loading code to support note transposition, like OP2 loading code introduced earlier did
4. Finally, was able to get both scenarios I have described (OP2 and IBK driven) sound the same, but only after putting in a small hack. By the way I like the way Doom II sounds more in the most recent version too! The sound still lacks DMX polyphony achieved via secondary instruments, but this seems too difficult to do with how this Allegro version works.

Talking about the hack, what I have found is that note transpose field is different in GENMIDI and the IBK-s you shared, as though IBK instruments were transposed by one octave (!). I put in a simple change that when loads IBK-s transposes by one octave down, and that did the trick.
Not sure why this transposition occurred in your IBK-s, it's almost like the converter was implying this will be later transposed down?

image_2023-11-16_174253024.png
Filename
image_2023-11-16_174253024.png
File size
35.24 KiB
Views
2162 views
File license
CC-BY-4.0

Talking about this, original Allegro fm_set_pitch() transposed down by 2 octaves, but @gerwin's version for MBF (and hence the attached) does not:

// GB 2014: modified as to the example of the Duke Nukem 3D adlib driver, 
// Cannot tell why exactly, but the original procedure sounded bugged for sure.
// bugged section: note-=24; while (note>=12) {note-=12; oct++;}

Attachments

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 305 of 370, by T-Squared

User metadata
Rank Member
Rank
Member

I was going to comment about how the music sounds, but I didn't because I thought it was a quirk with Allegro, not with the changes. I have UniDoom DM 2, which is a deathmatch map pack from the early 2000s.

It sounds fine in vanilla Doom II, but one of the instruments sounds too high compared to its vanilla counterpart.

Reply 306 of 370, by gerwin

User metadata
Rank l33t
Rank
l33t

I am getting the messages of course. Appreciate the interest in fixing and improving the adlib driver.
But in order to post constructive replies about it, I would have to dive into this adlib driver matter, and more so then I did 9 years ago.
Yes I also used Duke Nukem 3D source code as a reference. DMX itself was not available as source code at the time.

--> ISA Soundcard Overview // Doom MBF 2.04 // SetMul

Reply 307 of 370, by Grunt

User metadata
Rank Newbie
Rank
Newbie

Hmm, sounds like final push for cleaning MBF source code tree to me 😉

Is there even library related to Allegro in DOS but at least little maintained? (not abandoned for years I mean)

Reply 308 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
ludicrous_peridot wrote on 2023-11-16, 16:51:

I continued using your IBKs as test case and made some progress:

Great, that sounds pretty cool!

ludicrous_peridot wrote on 2023-11-16, 16:51:

Not sure why this transposition occurred in your IBK-s, it's almost like the converter was implying this will be later transposed down?

I'm not sure as well. But I'm assuming that the original IBK format worked as intended with the vanilla Allegro library used with BOOM 2.02 and MBF 2.03, and since my DMXOPL conversion sounded in these two ports exactly like the OP2 mode in vanilla , I concluded that OPL3BankEditor converted GENMIDI.OP2 to IBK without any errors or need for further tweaks.

The comment from gerwin's code about AdLib music sounding "bugged" seems to suggest that there was some discrepancy between how Allegro/IBK worked originally compared to other AdLib drivers such as Duke3D's that was used as reference. Perhaps this was not an actual error but can be explained by the different ways that these drivers work?

DOS Games Archive | Free open source games | RGB Classic Games

Reply 309 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

In the meantime, I imported Nash's CC-BY dog sprites and CC0/CC-BY dog sounds from GZDoom to replace the Wolfenstein 3-D dogs:
3DEDezZ.png
xCpghKZ.png
This MBF.EXE is compiled with the latest fixes to the Allegro library and compressed with UPX 1.20. I've also included the modified info.c too, of course.

Attachments

Last edited by MrFlibble on 2023-11-21, 11:57. Edited 1 time in total.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 310 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member
MrFlibble wrote on 2023-11-19, 12:56:

This MBF.EXE is compiled with the latest fixes to the Allegro library and compressed with UPX 1.20. I've also included the modified info.c too, of course.

While you are at it - maybe worth checking out the setup.exe that's built from the sources of liballegro I've shared? This one doesn't have Doom assets anymore, although the background is based on a Cramack's drawing.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 311 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
ludicrous_peridot wrote on 2023-11-19, 16:20:

While you are at it - maybe worth checking out the setup.exe that's built from the sources of liballegro I've shared? This one doesn't have Doom assets anymore, although the background is based on a Cramack's drawing.

I have just built MBF with your library, including the latest fixes from ADLIB.C that you posted separately, and the GENMIDI loading code that you've shared (thanks!). Everything seems to work fine, I've tested this with the shareware IWAD and DMXOPL, GENMIDI is definitely loaded and played as intended, I hear no difference between the E1M1 tune with DMXOPL v1.11 either in this build or in FastDoom, save for the sound volume (MBF OPL music sounds louder than FastDoom at the max music volume setting).

The CC-BY dogs are also included (please see my previous attachment for the modified info.c). Both binaries were compressed with UPX 1.20.

The setup programme background image is cool but somewhat creepy 😀

UPD: Please download the fixed version from the post further below.

Last edited by MrFlibble on 2023-11-26, 13:19. Edited 1 time in total.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 312 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

Further to the experiments with the GENMIDI-reading version, I've just played some REKKR to check out how music works -- REKKR uses the GENMIDI lump from Freedoom 0.9-0.12. I tried both this and DMXOPL, and I must say that in both cases the OPL3 music sounds apaprently worse than with the stock Doom instruments built into MBF 2.04. With vanilla MBF 2.04, the tunes very definitely sound closer to what you hear when General MIDI is selected (I suppose GM was what REKKR music was composed for), although very much not perfect, while either GENMIDI option noticeably changes the sound of instruments and consequently the whole melodies, you can notice this very much even with the title screen music alone.

For comparison, I ran REKKR standalone which is based on a hacked DOOM.EXE, and GENMIDI OPL music sounds pretty much the same as in modified MBF, so this is not an MBF-specific issue; but it really makes me question how much advantage it provides to use GENMIDI instead of built-in stock instruments.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 313 of 370, by T-Squared

User metadata
Rank Member
Rank
Member
MrFlibble wrote on 2023-11-20, 13:36:
I have just built MBF with your library, including the latest fixes from ADLIB.C that you posted separately, and the GENMIDI loa […]
Show full quote
ludicrous_peridot wrote on 2023-11-19, 16:20:

While you are at it - maybe worth checking out the setup.exe that's built from the sources of liballegro I've shared? This one doesn't have Doom assets anymore, although the background is based on a Cramack's drawing.

I have just built MBF with your library, including the latest fixes from ADLIB.C that you posted separately, and the GENMIDI loading code that you've shared (thanks!). Everything seems to work fine, I've tested this with the shareware IWAD and DMXOPL, GENMIDI is definitely loaded and played as intended, I hear no difference between the E1M1 tune with DMXOPL v1.11 either in this build or in FastDoom, save for the sound volume (MBF OPL music sounds louder than FastDoom at the max music volume setting).

The CC-BY dogs are also included (please see my previous attachment for the modified info.c). Both binaries were compressed with UPX 1.20.

The setup programme background image is cool but somewhat creepy 😀

Now THAT version is MUCH closer to Doom's music. 😁

Now to tackle the video bug that I get with my AIW Pro. It seems to be a non-standard video mode that is outside even vanilla Doom's range. (I get a "Non-Optimum Mode" warning with this version, and that usually only happens with non-VESA modes, such as the installation program and certain parts of 3D Dinosaur Adventure.)

Reply 314 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

On the topic of sound in Allegro (digi, not music this time) what are the reasoable values to have for the number of voices for different cards?

I just figured out that Allegro initializes any SB card with 8 voices, unless this is overridden by the user with config or setup program, so it would seem for me a reasonable recommendation to set it manually to a bigger value when the card supports it.

My observation with the Yamaha card I have is that I am able to set it to 24 and 32 channels, which seems to sound less choppy in nuts.wad, than with, say, 16, but sounds become much more quiter and pan of individual sounds becomes somewhat random - not something I can hear with 16 voices or less.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 315 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
T-Squared wrote on 2023-11-22, 01:37:

Now THAT version is MUCH closer to Doom's music. 😁

BTW, today I realised that ludicrous_peridot's modified Allegro can load and use DMXOPL versions higher than 1.11, and tried v2.11d, which sounds even better. However, the music is still off with REKKR (some notes sound too loud, etc.), so I'm sticking with the original OPL instruments as provided by gerwin.

I have updated my REKKR for MBF, here are the downloads:

This release fixes the annoying problem with MBF extended menus not being really navigable because back then I couldn't figure out how to palswap REKKR HUD font. Now it works as intended:
7iozpTl.png
While I was at it, I also re-enabled the helper dogs, since now there are libre equivalents available from Nash:
lmWf3qm.png
I also changed the default automap colours to match those in the Sunken Land (which are actually a GZDoom preset that imitates the Heretc/HeXen automap colour scheme):
eTc6OlW.png

DOS Games Archive | Free open source games | RGB Classic Games

Reply 316 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie
ludicrous_peridot wrote on 2023-11-16, 16:51:

I continued using your IBKs as test case and made some progress:

1. Have figured out OP2 loading code did not correctly read scale levels, which I (hopefully) fixed

I've been testing the MBF build I'd compiled with your Allegro library, and I think I noticed an error in music playback.

A note is audibly played off in the demo playback of REKKR. For comparison, I have recorded (in DOSBox) how this part of the tune sounds in vanilla Doom (via REKKR standalone) with DMXOPL 1.11 loaded (rekkr_vanilla.wav), in the latest MBF build with gerwin's library (rekkr_mbf.wav) and in the build with your library that I've posted above -- again, with DMXOPL 1.11 loaded (rekkr_allegro.wav).

I've uploaded these WAVs here: rekkr_comparison.7z. You can hear the note that is off at around 0.4 seconds from the start.

Could you please look into this?

DOS Games Archive | Free open source games | RGB Classic Games

Reply 317 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

Can you try the attached updated version?

Attachments

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)

Reply 318 of 370, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

Thanks! Seems to have done the trick.

I'm attaching the newly compiled version + libre dogs.

However, I've run a few more tests and listened more closely, and music with DMXOPL loaded in MBF with your library does not sound quite the same as in vanilla Doom/REKKR with the same version of DMXOPL. I wonder if the sound can be improved, or is it beyond the capability of the Allegro library at this point?

I've just checked again, and, for comparison, the patches that gerwin put in fm_instr.h sound pretty much the same, or at least quite similar to vanilla Doom. Or does DMXOPL use some extra features of the DMX library to sound better that cannot be easily emulated?

Attachments

DOS Games Archive | Free open source games | RGB Classic Games

Reply 319 of 370, by ludicrous_peridot

User metadata
Rank Member
Rank
Member
MrFlibble wrote on 2023-11-26, 13:18:

Thanks! Seems to have done the trick.

Good to hear that it works for you as well.
I have restored @gerwin 's pitch bend code, only made sure it was applied to up to half tone up - that after having observed in MIDIPlayer that for D_E1M9 they seem to have played with their pitch bend wheel (or pedal) more than they have played actual notes... oh, well.

MrFlibble wrote on 2023-11-26, 13:18:

... music with DMXOPL loaded in MBF with your library does not sound quite the same as in vanilla Doom/REKKR with the same version of DMXOPL...

It may well be the case, but I am a bit ear-sore from past few weeks of listening to the OPL3 music in Doom, Doom II and Sigil. You've provided a great example with D_E1M9 actually, so if you could point out another difference in a similar manner, I will be most obliged.

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.

By the way, another side effect of the same is that in Allegro more source MIDI channels are audible! Check out UniDoom DM 2 MAP02 with Allegro configured to OP3 to hear what I mean.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - YMF744 (Cobra) - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924 (Typhoon Media)