Microsoft DirectX 8.0 (C++) |
The DirectMusic style object represents a collection of musical patterns, usually including embellishments and motifs, with a time signature, tempo, and band. It defines the basic rhythm and the notes to be played in each instrument part.
For a conceptual overview, see Styles.
A style by itself does not contain enough information to create a segment of music at run time. For this you need two other components: a chordmap, which is a scheme of chord progressions, and a command track to set the groove level and embellishments as the music plays. The command track can come from a template or be generated at run time from a shape. The chordmap generally comes from a chordmap file or resource.
To create a segment with a command track based on a template, call the IDirectMusicComposer8::ComposeSegmentFromTemplate method. See Using Templates.
To create a segment based on a shape, call the IDirectMusicComposer8::ComposeSegmentFromShape method. You supply pointers to a style and a chordmap. You also supply a rate of harmonic motion, which controls the frequency of chord changes, and a shape constant, which determines the progression of groove levels and embellishments.