ADLMIDI support

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ADLMIDI support

Post by Graf Zahl »

I force pushed a correct master. The merge commit was not supposed to pushed, I have no idea why that happened without registering on my local repo.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: ADLMIDI support

Post by Rachael »

So I just tried this out.

I am sorry to say this, but in my view, but the "DOSBox OPL3" sounds the most accurate at the moment - not this new OPL library. At more extreme pitches with some instruments, ADLMIDI seems to get really messed up. Even D_RUNNIN does not sound correct.

It certainly proves to be a viable option to have, but there is absolutely no justification for removing the OPL players that are there right now. It's not ready to replace them right now, in my opinion. :(
Last edited by Rachael on Wed Mar 07, 2018 10:35 pm, edited 1 time in total.
Reason: clarification
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: ADLMIDI support

Post by Csonicgo »

Rachael wrote:So I just tried this out.

I am sorry to say this, but in my view, but the "DOSBox OPL3" sounds the most accurate at the moment - not this new OPL library. At more extreme pitches with some instruments, ADLMIDI seems to get really messed up. Even D_RUNNIN does not sound correct.

It certainly proves to be a viable option to have, but there is absolutely no justification for removing the OPL players that are there right now. This library just doesn't measure up, right now, in my view, sorry. :(
This library is 1000x more complicated than the "dosbox opl3" selector. it's intended to be another midi library with its own set of sound banks and other options, such as number of chips, number of 4-op channels, custom bank locations, and 73+ built-in banks. If it sounds wrong, it's likely wrong.

I can't compile it yet due to linker errors, but here's what it can actually sound like if it's getting the correct midi events and using a custom bank.

https://soundcloud.com/sdoom4/running-from-evil-dmxopl
User avatar
nazakomu
Posts: 131
Joined: Wed Nov 30, 2016 12:51 am
Graphics Processor: nVidia with Vulkan support

Re: ADLMIDI support

Post by nazakomu »

Csonicgo wrote: This library is 1000x more complicated than the "dosbox opl3" selector. it's intended to be another midi library with its own set of sound banks and other options, such as number of chips, number of 4-op channels, custom bank locations, and 73+ built-in banks. If it sounds wrong, it's likely wrong.
Indeed.
I have a foobar2000 component, specifically for MIDI, which includes ADLMIDI. It has a vast assortment of sound banks that can be selected for your listening preference, as well as the option to select up to 100 chips, and full panning.
ADLMIDI options at the bottom:
Kotti
Posts: 86
Joined: Tue Dec 27, 2016 4:08 am

Re: ADLMIDI support

Post by Kotti »

Csonicgo wrote: This library is 1000x more complicated than the "dosbox opl3" selector. it's intended to be another midi library with its own set of sound banks and other options, such as number of chips, number of 4-op channels, custom bank locations, and 73+ built-in banks. If it sounds wrong, it's likely wrong.
So correct me if I'm wrong here: This library requires careful per-song setup to sound right? It's so complicated that running it out of the box with default settings does not work across the board?
I have to concur with Rachael that it somehow doesn't sound right - and I did test several songs with a few of those 74 default sound banks, which can be set with a CVAR.
but here's what it can actually sound like if it's getting the correct midi events and using a custom bank.
Don't you have a better track? Something like D_E1M7, maybe? Or also some non-Doom tracks? This also fails to provide any info about the settings you used to play it and how much tweaking you used.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: ADLMIDI support

Post by _mental_ »

Updated ADLMIDI branch with fixes for non-Windows platforms.
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: ADLMIDI support

Post by Csonicgo »

