═══ 1. Introduction ═══ MPUDEV Driver 1.0 Please read this document in entirety. I took the time to make it explicit, clear, and very useful. It took me longer to write it than it will ever take you to read it. Therefore, you owe it to both of us to read it. OK? The MPUDEV.SYS driver is an OS/2 device driver for OS/2 2.X+ designed to work with any audio/MIDI card containing an MPU-401 compatible MIDI interface. (Only MPU-401 UART mode is required of that card). It allows a program to do MIDI input and output through that card. Such cards include Roland's MPU-401 and SuperMPU, and MusicQuest's MQX-16 and MQX-32, as well as many other cards. Many sound cards, including the Roland RAP-10 and SCC-1 also have an MPU-401 compatible interface, and also internally attach a built-in General MIDI sound module to that interface. So this driver can be used to send MIDI data to play that card's built-in GM module, or adjust its parameters via System Exclusive MIDI messages. MPUDEV.SYS is not an MMPM (ie, MultiMedia Presentation Manager) driver. MPUDEV.SYS will not work with MMPM programs. It requires a program written to specifically follow my own protocol for dealing with MIDI input and output. I myself have written a number of such free programs including a System Exclusive dump utility, a MIDI piano controller program, a utility to view incoming MIDI data, etc. Programming information is available in this manual for others to write programs to use this driver, in languages such as C or even REXX. There is also information for making drivers and Dynamic Link Libraries for other hardware, maintaining compatibility with MPUDEV.SYS and its DLLs, so that programs which use MPUDEV can be used with other hardware as well. Some of the words in this manual are highlighted in bold text, such as Simple Approach. These are words that refer to MPUDEV definitions. Other words are in colored text such as Channel Pressure. These refer to MIDI messages (ie, data). Underlined words, such as Pitch Wheel, refer to hardware, such as if I was referring to the Pitch Wheel on your MIDI unit. Words that are in colored text such as Read This are meant to be emphasized. Words in italics refer to aspects of OS/2. ═══ 2. Copyright ═══ This OS/2 Online Book and the related file MPUDEV.SYS are all copyright 1995 by Jeff Glatt. These files are freely redistributable, and may be used by and distributed along with any software, be it commercial or otherwise, provided that these files are not internally modified, nor specifically sold as a complete product by themselves. The only price that you have to pay is the one that you're already paying by spending all of your time in front of a computer instead of developing healthier outlets. NOT SO STANDARD DISCLAIMER: These programs are provided "as is" without warranty of any kind either expressed or implied or tatooed in a place that only a few people have ever seen, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, and the dubious assumption that the software has been created by a sane individual who would never do anything that may hurt you. The entire risk as to the results and performance of the programs is assumed by you or someone who looks exactly like you. Jeff Glatt does not guarantee that the functions in these programs will meet your requirements, especially if your requirements involve lots of latex and some docile, domesticated animal. Nor does Jeff Glatt warranty the programs to be uninterruptable or error-free, although mercifully free of "General Protection Faults". If you use said programs, you can not say anything nasty about the author, even if the programs inadvertently cause the erasure of your collection of X-rated GIFs of a conservative, overweight and overrated TV "personality" plooking himself vigorously with his royalty checks from some rancid paperback. Jeff Glatt is not responsible for any damages as a result of anything that he has done, or hasn't done, or was supposed to do but never got around to it, and furthermore, he doesn't even care so leave him alone, ratface. You may have more or less protections in certain states of the union, depending upon how far your local politician is willing to bend over for some bribe from a business lobbyist. Just remember that Jeff Glatt has no money, so don't bother suing him as a result of any damages caused by this OS/2 program. Tell your greasy lawyer to go after IBM, and make sure that you pick 12 really stupid pinheads for the jury. If swallowed, induce vomiting immediately by contemplating the asthetics of Microsoft Windows. OS/2 is a trademark (and mismarketed product) of International Business Machines Corporation. Windows is a trademark of Microsoft Incorporated, and furthermore, Bill Gates is to blame for it. If you have unreasonably presumptuous suggestions (ie, an enduser who expects outrageous amounts of free support), snide comments, criticisms, and anything else other than dollar bills, then send them to someone else because you got it for free, and you know what you get for nothing? On the other hand, any type of positive contribution from other programmers is very much welcome and encouraged as these are the only folks who can made things happen for OS/2. IBM ain't gonna do it. If you do need to contact the author, then either phone some of the more prominent psychiatrict clinics in central New York state, or try this: Jeff Glatt 6 Sycamore Drive East New Hartford, NY 13413 (315) 735-5350 Sure, this copyright notice has attitude. Get used to it, or kill yourself. ═══ 3. Setup ═══ First of all, in order to use MPUDEV.SYS, you need a card that offers MPU-401 hardware compatibility. The card can't simply offer MPU-401 emulation through a software driver or TSR. It must have the 2 MPU-401 ports; STATUS and DATA. It must implement MPU-401 UART mode (ie, Intelligent Mode isn't needed). Bit #6 (DRR) of the STATUS port must be clear when the card is ready to accept another byte for output. Bit #7 (DSR) of the STATUS port must be clear when the card has an incoming MIDI byte waiting to be read. The bi-directional DATA port is used to output and input the MIDI data bytes. The card may also have the MPU-401's COMMAND port if it supports Intelligent mode, although MPUDEV.SYS doesn't require this since Intelligent mode isn't used. (Actually, the COMMAND port is really half of a bi-directional STATUS port). Check with your card's manufacturer or literature to verify that it supports MPU-401 UART mode in hardware. If necessary, try to get ahold of a technician who knows something about his own company's products (good luck), read this here paragraph to him, and ask him if it's applicable to his company's audio/MIDI card. Next, you need to copy the driver to a convenient place where OS/2 can access it when booting up. You also have to add a line to your CONFIG.SYS file to have OS/2 automatically setup the driver each time OS/2 boots. The line begins with the DEVICE= statement, followed by the driver's filename, and the driver's arguments. The driver's filename is MPUDEV.SYS. If you place the driver in some directory where OS/2 normally looks for drivers, then you only need specify this as the filename. Otherwise, you need to tell OS/2 the complete path where to locate the driver. For example, if you place the driver in a directory called blort on your D: drive, then your statement would begin as so: DEVICE=D:\BLORT\MPUDEV.SYS After this, upon the same line, you list arguments for the driver. MPUDEV.SYS can control up to 4 MPU-401 compatible devices. These 4 units have the internal names of MPUDEV1$, MPUDEV2$, MPUDEV3$, and MPUDEV4$. You specify the arguments for each unit within a set of brackets, for example: DEVICE=MPUDEV.SYS [the args for unit 1 go here] [the args for unit 2 go here] You don't need to specify args for all 4 units if you don't actually have 4 such cards. The above example only specifies args for the first two units; MPUDEV1$ and MPUDEV2$. Args are optional. If you don't specify them, then defaults are used. Even you want want all default values, you still need to have at least the opening and closing bracket for the unit's specification. Args can usually be placed in any order, as long as they remain within the brackets for their intended unit. The arguments are: Pxxx The base (ie, I/O) address where the card is installed. xxx is that address in hexadecimal. If you don't specify this arg, then MPUDEV assumes that this unit is at a base address of 330. Most cards have jumpers that allow them to be set to various base addresses. You must make sure that your card is not set to the same base address as any other card in your system (regardless of what type of card it is). Ixx The Interrupt (ie, IRQ) number that the card uses. xxx is that Interrupt number in decimal. If you don't specify this arg, then MPUDEV assumes that this unit uses Interrupt 9. Most cards have jumpers that allow them to be set to various IRQ numbers. You must make sure that your card is not set to the same IRQ as any other card in your system (regardless of what type of card it is). /Q This suppresses informational messages about this unit that the driver prints to the screen during OS/2's boot process. If you don't specify this arg, then the driver prints out the Version and Revision numbers of the unit. /U The driver skips setting the card into MPU-401 UART mode. If the card doesn't have the MPU-401's COMMAND port (ie, Roland cards such as the MPU-401, RAP-10, and SCC-1 do have this port), then you should specify this option. Undoubtably, the card will powerup in MPU-401 UART mode. If it doesn't, you'll need some other software to force it (and keep it) in this mode before any program can utilize MPUDEV.SYS to do MIDI I/O. Skipping this initialization means that MPUDEV's Revision and Version commands do not return the actual information supplied from the card itself, and default to 0. Furthermore, MPUDEV skips checking that the card is indeed an MPU-401 UART compatible. In fact, if you see the message Unit X failed to respond. Bad? where X is the unit number, then this means that either you've specified the wrong base address, or the card doesn't have a COMMAND port. If you specify /U and reboot, and the card appears to be working with MPUDEV, then you've got a card without a COMMAND port. If you don't specify this arg, then the driver switches the card into MPU-401 UART mode, checks that it has the COMMAND port (and therefore is definitely an MPU-401 compatible), and retrieves the version and revision numbers of the card. /R The card is a Roland RAP-10. This causes the driver to handle the card in a manner that is more flexible and efficient for this card. If you don't specify this arg, then the driver assumes that the card is a plain MPU-401 compatible. So, if you have one card installed at address 220 using interrupt 5, it's a RAP-10, and you want it to be the first unit (ie, MPUDEV1$), then your line would be: DEVICE=MPUDEV.SYS [P220 I5 /R] It's possible to skip some of the units. For example, if you wanted to skip the first two units (ie, MPUDEV1$ and MPUDEV2$) and set the above device to be the third unit (ie, MPUDEV3$), then you'd include the brackets for the first 2 units, but set their base address to 0 which means to skip the unit. DEVICE=MPUDEV.SYS [P000] [P000] [P220 I5 /R]