DirectMusic

49921baa7439fb1e91e02caf0a925cfe
0
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.

994af94f871438b5fe2c0d002b3c659d
0
ray_f 101 Jul 10, 2003 at 04:01

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

22b3033832c5c699c856814b0cf80cb1
0
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.

56a740ccde7b035de1954cf1c18327b3
0
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 ?