Embedding an Audiopath in a Segment
Within DirectMusic Producer, most segments are played on the audiopath selected in the Audiopath List. In applications, segments are usually played on an audiopath specified by the application, either a standard audiopath or one created from an audiopath configuration (.aud) file.
You can also embed an audiopath in a segment so that the segment plays on that audiopath at design time, and can easily be played on the same audiopath by applications as well. Embedded audiopaths provide greater control over playback and more flexibility in creating performance configurations that are specific to the content of the segment.
Note Embedded audiopaths consume more resources than shared audiopaths, and should be used only when necessary. See also Pitfalls of Embedded Audiopaths.
All other segments, unless they also have embedded audiopaths, will continue to play using the default audiopath.
An embedded audiopath completely replaces the default audiopath when the segment plays. If any settings in the embedded audiopath conflict with settings in the default audiopath, such as different effects on the same PChannel, a new PChannel is temporarily used for playback of the segment, so that the conflict is not heard. When the segment stops, audiopath settings revert to those in the default audiopath selected in the audiopath list.
To play a segment on its embedded audiopath, you must select the Play on new instance of embedded audiopath option in the Segment Tab of the Segment Properties window. When this option is selected, a new instance of the audiopath is created each time an instance of the segment is played. Changes to one instance, such as pitch bend or volume, do not affect other instances. Each instance of the audiopath is cleared immediately after playback of the segment instance ends.
Note that this behavior is different from what occurs when you play a segment multiple times on an audiopath that is not embedded. In the latter case, a single instance of the audiopath exists until it is explicitly destroyed. Any changes to parameters made by Continuous Controllers or the Parameter Control Track affect all instances of all segments playing on the audiopath.
An easy method for creating an audiopath for use with a segment is to create a new audiopath based on the default audiopath, and then change only the settings for the PChannels used in the segment. When you do this, all PChannels not used in the segment retain the default settings, and will continue to play without interruption. You can create an embedded audiopath based on any existing audiopath, or you can begin with a new, empty audiopath.