Microsoft DirectX 8.1 (C++)

Track Composition

Most tracks in a segment are fixed and generate the same data each time the segment is played. However, tracks can generate their data dynamically each time they start playing or each time they loop, provided they implement the IDirectMusicTrack8::Compose method and are configured to do so.

One standard track, the signpost track, supports composition. The signpost track composes a new chord track from a chordmap.

Normally the track configuration is set by the author, but the application can turn track composition behaviors on and off by passing one or more of the following flags to IDirectMusicSegment8::SetTrackConfig or IDirectMusicSegmentState8::SetTrackConfig.

Flag Effect
DMUS_TRACKCONFIG_COMPOSING The track is composed by the IDirectMusicSegment8::Compose method.
DMUS_TRACKCONFIG_LOOP_COMPOSE The track is automatically composed each time the segment loops.
DMUS_TRACKCONFIG_PLAY_COMPOSE The track is automatically composed each time the segment starts.

Automatic composition can take place only when the segment contains a track in which to put the composed content. When the signpost track is composed, it requires a chord track for the new chords. You can ensure that the necessary tracks exist by calling IDirectMusicSegment8::Compose before playing the segment.

If you choose to do all composition manually, the only configuration flag to set is DMUS_TRACKCONFIG_COMPOSING. Provided neither of the other two flags is set, the tracks will be composed only when you call Compose.