Kotti wrote:
Csonicgo wrote: This library is 1000x more complicated than the "dosbox opl3" selector. it's intended to be another midi library with its own set of sound banks and other options, such as number of chips, number of 4-op channels, custom bank locations, and 73+ built-in banks. If it sounds wrong, it's likely wrong.
So correct me if I'm wrong here: This library requires careful per-song setup to sound right? It's so complicated that running it out of the box with default settings does not work across the board?
I have to concur with Rachael that it somehow doesn't sound right - and I did test several songs with a few of those 74 default sound banks, which can be set with a CVAR.
but here's what it can actually sound like if it's getting the correct midi events and using a custom bank.
Don't you have a better track? Something like D_E1M7, maybe? Or also some non-Doom tracks? This also fails to provide any info about the settings you used to play it and how much tweaking you used.
Nah, it doesn't take per-song setup. You just pick a bank you want and go with it.

And yes, I have tons of tracks that are "better" I guess. here they are:
https://soundcloud.com/user-81457305/br ... ink-dmxopl

https://soundcloud.com/sdoom4/al-unser- ... ing-dmxopl

https://soundcloud.com/sdoom4/adrians-pen-dmxopl
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ADLMIDI support

Post by Graf Zahl »

I'd really like to hear some tracks I know well enough to compare. You chose two of my least favorite ones from Doom 2 which I rarely listen to in their entirety.

Some suggestions:
D_E1M7 would be great because ADLMIDI shows the same glitch here as Timidity, but strangely enough not OPL: The lead instrument seems to be far too quiet.
alienz.mid from Duke Nukem.
Weather Warning (MAP25 from BTSX II)
MAP04 from Eternal Doom 3.
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: ADLMIDI support

Post by Csonicgo »

Graf Zahl wrote:I'd really like to hear some tracks I know well enough to compare. You chose two of my least favorite ones from Doom 2 which I rarely listen to in their entirety.

Some suggestions:
D_E1M7 would be great because ADLMIDI shows the same glitch here as Timidity, but strangely enough not OPL: The lead instrument seems to be far too quiet.
alienz.mid from Duke Nukem.
Weather Warning (MAP25 from BTSX II)
MAP04 from Eternal Doom 3.
About the quietness - what volume model is being used? There are several - Generic, DMX, Native, Apogee, and 9X. Given that Bobby Prince likely never checked for this stuff (and who would?), I would use Generic.

Here's Demons On The Prey (D_E1M7) with Generic volume model:

https://soundcloud.com/sdoom4/doom-demo ... rey-dmxopl

EDIT: the guitar fret being quiet is my fault. It was designed for another volume model, I'll need to increase the volume to compensate. All the other voices are fine.

https://soundcloud.com/sdoom4/duke-nuke ... ers-dmxopl And here is the Duke Nukem 3D request.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: ADLMIDI support

Post by Wohlstand »

Graf Zahl wrote:D_E1M7 would be great because ADLMIDI shows the same glitch here as Timidity
Can you explain to me which glitch you are mean?
Gez wrote: For the drum length fixer, the AdlMIDI code is there.
As I told, the drum-length fixer is part of MIDI player and not part of Synthesizer (which accepts MIDI events to interpret them).

Inside of my MIDI Player (I completely reworked it to provide full seek ability and pre-processing), all events taken from MIDI (or MUS or XMI) file are converting into queues of structures where MIDI event data are stored. Then, there are preprocessing in some count of cycles: the first cycle does sorting of events are in the same row to prevent some issues are caused by wrong order of events inside of MIDI file and put real-time markers per each event row (which are calculated by using of tempo change events to be accurate). Inside of the same cycle, is a check for loop events (loopStart and loopEnd), and to avoid any possible issues caused by invalid placement of them, there are auto-removing when there are wrong, and a song will be played without using of loop points.
The second cycle is a drum length expanding. Here is a check for a distance between of note-on and note-off, and if it is shorter than minimal ticks distance (or real-time delay), there are will be moved forward into next event row until minimal delay will be passed, or end of a track will be reached.

P.S. I have seen you got a conflict with "nukedopl.c" between of your nukedopl.cpp. It's same Nuked OPL3, but at me is a bit newer version, and also recently some guy has tried to optimize it to let it work faster, and I took his optimization for benchmarking and testing, and seems it works almost same. Feel free to use any of NukedOPL3 you have at you or at me as it's same if not count adding of functions to mix stream rather replacing of the input buffer with a new-generated output.

