Functions in soundlib.lib provide support for MIDI synthesizers and external MIDI devices. Both Ad Lib and OPL3 synthesizer types are supported. External MIDI devices are supported in UART mode. All of these capabilities are utilized by sndblst.sys.
To make use of the synthesizer functions provided in soundlib.lib, do the following:
·Within the driver object received by DriverEntry, assign SoundDispatch to be the driver’s main dispatcher for IRP control codes. See “Examining DriverEntry in sndblst.sys.”
·Call the SynthInit function for each card, during hardware and driver initialization.
·Call the SynthCleanup function for each card, just before the driver is unloaded.
Additionally, if your hardware generates an interrupt for timer expiration, your driver must provide code to connect to the interrupt and to dismiss the interrupt. This interrupt is not handled by soundlib.lib.
Supporting External MIDI Devices
To use soundlib.lib for handling external MIDI devices, you must:
·Within the driver object received by DriverEntry, assign SoundDispatch to be the driver’s main dispatcher for IRP control codes. See “Examining DriverEntry in sndblst.sys.”
·Define a SOUND_DEVICE_INIT structure for MIDI input, and another for MIDI output. The structures’ DispatchRoutine members must be set to the address of SoundMidiDispatch, which is the MIDI dispatch routine within soundlib.lib for DeviceIoControl messages.
·Define a MIDI_INFO structure. A single MIDI_INFO structure can support both MIDI output and MIDI input.
·Call SoundCreateDevice once for each SOUND_DEVICE_INIT structure you have defined.