View Full Version : DirectMusic

25-11-2003, 08:46 PM
Anyone have a download available for DirectMusic.pas (For DirectX 8 or DirectX 7 if it was available for DX7). I havn't been able to find it anywhere.... For Dx9 is available but the older files are not.

Also - anyone have examples/tutorials on using DirectMusic for playing Midi files. I've got someone interested in supplying Midi files for free for my games.

26-11-2003, 02:17 AM
I have a copy of DirectMusic.pas (http://www.biocoders.org/downloads/DirectMusic.pas 288Kb) for DirectX 8 (but no examples) or i have WDirectX Component set (http://www.biocoders.org/downloads/wdx_20000922-5.zip 632Kb) which have the units for DirectX 7 (which include examples).

Hope these help

26-11-2003, 05:55 AM
Thanks - I'll try them tonight or tomorrow. (Tonight is kiddies xmas party at the nursery school)

26-11-2003, 06:03 AM
DirectMusic has not changed since DirectX8. But it's greatly improved/unified with DSound in DX7->DX8 transition. So, I'll recommend you to use DirectMusic8 available throw DirectX 8.0 and runnable on all version of Windows (including Win95).

27-11-2003, 08:48 AM
I've tried both the Dx8 and DX7 files and couldn't get a program working that will play a Midi file - I got a program to compile but it didn't accept some of the commands (caused access violations).

Could someone cleverer than me pleas eput together an example of playing a midi (looped) and let me know where I can download it (please include the DirectMusic.pas etc files you use).

I'd really like it to work with Dx7 as thats the level I'm using at the moment.


27-11-2003, 05:29 PM
Why not just use the TMediaPlayer component to play Midi's?!?
But anyway i have found a site with what you are looking for (but its not in delphi, but you might be able to translate it)::
Hope this helps...

28-11-2003, 06:16 AM
Thanks - I'll give it a try.

11-01-2004, 10:23 PM
I made a little sample for you cause I didn't have anything better to do :)

It shows how to initialize DirectMusic and load & play midi file. It can also play sgt and sgp files which are native fileformats of DirectMusic. They can also contain sound samples in the file, a bit like mod or xms.

M109uk, there are many benefits using DirectMusic in insted of TMediaPlayer. DirectMusic has a pretty good sounding software synthesizer which supports DLS files and you can even use SoundFonts (though it's a bit tricky) and synth supports also reverb, chrous, flanger and many other effects which can be all adjusted on the fly. Most of soundcards (or integrated AC'97 chips which don't have hardware midi at all) lack all these features anyway.

12-01-2004, 05:22 AM
Thanks - I've downloaded it and will try tonight.

06-06-2005, 05:57 PM
heh! that sample was exactly what i was looking for!!!