Case study
DirectMusic: an open reimplementation of Microsoft’s music API
Re-implements DirectMusic, the adaptive-soundtrack API Microsoft shipped with early DirectX, as a portable C11 library that loads a game’s segment, style and DLS instrument files and renders the music to PCM. The README lists only the Gothic and Gothic II (Night of the Raven) soundtracks as tested, and as working “somewhat” correctly; the project calls itself incomplete and under heavy development. Instruments play through a vendored TinySoundFont synthesizer after DLS-to-SoundFont conversion.
- Targets
- Game
- Category
- Independent reconstruction cases
- Relationship
- Independent reconstruction project
- Sources reviewed
- Stars
- 63
- Last commit
- 2026-03-02
- Language
- C
GitHub data as of 2026-11-09
Requirements & limits
- The C11 library exposes its own DmLoader, DmSegment and DmPerformance API. End-and-intro embellishment, some curves and message types remain unimplemented.
- Users supply their own .sgt segments, .sty styles and .dls collections from game data through a resolver callback; the repository ships none of these files.
- Building needs a C11 compiler and CMake 3.10+. Linux, macOS and Windows are supported. The play-segment example needs <unistd.h> and <sys/stat.h>.
- The README reports the Gothic and Gothic II soundtracks working “somewhat” correctly. CI builds the library for Linux, Android, macOS and Windows; no test suite or Microsoft runtime output comparison is listed.
- LICENSE.md grants the MIT License (Modern Variant) for project code. TinySoundFont, miniaudio and the Gothic II theme rendering have separate rights; game music retains its rights.
Cite
BibTeX
@misc{dmusic-directmusic-reimplementation-case,
title = {{DirectMusic: an open reimplementation of Microsoft’s music API}},
howpublished = {\url{https://github.com/GothicKit/dmusic}},
url = {https://github.com/GothicKit/dmusic},
urldate = {2026-10-19},
note = {Awesome REA entry: \url{https://awesomerea.org/resources/dmusic-directmusic-reimplementation-case/}}
}Plain text
DirectMusic: an open reimplementation of Microsoft’s music API. https://github.com/GothicKit/dmusic (accessed 2026-10-19). Awesome REA entry: https://awesomerea.org/resources/dmusic-directmusic-reimplementation-case/
Useful? Star Awesome REA on GitHub2.4k
About this entry
The description was reviewed against primary sources.
Primary sources
- README.md GitHub · GothicKit/dmusic · Revision b73b270
- include/dmusic.h GitHub · GothicKit/dmusic · Revision b73b270
- CMakeLists.txt GitHub · GothicKit/dmusic · Revision b73b270
- src/util/Tsf.c GitHub · GothicKit/dmusic · Revision b73b270
- src/Performance.c GitHub · GothicKit/dmusic · Revision b73b270
- src/_Internal.h GitHub · GothicKit/dmusic · Revision b73b270
- examples/play-segment.c GitHub · GothicKit/dmusic · Revision b73b270
- .github/workflows/build.yml GitHub · GothicKit/dmusic · Revision b73b270
- LICENSE.md GitHub · GothicKit/dmusic · Revision b73b270
- https://dm.gothickit.dev/
More in Games
- Dishonored: reconstructing Windows XP compatible storefront DLLs · Case study
- DLSSNR-AMD: reimplementing DLSS 5 neural rendering for RDNA4 · Case study
- dndserver: a replacement Dark and Darker server · Case study
- Dodge It: annotated Fairchild Channel F disassembly · Case study
- Does reverse engineering need a bigger model? General and specialist models in Touhou reconstruction · Case study
- Dogfish: reconstructing Conquest of Skyrim's strategic systems · Case study