Microsoft DirectX 8.1 (C++) |
When a segment is played, most of its tracks generate messages containing information about events that are to take place during playback. For more information, see DirectMusic Tracks.
A few tracks send more than one kind of message. For example, a style track sends note messages and time signature messages. In such cases, an application can disable certain kinds of messages in the track. For more information, see Disabling and Enabling Track Parameters.
The performance engine determines when each message is to be processed in clock time. In the case of channel messages, the performance also determines which
Certain messages, such as tempo and time signature changes, are immediately processed and freed by the performance. Other messages, such as notes and patch changes, are placed in a queue and processed in order of time stamp.
Note There is no guarantee that messages with the same time stamp will be processed in any particular order.
Time signature messages are purely informational. The time signature is built into the segment and cannot be changed.
Messages are first sent to any tools in the segment toolgraph, then to the audiopath toolgraph, and finally to the performance toolgraph.
The application is responsible for creating the segment and performance toolgraphs and defining the tools. For more information on creating toolgraphs, see the following topics:
Audiopath toolgraphs are optional components of audiopath configurations in DirectMusic Producer files. The application doesn't need to do anything to implement an audiopath toolgraph after creating the audiopath.
The first tool in a toolgraph processes the message and then, if it wants to pass it on, has the toolgraph stamp the message with a pointer to the next tool.
At this point the toolgraph also flags the message with a delivery type that determines when the message is delivered to the next tool. This flag is based on what delivery type the tool is expecting, as follows:
The current tool can change the delivery type after the toolgraph has finished stamping and flagging the message.
Ultimately, unless a message has been discarded, it arrives at the DirectMusic output tool, which converts all the data it receives into standard MIDI messages and delivers these to the synthesizer through the port buffer.
For an illustration, see Overview of Audio Data Flow.