Microsoft DirectX 8.1 (C++) |
The control segment is the source of any data that is shared across tracks. The following tracks give their data to the performance not by sending messages, as most other tracks do, but by responding to parameter calls.
The chord track, for example, answers parameter calls from the style track. To determine the MIDI value for a note before sending that note, the style track must determine the current chord. It does so by calling IDirectMusicPerformance8::GetParam, and this call is relayed to the chord track in the control segment.
To function as a control segment, a segment must have at least one controlling track. The mute, command, tempo, and chord tracks are controlling tracks.
The control segment does not affect any aspect of playback that is controlled by messages. The time signature comes from the control segment only when there is no time signature track, as is normally the case in segments not based on MIDI files.
By default, the primary segment is the control segment. However, a secondary segment can be designated the control segment by passing the DMUS_SEGF_CONTROL flag to IDirectMusicPerformance8::PlaySegment or IDirectMusicPerformance8::PlaySegmentEx.
When a secondary segment is the control segment, the primary segment continues to function as a fallback source of control data. For example, if a secondary control segment does not contain a tempo track, but the primary segment does, the tempo comes from the primary segment.
For more information, see the following topics: