DirectMusic is rather large, so I'm not going to go into any detail about it. It's a topic for an entire book. However, I'm going to talk about the interfaces that you're going to work with. Take a look at Figure 10.12 for DirectMusic's main interfaces.
The descriptions of these interfaces are as follows:
IDirectMusic— This is the main interface of DirectMusic, but unlike DirectDraw and DirectSound, you don't necessarily need it to use DirectMusic. It is created by default and hidden away when you create a DirectMusic performance object—thank God.
IDirectMusicPerformance— This is the main interface as far as you're concerned. The performance object controls and manipulates the playback of all musical data. In addition, it creates an IDirectMusic object when it is created.
IDirectMusicPort— This is where the digital data representing your MIDI music is streamed out to. In most cases it will be the Microsoft Software Synthesizer, but you can always enumerate other possible ports that are hardware-accelerated.
Generally speaking, DirectMusic is a MIDI-to-digital real-time converter with DSP (Digital Signal Processing) abilities. As I mentioned in the DirectSound discussion on MIDI, the problem with MIDI is that it can sound different from one machine to the next based on the hardware and the instrument patches. DirectMusic gets around this by using pure digital samples of the instruments in the form of DLS files. Therefore, whenever you make a song, you can use the default DLS file or create your own instrument file. The catch is that the instruments are digital in nature and come with your music. Digital sound always plays the same through a D/A, so the music always sounds the same. Take a look at Figure 10.13 to see this.
The default DLS instruments that are available on every machine loaded with DirectMusic are the Roland GM/GS (General MIDI). They sound great, but you can't modify them in any way—Roland doesn't want you making them look bad!
You're probably going "What the heck?" right about now. I know, I know, it always seems that everything is more complicated than it needs to be. But complexity is good because it allows future technology and innovation to fit in. That is the basis of DirectMusic.