Search code examples
c++cwindowsdirectxdirectx-9

How to compile legacy source code with DirectMusic API?


I have some legacy source code that uses the old DirectMusic API. The source code depends on the dmusici.h, dmusicc.h and dmusicf.h header files, as well as other legacy DirectX header files.

Surprisingly, the current Microsoft SDK for Windows 11 contains most of the old DirectX APIs, including the header dmusicc.h with the DirectMusic API Core. But the dmusici.h and dmusicf.h header files are missing.

Is there still some way to compile this old legacy code, or do I have to port all the missing APIs because they went lost?

What's even more surprising is that the compiled executable version from 2003 still runs just fine on Windows 11 (apart from the resolution issue on my 4k monitor). This means that the actual DLL containing the implementation for the DirectMusic API still has to be around somewhere. Maybe these missing header files have been merged somehow with other header files? Although, when I searched for a file containing one of the function signatures of these header files, I couldn't find anything.


Solution

  • The story here is a long and messy one, so I'll try to summarize it.

    The technology branded "DirectMusic" is actually three different things:

    • DirectMusic "Core" MIDI
    • DirectMusic Performance Layer
    • DirectMusic Producer Tool

    Game adoption of DirectMusic was always limited, and really speaks to a short period of time when the industry was looking at General MIDI as a game music solution--Origin's George Sanger (a.k.a "The Fat Man") was a really big proponent of it for many reasons. Ultimately, however, "digital audio" became the Defacto standard for game audio and MIDI became a very niche thing (like FM synthesis before it).

    Meanwhile, audio professionals made use of the DirectMusic "Core" APIs to access time-stamped MIDI. There was a time when Windows Vista was going to ship without any DirectMusic APIs--Beta 2 and RC didn't have it--, and it caused a lot of angst for professional audio application developers.

    Ultimately, the DirectMusic "Core" APIs were updated to support x64 including the software synthesizer for Windows 7, the headers shipped in the Windows SDK as a core part of the platform, and that's what you see there.

    dmusic.dll
    dmsynth.dll
    dmloader.dll
    dswave.dll
        
    dls1.h
    dls2.h
    dmdls.h
    dmerror.h
    dmksctrl.h
    dmusbuff.h
    dmusicc.h
    dmusics.h
    

    The DirectMusic Performance Layer meanwhile is only 32-bit x86, has been fully deprecated, and the binaries moves into a "Windows Feature" only for appcompat. That's why you can't find those headers/libs in any modern SDK, and the docs are minimal at best. It is likely to have numerous security issues as well.

    The DirectMusic Producer was its own download and was deprecated a long, long time ago.

    The last SDK to contain DirectMusic Performance Layer headers was DirectX SDK (August 2007).

    dmstyle.dll
    dmscript.dll
    dmcompos.dll
    dmband.dll
    dmime.dll
        
    dmplugin.h
    dmusicf.h
    dmusici.h
    

    Also, no Windows Server edition contains DirectMusic or has a supported way to enable them.