{
  "added_at": "2026-11-09",
  "additional_evidence_urls": [
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/include/dmusic.h",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/CMakeLists.txt",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/src/util/Tsf.c",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/src/Performance.c",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/src/_Internal.h",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/examples/play-segment.c",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/.github/workflows/build.yml",
    "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/LICENSE.md",
    "https://dm.gothickit.dev/"
  ],
  "category": "reconstruction-cases",
  "class": "software",
  "description_en": "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.",
  "description_zh": "以可移植的 C11 库重新实现 DirectMusic，即 Microsoft 随早期 DirectX 提供的自适应配乐 API；它载入游戏的段落（segment）、风格（style）和 DLS 音色文件，并将音乐渲染为 PCM。README 只列出 Gothic 与 Gothic II（含 Night of the Raven）的配乐经过测试，且只是“大致”正确；项目自称尚不完整、仍在大力开发中。乐器经 DLS 转 SoundFont 后由内置的 TinySoundFont 合成器发声。",
  "entry_url": "https://awesomerea.org/resources/dmusic-directmusic-reimplementation-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/dmusic-directmusic-reimplementation-case/",
  "evidence_url": "https://github.com/GothicKit/dmusic/blob/b73b270b94714b8ec8d9d0b2a9f3a5c445da52d1/README.md",
  "group": "cases",
  "id": "dmusic-directmusic-reimplementation-case",
  "json_url": "https://awesomerea.org/resources/dmusic-directmusic-reimplementation-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/dmusic-directmusic-reimplementation-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/dmusic-directmusic-reimplementation-case/index.md",
  "name": "DirectMusic: an open reimplementation of Microsoft’s music API",
  "name_zh": "DirectMusic：微软音乐 API 的开源重新实现",
  "reconstruction_method": "other",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "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."
  ],
  "requirements_zh": [
    "该 C11 库提供自己的 DmLoader、DmSegment 和 DmPerformance API。“结尾加前奏”装饰及部分曲线和消息类型尚未实现。",
    "使用者需通过解析回调提供自己游戏数据中的 .sgt 段落、.sty 风格和 .dls 音色集；仓库不附带这些文件。",
    "构建需要 C11 编译器和 CMake 3.10+。支持 Linux、macOS 和 Windows。play-segment 示例需要 <unistd.h> 和 <sys/stat.h>。",
    "README 报告 Gothic 与 Gothic II 配乐运行“大致”正确。CI 为 Linux、Android、macOS 和 Windows 构建库；未列出测试套件或与 Microsoft 运行时输出的比较。",
    "LICENSE.md 对项目代码采用 MIT 许可证（现代变体）。TinySoundFont、miniaudio 和 Gothic II 主题曲渲染有各自权利；游戏音乐保留原有权利。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/GothicKit/dmusic",
  "verification": "source-reviewed",
  "verified_at": "2026-10-19"
}