P.P.S. DosBox's emulator even looks accurate and fast, it still has some few issues (with some IMF files I have). The NukedOPL3 emulator does logic of a real chip which gives the best accuracy, however, it requires much more power to work. Is not feeling desktop computers or laptops, but works very slow and choppy on mobile devices if you will don't use audio buffer right.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: ADLMIDI support

Post by Wohlstand »

nazakomu wrote:
Csonicgo wrote: This library is 1000x more complicated than the "dosbox opl3" selector. it's intended to be another midi library with its own set of sound banks and other options, such as number of chips, number of 4-op channels, custom bank locations, and 73+ built-in banks. If it sounds wrong, it's likely wrong.
Indeed.
I have a foobar2000 component, specifically for MIDI, which includes ADLMIDI. It has a vast assortment of sound banks that can be selected for your listening preference, as well as the option to select up to 100 chips, and full panning.
ADLMIDI options at the bottom:
Hey, can you show me it? Or did you write it yourself? Just interesting to look what it is inside of it...
EDIT: Okay, I have googled this: https://gitlab.kode54.net/kode54/foo_mi ... Player.cpp

Jammie O'Connel made full panning in his MIDI driver for real OPL3 chip (worked on Windows 3x and 9x), but with giving limit in 6 channels when full panning option is turned off while 12 channels in regular mode (that driver is nice, but I totally dislike his idea to force AdLib drums mode is very limited in polyphony).
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: ADLMIDI support

Post by Csonicgo »

I just tested this myself and something is horribly wrong. This is not how the library sounds in anything else that I've tried.

And I can't really be much help since I can't really say "what" is wrong with it (because everything is, to be honest).

I know this is a WIP but, it's unbearable to listen to.
User avatar
Wohlstand
Posts: 73
Joined: Sun Dec 17, 2017 3:22 am
Graphics Processor: nVidia with Vulkan support
Location: Moscow, Russia
Contact:

Re: ADLMIDI support

Post by Wohlstand »

I think I'll need to try to build GZDoom by myself to check the playback... I can't guess the error from too common words...

EDIT: Just now checked, YEAH, It's silly to understand! DMX library uses both 10 and 16 channels for percussions. ADLMIDI uses 10'th only and the 16'th channel is melodic! I know that very long time while I experimented with music replacement in original DOS Doom.
You must map 16'th channel into 10'th to avoid any future mistakes, OR, on a beginning of a song, set a bank of the 16'th channel to XG-Percussion to let it work as an independent percussive channel if you don't want merge 10'th and 16'th channel

Also, you did use the wrong function to change program:
adl_rt_bankChange() is needed to change GS/XG bank (use more 127 instruments in the same bank). You need to use adl_rt_patchChange() to set the Patch which is an instrument/program. Be careful, dude ;3

It's my fix I made to make ADLMIDI be playable (apply this as patch).
adlmidi-fix.txt
ADLMIDI fix
(1 KiB) Downloaded 52 times
Anyway, I have found another issue with D_DDTBLU track which results in silent percussions... I'll review that at my home, (at the moment I posted this, I was at my job and I had 10:10 UTC+3 time).
I tried to export all MUS files from DOOM2, and played that track - it worked fine...

P.S. I sent a pull-request with my quick fix: https://github.com/coelckers/gzdoom/pull/439
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: ADLMIDI support

Post by Rachael »

Merged the pull request. This sounds *MUCH* better.

This may or may not make it into the version 3.3 release, but I'm going to go ahead and merge the adlMIDI branch into QZDoom for general testing, once I fix my build environment for it and my devbuild dispatcher script.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ADLMIDI support

Post by Graf Zahl »

Thanks a lot for that bit of help. After a first quick check I do not see a reason to withhold this any longer, but I'm going to test a few more songs this evening when I have more time and better listening equipment.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”