When creating cues and tracks using Microsoft Cross-Platform Audio Creation Tool (XACT), developers may want to add variability to what sounds or waves are being played. By using variations, you can assign multiple sounds to a cue, or multiple waves to a track, that will be played randomly when the cue or track is played. Both methods allow for weighting and play options to modify how the sounds or waves are chosen at random.
Variations require that at least one sound bank and one wave bank have been created in an XACT project. See Working With XACT Sound Banks and Building an XACT Wave Bank to learn how to create sound banks and wave banks.
There are two types of variations in XACT: sound variations, which are linked to a cue and vary the sound played when the cue is triggered, and wave variations, which are linked to a track and vary the wave played when the track is played.
Wave variations are the simpler of the two types of variations; all that is required to create a wave variation for any given track is a wave bank with two or more waves in it, and a sound bank.
To create a wave variation
From the Wave Bank window, click and drag a wave into the Sound Bank window.
Figure 1. The wave and sound bank windows, prior to creating the new sound
A new sound will be created for the wave, and a Play event will be added to the sound automatically.
Select the new sound in the Sound Bank window.
Figure 2. The wave and sound bank windows, after selecting the newly-created sound
The details of the automatically-generated Play event will be shown in the tracks frame of the Sound Bank window.
From the Wave Bank window, click and drag a second wave, different than the first wave, to the sound in the sound bank window. Do not release the mouse button yet. As you drag the wave over the sound, the tracks in the sound will appear. Continue to drag the wave over to "Play Wave" event in the tracks frame, and release.
Figure 3. The wave and sound bank windows, after adding the second wave.
The new wave should appear below the old wave. Both waves will be displayed with a percentage value next to their names. This indicates the chance that the wave will be played when the track is played. Both waves have a fifty-percent chance of being played.
This final step can be repeated as many times as desired to add additional waves to the track that will play randomly. Each additional wave will reduce the percentage chance that each wave has of being played, unless certain waves are weighted more heavily than others. Weighting is discussed in the Random Weighting section.
The default behavior of a wave variation is to play waves randomly but with no immediate repeats, that is, no wave that was just played will be played a second time, even if it is the wave that is randomly chosen. There are other modes of selecting which wave to play. See the Variation Playlists section for details.
Sound variations are the second type of variation, and are used to link multiple possible sounds to play when a specific cue is triggered. This allows for a greater level of variation, as the sounds that are played can then have wave variations within their tracks.
To create a sound variation, you must have two or more sounds in a sound bank.
Note For performance reasons, a cue should have no more than 100 sound varations associated with it.
To create a sound variation
Select the Sound Bank window. Right-click in the lower-left pane of the Sound Bank window, and select New Cue.
Figure 4. Sound bank window, after creating a cue
A new cue will be created and will appear in the lower-left pane of the Sound Bank window.
Click and drag a sound from the upper-left pane of the Sound Bank window onto the newly-created cue.
Figure 5. The sound bank window, after dragging a sound onto the new cue
The sound will be added to the lower-right pane of the Sound Bank window.
Click and drag a second sound, different from the first sound, from the upper-left pane of the Sound Bank window onto the cue.
Figure 6. The sound bank window, after adding the second sound to the cue.
The second sound should appear below the first sound in the bottom-right pane of the sound bank window. One of these sounds will be played randomly when the cue is triggered.
This final step can be repeated as many times as desired to add additional sounds to the cue that will play randomly. Each additional sound will reduce the percentage chance that each sound has of being played, unless certain sounds are weighted more heavily than others. Weighting is discussed in the Random Weighting section.
The default behavior of a sound variation is to play sounds randomly but with no immediate repeats, that is, no sound that was just played will be played a second time, even if it is the sound that is randomly chosen. There are other modes of selecting which sound to play. See the Variation Playlists section for details.
In the case of both sound and wave variations, an initial weight is applied to each sound or wave that makes it no more likely to be chosen randomly than any of the other sounds or waves that could also be chosen. This may not be the desired result in all cases. In order to make certain sounds or waves more or less likely to be chosen, a developer may change the random weight of a sound or wave.
Note Weighting only effects variations with "random" playlist types (Random, Random (no immediate repeats), and Shuffle). Ordered playlist types will not be affected by weighting. See Variation Playlists.
Waves and sounds are weighted by a single number that represents how frequently they will be chosen versus the other waves or sounds in the track.
To modify a wave weight
These instructions assume that you have a sound bank prepared that contains a sound that uses wave variations. See the Wave Variations section to learn how to create wave variations.
Select the sound bank window.
In the upper-left pane of the sound bank window, click on a sound that contains a track that uses wave variations. The track and the waves that the track contains will be shown in the upper-right pane of the sound bank window.
In the upper-right pane of the sound bank window, click on the wave that you wish to weight. The property frame, which is on the lower left of the XACT window, will display properties about the selected wave.
In the property frame, under the Variation Properties heading, edit the Weight property. You may click in the text box corresponding to the Weight property to type in a number from 0 to 255, or you may click the downward-pointing arrow to the right of the box to display a slider, which you can manipulate to change the value of the property. The percentage value that the number corresponds to will be shown.
Figure 7. The property frame, during editing of the Weight property of a wave.
The waves in the track will update to show the new percentage amounts. These amounts correspond to the updated percentage chance that they will be chosen at random to play when the track is played.
To modify a sound weight
These instructions assume that you have a sound bank prepared that contains a non-interactive cue that uses sound variations (interactive cues override weighting behavior, so the weights will have no effect). See the Sound Variations section to learn how to create sound variations.
Select the sound bank window.
In the lower-left pane of the sound bank window, click on a cue that is using sound variations (i.e., has more than one sound associated with it). The sounds associated with the cue will be shown in the lower-right pane of the sound bank window.
In the lower-right pane of the sound bank window, click on the sound that you wish to weight. The property frame, which is on the lower left of the XACT window, will display properties about the selected sound.
In the property frame, under the Variation Properties heading, edit the Weight property. You may click in the text box corresponding to the Weight property to type in a number from 0 to 255, or you may click the downward-pointing arrow to the right of the box to display a slider, which you can manipulate to change the value of the property. The percentage value that the number corresponds to will be shown.
Figure 8. The property frame, during editing of the Weight property of a sound.
The default behavior of a sound variation is to play sounds randomly but with no immediate repeats, that is, no sound that was just played will be played a second time, even if it is the sound that is randomly chosen. There are other modes of selecting which sound to play:
Property Value | Description |
---|---|
Random (no immediate repeats) | The default behavior. Items will be chosen at random, but the immediate repeat of a previously played item will not occur. |
Random | Random selection that does not track the previously played item. The immediate repeat of a previously played item is possible with this setting. |
Ordered | Items are played in order. This order will be made visible when this playlist type is chosen, and you may drag and drop sounds in relation to each other to change this order. See Using The Ordered Playlist Type. |
Ordered from Random | From a random starting position (no weighting used), plays all entries in order, using the same logic as the ordered type. |
Shuffle | Items are chosen randomly, but no item will be played twice until all items in the list have been played. |
This behavior is set by a property that is accessed differently for wave variations than it is for sound variations. Both are covered below.
These instructions assume that you have a sound bank prepared that contains a sound that uses wave variations. See the Wave Variations section to learn how to create wave variations.
To modify wave variation behavior
Select the sound bank window.
In the upper-left pane of the sound bank window, click on a sound that contains a track that uses wave variations. The track and the waves that the track contains will be shown in the upper-right pane of the sound bank window.
In the upper-right pane of the sound bank window, click on the Play Wave event for the list of waves you wish to modify. The property frame, which is on the lower left of the XACT window, will display properties about the selected event.
In the property frame, under the Variation Playlist Properties heading, edit the PlayListType property. Click the downward-pointing arrow to the right of the PlayListType property box to display a list of available behaviors. Clicking on a behavior type will set the waves associated with the sound to play using that behavior.
These instructions assume that you have a sound bank prepared that contains a cue that uses sound variations. See the Sound Variations section to learn how to create sound variations.
To modify sound variation behavior
Select the sound bank window.
In the lower-left pane of the sound bank window, click on a cue that is using sound variations (i.e., has more than one sound associated with it). The property frame, which is on the lower left of the XACT window, will display properties about the selected cue.
In the property frame, under the Variation Playlist Properties heading, edit the PlayListType property. Click the downward-pointing arrow to the right of the PlayListType property box to display a list of available behaviors. Clicking on a behavior type will set the sounds associated with the cue to play using that behavior.
The Ordered and Ordered From Random playlist types behave differently than the other playlist types. The sounds are not played randomly, but in an order that you can define by dragging and dropping sounds in relation to one another.
These instructions assume that you have a sound bank prepared that contains a cue that uses sound variations. See the Sound Variations section to learn how to create sound variations.
To define a playlist order using the Ordered playlist type
Select the sound bank window.
In the lower-left pane of the sound bank window, click on a cue that is using sound variations (i.e., has more than one sound associated with it). The property frame, which is on the lower left of the XACT window, will display properties about the selected cue.
In the property frame, under the Variation Playlist Properties heading, edit the PlayListType property. Choose Ordered or OrderedFromRandom.
The sound list for the cue in the sound bank will change to show a column called Order. This shows the order that the sounds will play in when the cue is played.
Figure 9. Cue and sounds in sound bank, showing order
Drag and drop a sound above or below another sound in the cue's sound list to change its order in the list.