Microsoft DirectX 8.1 (Visual Basic)

Making Band Changes Programmatically

Usually, the band track in a loaded segment will perform program changes. However, you can also do so manually.

First create a segment by using DirectMusicBand8.CreateSegment, and then play that segment by calling DirectMusicPerformance8.PlaySegmentEx. Typically, you would use DMUS_SEGF_MEASURE or DMUS_SEGF_GRID in the lFlags parameter to ensure that the band change takes effect on an appropriate boundary.

A performance can be playing instruments from more than one band at a time. For example, suppose your application is playing a primary segment using one band, and then plays a motif from a style that has a different band. As long as the instruments in the two bands are mapped to different performance channels, no conflict arises. Note, though, that motif segments don't always have their own band tracks, so you might get silence from the motif's channels unless you first create a band segment and play it.