DirectX SDK

DirectMusicComposer.ComposeSegmentFromTemplate

The DirectMusicComposer.ComposeSegmentFromTemplate method creates an original segment from a style, a chord map, and a template.

object.ComposeSegmentFromTemplate( _ 
    style As DirectMusicStyle, _
    templateSeg As DirectMusicSegment, _
    activity As Integer, _
    chordmap As DirectMusicChordMap) 
    As DirectMusicSegment

Parameters

object
Object expression that resolves to a DirectMusicComposer object.
style
DirectMusicStyle object from which to create the segment.
templateSeg
DirectMusicSegment object representing the template from which to create the segment.
activity
Rate of harmonic motion. Valid values are from 0 through 3. Lower values mean more chord changes.
chordmap
DirectMusicChordmap object representing the chord map from which to create the segment.

Return Values

If the method succeeds, it returns a DirectMusicSegment object.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DMUS_E_INVALIDARG

Remarks

If style is not Nothing, it is used in composing the segment; if it is Nothing, a style is retrieved from the template specified in templateSeg. Similarly, if chordmap is not Nothing, it is used in composing the segment; if it is Nothing, a chord map is retrieved from the template.

If style is Nothing and there is no style track in the template, or chordmap is Nothing and there is no chord-map track, the method returns DMUS_E_INVALIDARG.

The length of the segment is equal to the length of the template passed in.

See Also

DirectMusicComposer.ComposeSegmentFromShape, DirectMusicComposer.ComposeTemplateFromShape