Copyright: DDrop.vbx\n1994 by Winefred Washington


Drag-and-Drop Control

MidiWW   Midi Custom Control for Visual Basic

Description	MidiWW is a Visual Basic control which allows you to send and receive MIDI data from

your MIDI keyboard via your Windows sound card.  The control can transfer data at

precise intervals to/from the keyboard.  If you do not have a MIDI keyboard, the control

can still play notes via your sound card.

File Name	MIDIWW.VBX

Object Type	MidiWW

Remarks	MidiWW is a shareware VBX control for use with VB 3.0.  You may use the unregistered

version to evaluate the control.  If you wish to distribute the control with a program you

create, you must register your copy.  If you choose to register, you will receive two

versions of  MidiWW, a developer's version, and a run-time-only version for distri-

buting with your programs.  Neither version contains the "unregistered" pop-up.

Registering MidiWW

_______________________________________________________________

Distribution Note  You may create and distribute only applications which use

the registered version of MIDIWW.VBX.  You should install MIDIWW.VBX in the user's

Microsoft Windows directory.

_______________________________________________________________

About	MidiWW control was written by Winefred Washington.  For additional

information:

Winefred Washington

1702 Lion Heart Drive

Cedar Park, TX  78613

CompuServe ID:  72070, 3713

Properties and Events

All properties and events are listed in the following tables.

Properties

_____________________________________________________________

ChannelMask	DriverVersion	ErrorNum	ErrorText

hMidiOut	InCount	InputDevice	InputEnabled

InputTime	Left	ManID	Msg

Name	NumInDevs	NumNotes	NumOutDevs

NumVoices	OutCount	OutputDevice	OutputEnabled

OutputTime	Parent	ProdID	ProductName

ShortMsg	Support	Tag	Technology

Top

Events

-----------------------------------------------------------------------------------------------------------

MidiInOpen	MidiInError	MidiInClose

-----------------------------------------------------------------------------------------------------------

ChannelMask Property

Specifies the channels that an internal synthesizer device responds to, where the least significant

bit refers to channel 0 and the most significant bit to channel 15. Port devices transmit on all

channels and so will set this field to 0xFFFF.

DriverVersion Property

Specifies the version number of the device driver for the MIDI output device. The high-order byte is

the major version number, and the low-order byte is the minor version number.

ErrorNum Property

Returns the error number from the device driver if an error is generated.

Example

MidiWW1.OutputEnabled = True

 If MidiWW1.ErrorNum <> 0 Then

        MsgBox MidiWW1.ErrorText

End If

ErrorText Property

Returns the text corresponding to the current error number.

hMidiOut Property

Returns the handle to the Midi Output device.

InCount Property

Returns the number of Midi Input events in the incoming buffer.

InputDevice Property

Identifies the MIDI input device to be opened. The input device varies from zero to one less

than the number of devices present. Specify a valid MIDI input device or the following constant:

MIDI_MAPPER - (-1)

MIDI mapper. Using this value will return an error if no MIDI mapper is installed.

InputEnabled Property

Setting this property TRUE allows the control to receive events from the input device.

InputTime Property

Specifies the time from when the input was enabled to when the event was received.

ManID Property

Specifies a manufacturer ID for the device driver for the MIDI output device. Manufacturer IDs are

defined in Manufacturer and Product IDs.

Msg Property

Reading this property retrieves the next event data received from the MIDI input device.

NumInDevs Property

Returns the number of MIDI input devices present in the system.

NumNotes Property

Specifies the maximum number of simultaneous notes that may be played by an internal

synthesizer device. If the device is a port, the field is not meaningful and will be set to 0.

NumOutDevs Property

Returns the number of MIDI output devices present in the system.

NumVoices Property

Specifies the number of voices supported by an internal synthesizer device. If the device is a port,

the field is not meaningful and will be set to 0.

OutCount Property

Returns the number of output messages in the outgoing buffer.

OutputDevice Property

Identifies the MIDI output device that is to be opened. Specify a valid MIDI output device ID (see

the following "Comments" section) or the following constant:

MIDI_MAPPER

MIDI mapper. Using the valud will return an error if no MIDI mapper is installed.

Example

        ' enable Midi Mapper

        MidiWW1.OutputDevice = -1

OutputEnabled Property

Setting this property TRUE will allows control to send messages to the output device.

OutputTime Property

Specifies the delay time BETWEEN the last message and the next message.

ProdIDProperty

Specifies a product ID for the MIDI output device. Product IDs are defined in Manufacturer and

Product IDs.

ProductName Property

Specifies the product name.

ShortMsg Property

Setting this property sends a message to the output device.

Example

    MidiWW1.ShortMsg = &H600090 + (Index + 36) * 256      ' Note On

    MidiWW1.ShortMsg = &H600080 + (Index + 36) * 256      ' Note Off

Support Property

Specifies optional functionality supported by the device.

MIDICAPS_VOLUME - 1

Supports volume control.

MIDICAPS_LRVOLUME - 2

Supports separate left and right volume control.

MIDICAPS_CACHE - 4

Supports patch caching.

Technology Property

Describes the type of the MIDI output device according to one of the following flags:

MOD_MIDIPORT - 1

Indicates the device is a MIDI hardware port.

MOD_SQSYNTH - 3

Indicates the device is a square wave synthesizer.

MOD_FMSYNTH - 4

Indicates the device is an FM synthesizer.

MOD_MAPPER - 5

Indicates the device is the Microsoft MIDI Mapper.


MidiInOpen Event

Syntax	Sub MidiWW_MidiInOpen ()

Remarks	The MidiInClose event indicates the Midi input device was enabled by setting the

InputEnabled property to TRUE.


MidiInError Event

Syntax	Sub MidiWW_MidiInError ()

Remarks	The MidiInError event is generated when an error occurs in the data stream coming from

the Midi input device.


MidiInClose Event

Syntax	Sub MidiWW_MidiInClose ()

Remarks	The MidiInClose event indicates the Midi input device was disabled by setting the

InputEnabled property to FALSE.


See Visual Basic Language Reference manual for description.


Registering DDrop
Registering MidiWW

You can obtain MidiWW one of three ways:  via CompuServe's Shareware Registration Area, from PsL, Public software Library, or directly from the author.  If you choose to register, you will receive two versions of  MidiWW, a developer's version, and a run-time-only version for distributing with your programs.  Neither version contains the "unregistered" pop-up.  Registration costs $20.

CompuServe

MidiWW is listed in the CompuServe Shareware Registration Area.  The registration ID is 2650. Just type "GO SWREG."

For Credit Card Orders Only -

You can order with MC, Visa, Amex, or Discover from Public (software) Library by calling 800-2424-PsL or

713-524-6394 or by FAX to 713-524-6398.  You can also mail credit card orders to PsL at P.O. Box 35705,

Houston, TX  77235-5705.  Refer to Item #11509 when ordering.

THE ABOVE NUMBERS ARE FOR ORDERS ONLY.

Any questions about the status of the shipment of the order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc, must be directed to the author.

Mail

You may also register MidiWW by mail from the author.  To insure speedy delivery, print this topic and fill-in the form. Only personal checks and money orders are accepted, NO credit card orders, please.

(     )  Please send one copy of  MIDIWW.VBX  (Registered Version)  for $20.

plus $4 S&H ($6 for non-US shipping).

Please write carefully, this section may be used as a mailing label.

Name:

Address:

City, State, and Zip:

Mail to:

Winefred Washington

1702 Lion Heart Drive

Cedar Park, TX  78613