DMUS_NOTE_PMSG

The DMUS_NOTE_PMSG structure contains data for a music note event.

typedef struct DMUS_NOTE_PMSG {
    DMUS_PMSG_PART
    MUSIC_TIME mtDuration;
    WORD       wMusicValue;
    WORD       wMeasure;
    short      nOffset;
    BYTE       bBeat;
    BYTE       bGrid;
    BYTE       bVelocity;
    BYTE       bFlags;
    BYTE       bTimeRange;
    BYTE       bDurRange;
    BYTE       bVelRange;
    BYTE       bPlayModeFlags;
    BYTE       bSubChordLevel;
    BYTE       bMidiValue;
} DMUS_NOTE_PMSG;
 

Members

DMUS_PMSG_PART
Macro for common message members. See DMUS_PMSG.
mtDuration
Duration of the note.
wMusicValue
Description of note. In most play modes, this is a packed array of four-bit values (nibbles), as follows:

Octave, in the range -2 to 14. The note is transposed up or down by the octave times 12.

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

Scale position, in the range 0 to 15. Typically it is just 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 -8 to 7, but typically in the range -2 to 2. This represents an offset that takes the note out of the scale.

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

wMeasure
Measure in which this note occurs.
nOffset
Offset from grid at which this note occurs, in music time.
bBeat
Beat (in measure) at which this note occurs.
bGrid
Grid offset from beat at which this note occurs.
bVelocity
Note velocity.
bFlags
See DMUS_NOTEF_FLAGS.
bTimeRange
Range to randomize time.
bDurRange
Range to randomize duration.
bVelRange
Range to randomize velocity.
bPlayModeFlags
Play mode determining how the music value is related to the chord and subchord. For a list of values, see DMUS_PLAYMODE_FLAGS.
bSubChordLevel
Subchord level the note uses. See DMUS_SUBCHORD.
bMidiValue
MIDI note value, converted from wMusicValue.

Remarks

When a note is to be played, the DMUS_NOTE_PMSG flows through the graph and any tools in the graph until it reaches the final MIDI output tool. When the tool sees that DMUS_NOTEF_NOTEON is set in the bFlags member, it sends a MIDI note-on message to the correct port (according to the dwPChannel member of the DMUS_PMSG part). It then clears the flag, adds m_mtDuration to the m_mtTime, and requeues the message so that the note is turned off at the appropriate time.

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicPerformance::SendPMsg, Music Values and MIDI Notes