Closed emawind84 closed 2 years ago
I found the bug inside the class FileSystemSoundFontReader that was preventing patches from getting loaded in GMXGUS mode in the original implementation, I will do some more changes later...
The issue is in the method open_file
fopen
flag used is rt
but it should be rb
to read binary files.
But is GZDoom also affected? Is it somehow related to this? https://forum.zdoom.org/viewtopic.php?f=104&t=74550&p=1211722 This is not a simple change, i think someone else with MIDI knowledge should look at it, but who? Besides you know that i mostly discontinued LZDoom do you? Anyway fixes are always welcome.
I don't even know how to load the patches, either the ones that came with that wad in GRAVPATS.ZIP or those in EAWPATS.ZIP. I changed the gus_patchdir CVAR. May be they should be in the soundfonts folder i dunno. When i tested GUS both in GZDoom and LZDoom the music sounded bad and different from Timidity++.
But is GZDoom also affected? Is it somehow related to this? https://forum.zdoom.org/viewtopic.php?f=104&t=74550&p=1211722 This is not a simple change, i think someone else with MIDI knowledge should look at it, but who? Besides you know that i mostly discontinued LZDoom do you? Anyway fixes are always welcome.
Is not a simple change but it fix the problems with the GUS emulation and also with Wild midi configuration not working as it should. The problems are not related to how the emulation sound itself so I didn't need any knowledge regarding MIDI. GUS emulation was not reading the lump inside doom.wad and doom2.wad, now it does. Also wild midi configuration work with the collection of gus patches if they are found.
I think someone else with MIDI knowledge should look at it, but who?
I used my times to fix these issues and even though I don't have a great knowledge of MIDI I still took the time to research about it before touching the code also because I care about this port and even though this will be discontinued is still the base for the VR port questzdoom that I am currently maintaining.
I read some comments on discord last year regarding these issues affecting also gzdoom but I still need to grab the zmusic source to have a look at it. But since someone else with MIDI knowledge should look at it I really don't know if I want to do it anymore.
I don't even know how to load the patches, either the ones that came with that wad in GRAVPATS.ZIP or those in EAWPATS.ZIP. I changed the gus_patchdir CVAR. May be they should be in the soundfonts folder i dunno. When i tested GUS both in GZDoom and LZDoom the music sounded bad and different from Timidity++.
Just put the zip inside the folder soundfonts
and they will be listed in the collection of soundfonts, then you can select them in the advanced options, under the option select configuration
.
GUS patches are supported by GUS, Timidity+ and Wildmidi emulation.
Inside the zip (resource file), has to be present the timidity configuration timidity.cfg
, this configuration will be used and the right instruments will be loaded accordingly.
You can switch between timidity configuration and lump configuration (DMXGUS lump) in advanced options -> midi player options -> gus emulation -> read dmxgus lumps
.
When i tested GUS both in GZDoom and LZDoom the music sounded bad
Thats because it was trying to read the default sf2 configuration file, but it seems like the gus emulation (old timidity) wasn't finished and so the implementation is lacking support for sf2 files, so I just removed them from the list. I don't think people would use gus emulation with sf2 files anyway, there are already Timidity++ and fluidsynth that work way better with these files.
I think someone else with MIDI knowledge should look at it, but who?
Frankly I think your answer show a little lack of consideration since I might know about MIDI without having to tell the whole Internet about it and getting your reply after I worked hard at fixing these problems it doesn't feel good I can tell you. If I told you that I fixed these problems why someone else should look at it in the first place?
No, i mean someone else than me to review the PR. I will try to load the patches.
Some musics sound way different when changing the gus memory, you can try the map E2M1 and play with the gus memory when using the lump configuration (it doesn't work with timidity.cfg) and you will notice different use of instruments.
Fixes for gus, timidity+ and wildmidi emulation
DMXGUS
andDMXGUSC
lumpgus_patchdir
and/orULTRADIR
variable can be used to load custom gus patches together with main patches set withmidi_config
(not required when using DMXGUS(C) lump configuration)gus_patchdir
andULTRADIR
variable can be used whether DMXGUS or timidity configuration is usedSetupDMXGUS
not loading lump correctly, wrong use of CheckNumForFullName, both DMXGUS and DMXGUSC will be recognized correctlyFZipPatReader
so we can add custom patches along with the patches present in the resource file by usinggus_patchdir
and/orULTRADIR
variable (some custom maps has custom patches that can be added this way without putting them inside the resource file or in the same folder of the configuration file)midi_config
default to empty string, sincelzdoom.sf2
doesn't seem supported (distorted sound)midi_config
,wildmidi_config
andtimidity_config
has precedence over the SoundFont collection built by SoundfontSearch.Directories. Now is possible to point the config property to a timidity configuration file inside a folder with GUS patches without it being overridden by the first valid SoundFont from the collection.default_cmsg
anddefault_ctl_cmsg
wrong use ofvprintf
causing access violation exception in some scenariogus_pathdir
and the variableULTRADIR
.To properly test the DMXGUS configuration the
gus_memsize
can be tweaked so the sound will listen differently depending on the memory selected (256 / unlimited sounds way different).Also to test the
midi_config
andwildmidi_config
is better to remove paths from the sectionSoundfontSearch.Directories
since a valid item is picked from the collection if no value has been set for these options.A good example of custom
DMXGUSC
lump with custom patches is the map d2xtreme, where the music will sound quiet different whether you use the lump as configuration or the fallback timidity configuration https://www.doomworld.com/idgames/levels/doom2/d-f/d2xtreme