Microsoft DirectX 8.1 (Visual Basic)

DirectMusicPerformance8.SendNotePMSG

The SendNotePMSG method sends a performance message containing information about a note.

object.SendNotePMSG( _
  lTime As Long, _
  flags As Long, _
  channel As Long, _
  msg As DMUS_NOTE_PMSG)

Parts

object

Resolves to a DirectMusicPerformance8 object.

lTime

Time at which the message is to play. This value is in music time unless DMUS_PMSGF_REFTIME is in flags. If the value of lTime is 0 and flags contains DMUS_PMSGF_REFTIME, the message plays immediately.

flags

Flags modifying how and when the message is processed. See CONST_DMUS_PMSGF_FLAGS.

channel

Performance channel that is the destination for the message. To send the message to more than one channel, use one of the members of the CONST_DMUS_PCHANNEL enumeration.

msg

DMUS_NOTE_PMSG type containing information about the note.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DMUS_E_NO_MASTER_CLOCK
DMUS_E_ALREADY_SENT
DMUS_E_INVALIDARG

Remarks

The following code example, where perf is a DirectMusicPerformance8 object, sends a message to play middle C immediately.

Dim note As DMUS_NOTE_PMSG
 
note.midiValue = 60
note.mtDuration = 500
note.flags = DMUS_NOTEF_NOTEON
note.velocity = 127
Call perf.SendNotePMSG(0, DMUS_PMSGF_REFTIME, 1, note)