Microsoft DirectX 8.1 (C++)

DMUS_MELODY_FRAGMENT

Not implemented in DirectX 8.1.

The DMUS_MELODY_FRAGMENT structure describes a fragment in a melody formulation track. A melody fragment is used to select a variation from a pattern during melody composition.

Syntax

typedef struct _DMUS_MELODY_FRAGMENT {
  MUSIC_TIME  mtTime;
  DWORD  dwID; 
  WCHAR  wszVariationLabel[DMUS_MAX_FRAGMENTLABEL]; 
  DWORD  dwVariationFlags; 
  DWORD  dwRepeatFragmentID;
  DWORD  dwFragmentFlags; 
  DWORD  dwPlayModeFlags; 
  DWORD  dwTransposeIntervals; 
  DMUS_COMMAND_PARAM Command;
  DMUS_CONNECTION_RULE ConnectionArc;
} DMUS_MELODY_FRAGMENT;

Members

mtTime

Time at which the fragment is to play, relative to the beginning of the track.

dwID

Identifier of the track.

wszVariationLabel

Reserved.

dwVariationFlags

DWORD value that specifies the set of allowable variations, where each bit set represents one variation. Ignored if DMUS_FRAGMENTF_USE_REPEAT is included in dwFragmentFlags.

dwRepeatFragmentID

Identifier of an earlier fragment in the track from which to select a variation. Ignored unless DMUS_FRAGMENTF_USE_REPEAT is included in dwFragmentFlags.

dwFragmentFlags

Can contain any of the following values.

Flags Description
DMUS_FRAGMENTF_USE_REPEAT Use the fragment specified in dwRepeatFragmentID.
DMUS_FRAGMENTF_REJECT_REPEAT Use a new variation of the earlier fragment.
DMUS_FRAGMENTF_USE_LABEL Use the set named by wszVariationLabel.

dwPlayModeFlags

Reserved. Must be 0.

dwTransposeIntervals

The lower 24 bits each represent an interval in a two-octave range. Specifies a set of intervals by which the notes in a repeated fragment can be transposed to fit the current chord or key. The lower 24 bits each represent an interval in a two-octave range.

Command

DMUS_COMMAND_PARAM structure that specifies the type of pattern to use as the source for the melody.

ConnectionArc

DMUS_CONNECTION_RULE structure that specifies rules for allowing fragments to flow smoothly from one to another.

Remarks

The variations selected for each fragment form a melody. Fragments can be placed on any beat boundary and can cross bar boundaries. If two fragments overlap, the variation selected by the first fragment is truncated so that none of its notes run into the notes from the second fragment.

Each melody fragment contains a description of the variations that are suitable at that point. This could be a range of variations, a list, or some designation for "use all variations." The variation selection can also refer to previous variations. A melody fragment can use a play mode to generate notes in the melody being constructed, or it can select variations that align with the current chord using either chord intervals or scale intervals. Further, a set of intervals can be selected as legal intervals by which to transpose the fragment in order to align it.

Requirements

  Header: Declared in dmusici.h.

See Also