JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

DirectMusic: The Great Experiment

DirectMusic is one of the most exciting components of DirectX and became available in Version 6.0. As I said before, writing digital sound software is hard, but writing software that plays MIDI files is gnarly! DirectMusic plays MIDI files, and it does a whole lot more. Here's a list of its capabilities:

  • Supports DLS instruments (downloadable sounds). This means that when you play a MIDI file using DirectMusic, it will always sound the same no matter what kind of hardware you have.

  • Supports on-the-fly composition of music using the Interactive Music Engine. DirectMusic allows you to set up templates, personalities, and variations of mood for your songs. Then DirectMusic will take your song data and rewrite the music in real-time and generate more music!

  • Supports an unlimited number of MIDI channels, limited only by the processing power of your PC. Normal MIDI supports 16 channels, or 16 individual sounds, at once. There are 65,536 channel groups under DirectMusic, so you have almost unlimited tracks that can be played at the same time.

  • Uses hardware acceleration if available, but the Microsoft software synthesizer is default and sounds as good as wave table or wave guide synthesis.

The only bad news about DirectMusic is that it is as complex as Direct3D! I have read the online documents for it (around 500 pages), and I can tell you one thing: They didn't have simplicity in mind, but they did have power in mind. Luckily, all you want to do is play a darn MIDI file, so I'm going to show you exactly how to do that and create an API around DirectMusic so you can load and play MIDI files. Also, as I mentioned before, with DirectX 8.0, DirectSound and DirectMusic have been integrated (but not removed) into DirectX Audio. The results of which are a new IDirectSound8 interface and a new DirectMusic interface, but these interfaces add nothing for our purposes, less make things more complex. Hence, we are going to forgo them.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor