|
Using midiOutShortMsg to Send Individual MIDI Messages
The following example uses the midiOutShortMsg function to send a specified MIDI event to a given MIDI output device:
UINT sendMIDIEvent(HMIDIOUT hmo, BYTE bStatus, BYTE bData1,
BYTE bData2)
{
union {
DWORD dwData;
BYTE bData[4];
} u;
// Construct the MIDI message.
u.bData[0] = bStatus; // MIDI status byte
u.bData[1] = bData1; // first MIDI data byte
u.bData[2] = bData2; // second MIDI data byte
u.bData[3] = 0;
// Send the message.
return midiOutShortMsg(hmo, u.dwData);
}
Note MIDI output drivers are not required to verify data before sending it to an
output port. Applications must ensure that only valid data is sent.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|