DarkLight 101 May 03, 2003 at 20:54

Ok, I want to use DirectMusic in my game just for playing MIDIs as background music. I read a lot about DirectSound but almost nothing about DirectMusic and I didn’t find information of how playing external MIDI
Can someone tell me how to start?

3 Replies

Please log in or register to post a reply.

ray_f 101 Jul 10, 2003 at 04:01

Check out the samples in DirectX SDK, there are load of sample code running DirectMusic. :)

bladder 101 Sep 22, 2003 at 06:44

direct music is actually easier to use then direct sound becuase you dont have to deal with the buffers manually. The basic idea is that you create an IDirectMusicLoader and an IDirectMusicPerformance. Once those are initialized you need to get an IDirectMusicSegment interface. through the IDirectMusicLoader::GetObject method.

Then through the segment you can play the midi file and do stuff with it. You also need to tell directmusic that it’s a midi file since those are handled differently then WAV files becuase of the instrument data, you do this with the IDirectMusicSegment::SetParam method by specifying GUID_StandartdMidiFile as the first parameter

Now use the IDirectMusicPerformance to play an IDirectMusicSegment interface.

in short…check the sdk docs.

beda 101 May 19, 2005 at 09:05

Hi all,
I am a Newbie to DirectX , DirectSoundand DirectMusic.

Just want to know, I want to get all the frequency information (Amplitude) at each instance of time ( 1/100 second) when playing a wav file and I am wondering which to one to use.

Could you help me ?