共用方式為


DMUS_CURVE_PMSG

The DMUS_CURVE_PMSG structure contains message data for a curve .

Syntax

typedef struct DMUS_CURVE_PMSG {
  DMUS_PMSG_PART
  MUSIC_TIME mtDuration;
  MUSIC_TIME mtOriginalStart;
  MUSIC_TIME mtResetDuration;
  short  nStartValue;
  short  nEndValue;
  short  nResetValue;
  WORD   wMeasure;
  short  nOffset;
  BYTE   bBeat;
  BYTE   bGrid;
  BYTE   bType;
  BYTE   bCurveShape;
  BYTE   bCCData;
  BYTE   bFlags;
  WORD   wParamType;
  WORD   wMergeIndex; 
} DMUS_CURVE_PMSG;

Members

DMUS_PMSG_PART

Macro for common message members. See DMUS_PMSG.

mtDuration

Duration of the curve. This value is in music time unless DMUS_PMSGF_LOCKTOREFTIME is present in the dwFlags member of DMUS_PMSG_PART, in which case the duration is in milliseconds and is unaffected by a change in tempo.

mtOriginalStart

Original start time. Must be set to either zero when this message is created, or to the original start time of the curve.

mtResetDuration

Length of time after the end of the curve during which a reset can take place in response to an invalidation. Ignored if DMUS_CURVE_RESET is not in bFlags. This value is in music time unless DMUS_PMSGF_LOCKTOREFTIME is present in the dwFlags member of DMUS_PMSG_PART, in which case it is in milliseconds and is unaffected by a change in tempo.

nStartValue

Start value of the curve.

nEndValue

End value of the curve.

nResetValue

Value to set upon a flush or invalidation. Ignored if DMUS_CURVE_RESET is not in bFlags.

wMeasure

Measure in which this curve occurs.

nOffset

Offset from the grid at which this curve occurs, in music time.

bBeat

Beat count (within a measure) at which this curve occurs.

bGrid

Grid offset from the beat at which this curve occurs.

bType

Type of curve. This can be one of the following values.

Value Description
DMUS_CURVET_CCCURVE Continuous controller curve (MIDI Control Change channel voice message; status byte &HBn.).
DMUS_CURVET_MATCURVE Monophonic aftertouch curve (MIDI Channel Pressure channel voice message; status byte &HDn).
DMUS_CURVET_PATCURVE Polyphonic aftertouch curve (MIDI Poly Key Pressure channel voice message, status byte &HDn).
DMUS_CURVET_PBCURVE Pitch-bend curve (MIDI Pitch Bend channel voice message; status byte &HEn).
DMUS_CURVET_RPNCURVE RPN curve of type defined in wParamType.
DMUS_CURVET_NRPNCURVE NRPN curve of type defined in wParamType.

bCurveShape

Shape of curve. This can be one of the following values.

Value Description
DMUS_CURVES_EXP Exponential curve shape.
DMUS_CURVES_INSTANT Instant curve shape (beginning and end of curve happen at essentially the same time).
DMUS_CURVES_LINEAR Linear curve shape.
DMUS_CURVES_LOG Logarithmic curve shape.
DMUS_CURVES_SINE Sine curve shape.

bCCData

Controller number if bType is DMUS_CURVET_CCCURVE; otherwise ignored.

bFlags

Can be zero, or one or more of the following values.

Value Description
DMUS_CURVE_RESET The value of nResetValue must be set when the time is reached or an invalidation occurs because of a transition. If this flag is not set, the curve stays permanently at the new value.
DMUS_CURVE_START_FROM_CURRENT Ignore nStartValue and start the curve at the current value. Implemented for volume, expression, pitch bend, filter cutoff, pan, and mod wheel. See Remarks.

wParamType

MIDI parameter number. This value is significant only if DMUS_PMSGF_DX8 is present in the dwFlags member of the DMUS_PMSG part of this structure. See Remarks.

wMergeIndex

Merge index. Supported for transpose, pitch bend, volume, expression, pan, filter, mod wheel, chorus, and reverb controllers. This value is significant only if DMUS_PMSGF_DX8 is present in the dwFlags member of the DMUS_PMSG part of this structure. See Remarks.

Remarks

An RPN or NRPN curve type in wParamType is stored as two bytes with seven significant bits. For example, if the MSB is 0x23 and the LSB is 0x74, the value in wParamType is 0x2374.

Data in nStartValue, nEndValue, and nResetValue is limited to 14 bits. For MIDI data consisting of two seven-bit bytes, the value is stored as a word with the upper two bits empty.

All curves with wMergeIndex of 0 override each other. If wMergeIndex is another value, the values generated by the curve are added to the values for merge index 0. For example, if an application uses curves with 0 and 3, the 0 curves always replace each other but add to the 3 curves, and the 3 curves also always replace each other and add to the 0 curves.

The DMUS_CURVE_START_FROM_CURRENT flag does not cause the current controller value to be saved in the message. Therefore tools do not have access to this data unless they store the last known value.

Requirements

**  Header:** Dmusici.h

See Also

© 2004 Microsoft Corporation. All rights reserved.