DMus Miniport Driver

A DMus miniport driver manages the hardware-dependent functions of advanced MIDI devices. These devices support DirectMusic capabilities such as precision sequencer timing, downloadable sounds (DLS), and channel groups. DMus miniport drivers can achieve high performance with devices such as MPU-401. Timing can be handled by either the miniport driver or the port driver, depending on the capabilities of the hardware. A DMus miniport driver can also support a software synthesizer that generates a wave output stream.

A DMus miniport driver for a MIDI hardware device should support two interfaces:

  • The miniport interface initializes the miniport object and creates MIDI streams.

  • The stream interface manages a MIDI stream and exposes most of the miniport driver's functionality.

The miniport interface, IMiniportDMus, inherits the methods in the IMiniport interface. IMiniportDMus provides the following additional methods:

IMiniportDMus::Init

Initializes the miniport object.

IMiniportDMus::NewStream

Creates a new stream object.

IMiniportDMus::Service

Notifies the miniport driver of a request for service.

The stream interface, IMXF, inherits the methods in the IUnknown interface. IMXF provides the following additional methods:

IMXF::ConnectOutput

Connects this stream object, which is a data source, to the IMXF interface of another stream object, which is a data sink.

IMXF::DisconnectOutput

Disconnects this stream object from the IMXF interface of another stream object that is a data sink.

IMXF::PutMessage

Passes a DMUS_KERNEL_EVENT structure to the data sink.

IMXF::SetState

Sets the state of the stream.

In addition, the DMus miniport driver's ISynthSinkDMus interface provides DLS functionality for software synthesizers. ISynthSinkDMus inherits the methods in base interface IMXF. ISynthSinkDMus provides the following additional methods:

ISynthSinkDMus::RefTimeToSample

Converts a reference time to a sample time.

ISynthSinkDMus::Render

Renders wave data into a buffer for the wave sink.

ISynthSinkDMus::SampleToRefTime

Converts a sample time to a reference time.

ISynthSinkDMus::SyncToMaster

Synchronizes the sample clock to the master clock.

The port driver's wave sink calls ISynthSinkDMus::Render to read the wave PCM data that the synthesizer generates from its MIDI input stream. For more information about the wave sink, see A Wave Sink for Kernel-Mode Software Synthesizers.

The miniport driver calls the following interfaces on the DMus port driver:

IPortDMus

IAllocatorMXF

IMasterClock

PortCls contains a built-in DMus miniport driver for a MIDI device with a UART function. For more information, see PcNewMiniport.