[HN Gopher] Show HN: I wrote a partial re-implementation of Dire...
___________________________________________________________________
Show HN: I wrote a partial re-implementation of DirectMusic
DirectMusic[1] is a deprecated Windows API for playing dynamic
music scores authored using DirectMusic Producer[2]. It was
originally released as part of DirectX in 1999 and discontinued
with the release in Windows Vista around 2009-ish. Due to my
involvement with projects[3] re-implementing an old game engine for
the early 2000's games Gothic and Gothic II[4], I came to notice
that existing solutions[5] were incorrect and hard to use. Thus, I
was tasked with writing a new, correct re-implementation of the
API. Today, my re-implementation is able to (mostly) play back so-
called style-based segments[6] and is fully tested against both the
Gothic and Gothic II soundtracks. I am actively working on getting
the Lego Island 2 soundtrack working as well. There are many
features of DirectMusic which the library does not currently
support, simply because I have not been able to find or test
soundtracks using them, so if you want to contribute, I'd love to
know about software shipping with DirectMusic soundtracks! [1]:
https://en.wikipedia.org/wiki/DirectMusic [2]:
https://www.vgmpf.com/Wiki/index.php?title=DirectMusic_Produ...
[3]: Specifically GothicVR
(https://github.com/GothicVRProject/GothicVR) and OpenGothic
(https://github.com/Try/OpenGothic) through my ZenKit library
(https://github.com/GothicKit/ZenKit) [4]:
https://en.wikipedia.org/wiki/Gothic_II [5]: There is libdmusic
(https://github.com/libdmusic/libdmusic) which is unmaintained and
an embedded implementation in OpenGothic
(https://github.com/Try/OpenGothic) [6]:
https://documentation.help/DirectMusic/howmusicvariesduringp...
Author : lmichaelis
Score : 71 points
Date : 2024-06-08 10:02 UTC (1 days ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| nialv7 wrote:
| > I came to notice that existing solutions[5] were incorrect and
| hard to use.
|
| Didn't see you mentioning wine, are you not aware of it?
| teruakohatu wrote:
| Wine's first release containing very limited support came out
| in September 2023. Wine 9.0's release earlier this year
| contained "The foundation of several of the DirectMusic modules
| is implemented" which still sounds quite limited.
| nialv7 wrote:
| I just felt this is a missed opportunity to work
| collaboratively. Unless the author knows about wine and
| nonetheless chose to start a new project. Which is completely
| fine too.
| astrange wrote:
| WINE doesn't allow contributions from people who know too
| much about actual Windows implementations iirc, so that
| could be a problem.
| lmichaelis wrote:
| I was thinking about contributing to Wine, but I am not
| experienced with Windows native APIs. There is also a
| difference in how my library works and how DirectMusic
| worked originally.
|
| My library uses a "pull"-model, meaning the application
| must call a function to render more music. DirectMusic
| was more of an unattended "push"-model where you'd just
| tell it to play something and it'd set up playback
| automatically. It'd just play the music in a background
| thread (maybe even on hardware) and your application
| could subscribe to certain events (like get a callback on
| every beat).
| lmichaelis wrote:
| I do know about the implementation in Wine, but sadly that one
| is not really useful for someone wanting to add support into a
| cross-platform app. Wine's implementation is tightly integrated
| with the Windows APIs it tries to recreate, so it has things
| like IUnknown and other Windows idiosyncrasies that aren't
| suitable for deployment as a library.
| asveikau wrote:
| IUnknown is just a vtable. It isn't even code. There are
| cross platform projects that have used it.
|
| That said, I'm not knocking you for that, there likely are
| some win32 dependencies.
| teruakohatu wrote:
| Good work. You may want to consider contributing code to the wine
| porject.
|
| Apparently Unreal 2, Final Fantasy 8 (original) and Midnight Club
| II use DirectMusic.
| cosmotic wrote:
| I chatted with the music producer for One Must Fall:
| Battlegrounds years ago during development. He mentioned using
| direct music.
| https://en.m.wikipedia.org/wiki/One_Must_Fall:_Battlegrounds
| pushfoo wrote:
| > I'd love to know about software shipping with DirectMusic
| soundtracks!
|
| The Creatures series used procedural music for their MNG
| format[1] starting with Creatures 2, but I don't know if it's
| backed by DirectMusic. It may be on Windows, but I never did any
| disassembly to check.
|
| Regardless, thank you for posting something procedural which
| isn't backed by LLMs!
|
| [1]: https://creatures.wiki/MNG_files
| robinduckett wrote:
| It is not backed by DirectMusic - the mng files just play wav
| files via whatever DirectSound equivalent for the platform
| (source files for the games are available in certain places)
| monocasa wrote:
| What are some of the libraries games use nowadays for game
| soundtracks?
| lmichaelis wrote:
| FMOD[1] is a really big one being used in many modern games and
| Wwise[2] is also available.
|
| [1]: https://www.fmod.com/
|
| [2]: https://www.audiokinetic.com/en/wwise/overview/
| ClimaxGravely wrote:
| In the last 10 years I'd say the majority of the projects I
| worked on used WWise. The audio people love it.
| lloydatkinson wrote:
| On an unrelated note I've been hoping someone would reimplement
| DirectPlay. There's a childhood game that barely works on modern
| Windows as it is, and it has a networking component that allowed
| for either LAN or public internet play.
|
| The server was never made available and even if it was, I
| wouldn't want to host a DirectPlay server from over 20 years ago
| online.
|
| Caveat is here I would prefer to write the server in C#.
|
| So if there was ever an open source implementation of DirectPlay
| for emulation/preservation reasons, I'd jump on the opportunity
| to get the game working again.
|
| Well it's either that or I try do some reverse engineering of
| packets with wireshark...
| frabert wrote:
| Hi! Original author of libdmusic here -- kudos for the effort, I
| feel like I'm one of the very few people who know the struggle of
| getting useable audio out of original DirectMusic files :)
___________________________________________________________________
(page generated 2024-06-09 23:01 UTC)