DMUS_NOTE_PMSG
The DMUS_NOTE_PMSG structure contains message data for a MIDI note.
Syntax
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;
char cTranspose;
} DMUS_NOTE_PMSG;
Members
DMUS_PMSG_PART
Macro for common message members. See DMUS_PMSG.
mtDuration
Duration of the note.
wMusicValue
Description of the note. In most play modes, this is a packed array of 4-bit values, as follows.
Value | Description |
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, although 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 only 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.
wMeasure
Measure in which this note occurs.
nOffset
Offset from the grid at which this note occurs, in music time.
bBeat
Beat (in measure) at which this note occurs.
bGrid
Grid offset from the beat at which this note occurs.
bVelocity
Note velocity .
bFlags
See DMUS_NOTEF_FLAGS.
bTimeRange
Range by which to randomize the time at which the note plays.
bDurRange
Range by which to randomize the duration of the note.
bVelRange
Range by which to randomize the velocity of the note.
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 that the note uses. See DMUS_SUBCHORD.
bMidiValue
MIDI note value, converted from wMusicValue.
cTranspose
Transposition to add to bMidiValue after conversion from wMusicValue.
Remarks
When the output tool receives a message with DMUS_NOTEF_NOTEON in bFlags, it sends a MIDI note-on message to the synthesizer. It then clears the DMUS_NOTEF_NOTEON flag, adds mtDuration to the time stamp, and requeues the message so that the note is turned off at the appropriate time.
The values in bTimeRange and bDurRange have a logarithmic relationship to actual time. A value of 255 specifies that the time can be randomized by up to 825 music time ticks in either direction.
Requirements
** Header:** Dmusici.h
See Also