The Power of DirectMusic
DirectMusic does much more than simply play sounds. It provides a complete system for implementing a dynamic soundtrack that takes advantage of hardware acceleration, (DLS), (DMOs), and advanced 3-D positioning effects.
By using the DirectMusic interfaces in your application, you can do the following:
- Load and play sounds from files or resources in MIDI, WAV, or DirectMusic Producer run-time format.
- Play from multiple sources simultaneously.
- Schedule the timing of musical events with high precision.
- Send tempo changes, patch changes, and other MIDI events programmatically.
- Use Downloadable Sounds. By using DLS, an application can be sure that message-based music sounds the same on all computers. An application can also play an unlimited variety of instruments and even produce unique sounds for individual notes and velocities.
- Locate sounds in a 3-D environment.
- Easily apply pitch changes, reverberation, and other effects.
- Use more than 16 MIDI channels. DirectMusic makes it possible for any number of voices to be played simultaneously, up to the limits of the synthesizer.
- Play segments on different audiopaths, so that effects or spatialization can be applied individually to each sound.
- Capture MIDI data, or stream ("thru") it from one port to another.
If you use source files from DirectMusic Producer, you can do much more:
- Control many more aspects of playback at run time; for example, by choosing a different set of musical variations or altering the chord progression.
- Play music that varies subtly each time it repeats.
- Play waveforms with variations.
- Map to audiopaths, so that different parts within the same segment can have different effects.
- Compose wholly new pieces of music at run time, not generated algorithmically but based on elements supplied by a human composer.
- Dynamically compose transitions between existing pieces of music.
- Cue transitions, motifs, and sound effects to occur at specified rhythmic points in the performance.
These capabilities are the ones most often used by mainstream applications. DirectMusic is designed to be used easily for the basic tasks, but it also allows low-level access to those who need it. It is also extensible. Specialized applications can implement new objects at virtually every stage on the audiopath, such as the following:
- 5Loaders to parse data in new or proprietary formats.
- Tracks containing any kind of sequenced data.
- Tools to process messages; for example, to intercept notes and apply transpositions, or to display lyrics embedded in a segment file.
- Custom sequencer.
- Custom synthesizer.
- Effects filters.
DirectMusic delivers full functionality on Microsoft Windows® 98 and Microsoft Windows 2000. Support for hardware synthesizers is available only on Windows 98 Second Edition, Windows 2000, and later operating systems. The default Microsoft software synthesizer is always available.
Although DirectMusic loads and plays WAV files, applications that need highly optimized performance or low-level control over sound buffers can still use the DirectSound API. For a comparison of the two APIs, see DirectSound and DirectMusic.