DirectX SDK |
A chord-map object represents a collection of chords that provides the foundation of the harmonic structure and the mood of the music. A chord map contains several pathways with many interconnected chords, providing many possibilities for the composition engine to choose from in determining the chord progression in a piece of music.
For authored segments, applications do not normally need to concern themselves with chord maps. The chord map is used at the authoring stage to create a fixed chord progression. However, chord maps can be used to compose segments at run time and to alter the chord progression of existing segments.
You obtain the DirectMusicChordMap object from a chord-map file or resource. For more information, see DirectMusic Loader and Music Files for Composition.
If a chord map has been authored into a style, you can retrieve a pointer to its IDirectMusicChordMap interface by passing its name (assigned by the author) to the IDirectMusicStyle::GetChordMap method. You can also use the IDirectMusicStyle::EnumChordMap method to search for a particular chord map, or the IDirectMusicStyle::GetDefaultChordMap method to obtain a pointer to the default chord map for the style.
Note DirectMusic Producer does not support authoring chord maps into style files.
You set the chord map for a composition when you create a segment by using either IDirectMusicComposer::ComposeSegmentFromTemplate or IDirectMusicComposer::ComposeSegmentFromShape. For more information, see Using Styles.
Once a segment has been created, you can change its chord map by calling the IDirectMusicComposer::ChangeChordMap method. This changes the mood of the music without altering its basic rhythm and melody.
Every chord map has an underlying scale, consisting of 24 tones. You can determine the tones of the scale by using the IDirectMusicChordMap::GetScale method. The lower 24 bits of the variable pointed to by the pdwScale parameter of this method are set or clear, depending on whether the corresponding tone is part of the scale. The upper 8 bits give the root of the scale as an integer in the range from 0 through 23 (low C to middle B).
You set the chord map for a composition when you create a segment by using either DirectMusicComposer.ComposeSegmentFromTemplate or DirectMusicComposer.ComposeSegmentFromShape. For more information, see Using Styles.
Once a segment has been created, you can change its chord map by calling the DirectMusicComposer.ChangeChordMap method. This changes the mood of the music without altering its basic rhythm and melody.