DirectX SDK |
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
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.
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.
DirectMusicPerformance.SendNotePMSG, Music Values and MIDI Notes