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?
Check out the samples in DirectX SDK, there are load of sample code running DirectMusic.
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.
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 ?