Data Transfer Using MIDI Device Drivers

With MIDI system-exclusive events, data transfer between a client application and a MIDI device driver is identical to the sequence described for waveform and video drivers. However, for all other MIDI events, the driver uses a different transfer mechanism. Because all other MIDI events are 3 bytes or fewer in size, they are packed into a DWORD and sent directly to the driver for output. The driver parses the event to determine its size, and sends the individual bytes to the MIDI output hardware. If the driver is for an internal synthesizer, it parses the event and responds accordingly. MIDI-input device drivers wait until receiving a complete MIDI event before packing the event into a DWORD and sending it to the client application through its callback.