DirectX SDK

DMUS_NOTE_PMSG

The DMUS_NOTE_PMSG type contains data for a music note event.

Type DMUS_NOTE_PMSG
    beat as Byte
    durRange As Byte
    flags As Byte
    grid As Byte
    measure As Integer
    midiValue As Byte
    mtDuration As Long
    musicValue As Integer
    offset As Integer
    playModeFlags As Byte
    subChordLevel As Byte
    timeRange As Byte
    velocity As Byte
    velRange As Byte
End Type

Members

beat
Beat count (within a measure) at which this note occurs.
durRange
Range to randomize duration.
flags
Should be set to DMUS_NOTEF_NOTEON. See Remarks.
grid
Grid offset from a beat at which this note occurs.
measure
Measure in which this note occurs.
midiValue
MIDI note value, converted from musicValue.
mtDuration
Duration of the note.
musicValue
Description of the note. In most play modes, this is a packed array of four-bit values, as follows:

Octave, in the range from –2 through 14. The note is transposed up or down by the octave times 12.

Chord position, in the range from 0 through 15, though it should never be above 3. The first position in the chord is 0.

Scale position, in the range from 0 through 15. Typically, it is from 0 through 2, but it is possible to have a one-note chord and have everything above the chord be interpreted as a scale position.

Accidental, in the range from –8 through 7, but typically in the range from –2 through 2. This represents an offset that takes the note out of the scale.

In the fixed play modes, the music value is a MIDI note value in the range from 0 through 127.

offset
Offset from a grid at which this note occurs, in music time.
playModeFlags
Play mode determining how the music value is related to the chord and subchord. For a list of values, see CONST_DMUS_PLAYMODE_FLAGS.
subChordLevel
Subchord level that the note uses.
timeRange
Range by which to randomize time.
velocity
Note velocity.
velRange
Range by which to randomize velocity.

Remarks

Applications sending note messages must provide values only in the flags, midiValue, mtDuration, and velocity members. The other members are of interest only to tools, which are not supported in DirectX for Visual Basic.

Normally, the application sets flags to DMUS_NOTEF_NOTEON. The application is not responsible for sending note-off messages. When the DirectMusic output tool receives a DMUS_NOTE_PMSG and sees that DMUS_NOTEF_NOTEON is set, it clears the flag, adds mtDuration to the time stamp, and requeues the message so that the note is turned off at the appropriate time.

It is possible, however, for the application to stop a note prematurely by sending the same note on the same channel with flags set to 0.

See Also

DirectMusicPerformance.SendNotePMSG, Music Values and MIDI Notes