Game Music Emu Update?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Game Music Emu Update?

Post by Kinsie »

[wiki]Game Music Emu[/wiki], for those not aware, is the library ZDoom uses to handle emulated music formats like SPC and VGM.

The VGM format was originally developed to handle music from a couple of very specific platforms - the Master System and Genesis - but in more recent years has been expanded to support a great number of audio chips, allowing for the format to support platforms as varied as the Neo Geo and Sharp X68000 that have no equivalents elsewhere in ZDoom, as well as a few that are supported in other ways like the NES and PC Adlib.

Updating ZDoom's Game Music Emu implementation was suggested a couple of years ago. but was turned down due to licensing conflicts involving the library getting relicensed by a new maintainer under the GPL, and as a result the library has sat more or less static since with the exception of a backported security fix. Since the GPL conflict is no longer an issue, I'd appreciate if this was reconsidered - much like with the current, mature game music implementations like SPC, it would allow maps and mods that used music from other videogames to achieve an authentic sound at a much lower filesize hit than creating an OGG version.
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: Game Music Emu Update?

Post by Graf Zahl »

If someone can set it up, sure. I don't have time for this right now.
There's a lot of new stuff - this is not just a simple drop-in replacement - and some work is needed to make it fit together.
User avatar
Shadow Hog
Posts: 173
Joined: Fri Aug 14, 2015 8:56 pm

Re: Game Music Emu Update?

Post by Shadow Hog »

Also in favor of this feature, though since it was my post linked in the OP, I suppose that was a given.

On a whim, I decided to take a stab at implementing it myself, but my inexperience quickly got the better of me. Attempting to point the project to an external folder containing kode54's GME implementation, as well as a .lib file from a compile thereof that I'd done earlier, just resulted in various linker errors in music_gme.obj that imply to me that that .lib file either wasn't built correctly, or wasn't the correct thing to plug into GME_LIBRARIES in CMake:

Code: Select all

unresolved external symbol gme_start_track referenced in function "public: virtual void __cdecl GMESong::Play(bool,int)" (?Play@GMESong@@UEAAX_NH@Z)
unresolved external symbol gme_play referenced in function "protected: static bool __cdecl GMESong::Read(class SoundStream *,void *,int,void *)" (?Read@GMESong@@KA_NPEAVSoundStream@@PEAXH1@Z)
unresolved external symbol gme_delete referenced in function "public: virtual __cdecl GMESong::~GMESong(void)" (??1GMESong@@UEAA@XZ)
unresolved external symbol gme_set_fade referenced in function "public: virtual void __cdecl GMESong::Play(bool,int)" (?Play@GMESong@@UEAAX_NH@Z)
unresolved external symbol gme_track_ended referenced in function "protected: static bool __cdecl GMESong::Read(class SoundStream *,void *,int,void *)" (?Read@GMESong@@KA_NPEAVSoundStream@@PEAXH1@Z)
unresolved external symbol gme_tell referenced in function "public: virtual class FString __cdecl GMESong::GetStats(void)" (?GetStats@GMESong@@UEAA?AVFString@@XZ)
unresolved external symbol gme_track_info referenced in function "protected: bool __cdecl GMESong::GetTrackInfo(void)" (?GetTrackInfo@GMESong@@IEAA_NXZ)
unresolved external symbol gme_free_info referenced in function "public: virtual __cdecl GMESong::~GMESong(void)" (??1GMESong@@UEAA@XZ)
unresolved external symbol gme_set_stereo_depth referenced in function "protected: virtual void __cdecl GMESong::GMEDepthChanged(float)" (?GMEDepthChanged@GMESong@@MEAAXM@Z)
unresolved external symbol gme_identify_header referenced in function "char const * __cdecl GME_CheckFormat(unsigned int)" (?GME_CheckFormat@@YAPEBDI@Z)
unresolved external symbol gme_identify_extension referenced in function "class MusInfo * __cdecl GME_OpenSong(class FileReader &,char const *)" (?GME_OpenSong@@YAPEAVMusInfo@@AEAVFileReader@@PEBD@Z)
unresolved external symbol gme_new_emu referenced in function "class MusInfo * __cdecl GME_OpenSong(class FileReader &,char const *)" (?GME_OpenSong@@YAPEAVMusInfo@@AEAVFileReader@@PEBD@Z)
unresolved external symbol gme_load_data referenced in function "class MusInfo * __cdecl GME_OpenSong(class FileReader &,char const *)" (?GME_OpenSong@@YAPEAVMusInfo@@AEAVFileReader@@PEBD@Z)
Before such linker errors, though, the only change that seemed to be necessary was adding a third "fade length (in milliseconds)" parameter to music_gme.cpp:273 (I just went with 0 for what's presumably an instant stop, but I don't know what the proper value actually would be).

Replacing the files inside the game_music_emu folder would obviously be the better angle, though kode54's Github didn't actually include any CMakeLists.txt to work off of (and I don't really know the first thing about writing one). Also probably would mean importing his File_Extractor project that he rewrote the GME code to use in lieu of Data_Reader.h (for reasons not wholly adequately explained), or else rewriting the code to excise it... tasks probably better left to people who better know what they're doing than myself.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Game Music Emu Update?

Post by Rachael »

Apparently, this has already been done, so I am going to mark it accordingly.
User avatar
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Game Music Emu Update?

Post by Kinsie »

Rachael wrote:Apparently, this has already been done, so I am going to mark it accordingly.
Looks like it was an update to the latest version of the code that GZDoom uses. So, mainly bug and security fixes and improvements to existing functionality, as I understand it. Which is great and very much appreciated! But this feature request was about adding extra functionality from a fork, which as I understand it is a hairier proposition.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Game Music Emu Update?

Post by Rachael »

My mistake - I will reopen this.
Post Reply

Return to “Feature Suggestions [GZDoom]”