MIDI interface 

Seeing as people only seem to ever e-mail me to ask this one question, I figure I should answer it up here at the top so people don't need to e-mail me to ask.  This device is NOT for use with a PC running Windows.  It was not designed for that purpose, nor will it ever be suitable for that purpose.  It was designed to work with a specific model of UNIX workstation that is constructed from proprietary designs.  The only other devices that could use this interface would be devices that can directly do a MIDI baud rate over an RS-232 serial interface.  So to sum up, THIS DEVICE IS FOR THE CONVERSION FROM RS-232 SERIAL MIDI DATA SENT AT 31250 BAUD TO A 5V TTL LEVEL MIDI SIGNAL, AND VICE VERSA.  Nothing more, nothing less.  It cannot and will not reclock a different speed of signal down to a MIDI baud rate.  There are other device plans on the Internet for that kind of thing, plus commercial units can be purchased for a very reasonable price in RS-232, RS-422, parallel, and USB formats.  You'd be much better off going that route, to be completely honest.  Anyhow, that being said, on with the show.

For the longest time I didn't bother to do any MIDI work on my O2 because of a little note in the MIDI manual pages that stated that MIDI through the serial port is not supported on the O2.  I thought this meant that the software that came with the O2 couldn't do it, but as it turns out it CAN do it, it's just that SGI doesn't make the hardware to convert the RS-232 serial ports on the O2 into MIDI input and output.  So, I set to making my own.

I had been told that you can use a converter to change the RS-232 port on the O2 to an RS-422 port and then use a regular old Macintosh MIDI box, but that costs too much and I've never met anybody who said that such a technique worked.  I have, however, talked to people who said it didn't.  There's a couple of reasons why you can't just go out and get a MIDI box for any computer that uses an RS-232 serial port.  I was told that with PC serial ports, the UARTs they use are not directly capable of handling the 31250 baud rate used in MIDI data transfers, and so the MIDI box has to do some kind of speed transfer.  I'm not sure exactly how that's supposed to work, but for the purposes of explaining this device it doesn't really matter anyhow.  The O2, being the piece of engineering genius that it is, can directly do MIDI serial data speeds, so it doesn't make use of the PC technique of speed rate conversion.  So we turn to another piece of engineering genius that was able to do MIDI speeds directly... the Commodore Amiga.  However, Amiga MIDI boxes take their power from the Commodore 25 pin serial port setup, on which three of the pins were used for a 12v differential power supply.  This means that you could use an Amiga MIDI box if you could modify it for an external power supply, but you'd need a 12v differential power supply, which is a pain in the ass.

With all this in mind, my goal was to create a MIDI box similar to the Amiga MIDI boxes that ran off an external power supply, preferably something easy to work with like 5 volts.  The main reason for needing a 12 volt differential power source is to generate the RS-232 signal, which uses those voltage swings to indicate ones and zeros.  However, thanks to the good folks at Maxim Electronics, you can get an RS-232 driver/receiver chip that requires no external components and runs from 5 volts.  This chip is the heart of the circuit, and what makes it all possible.  All you need beyond that is an optoisolator to comply with MIDI circuit standards and a 5 volt power supply to run it and you are in business.

The circuit schematic available here does not show the 5 volt power supply circuit, since it is a standard circuit that can be cheaply built from something like a 7805 and a few capacitors.  Also, this particular MIDI device does not have a MIDI THRU port on it, though it wouldn't be hard to make one.  And, as the MAX233A chip used for the circuit is a dual transmitter/receiver, if you wanted to you could easily add a second serial port and MIDI ports so you could use one device to operate both serial ports on the O2, though I'm not sure why anyone would need to do that.

Parts are cheap, I was able to build mine for under maybe $20.  The most expensive parts were probably the DB-9 female port and the two 5-pin DIN sockets.  Maxim sent me a free MAX233A as an engineering sample, and the rest of the parts were pretty common and cheap.

I built this exact circuit on a protoboard and it works like a charm.  The one capacitor value could probably be a little higher, but it seems to work as it is shown here.  If you do build it, though, I can't guarantee it'll run for you; maybe I just got lucky.  But as long as you do a sanitary enough job, I don't see why it wouldn't work.
 

-UPDATES-

I've received some suggestions about the schematic, and thought they were worthy for inclusion here.  My thanks to Jean-Philippe Gey for these suggestions.  The diode used in the MIDI IN stage of the interface as per my schematic is a 1N914 diode, nothing fancy.  I chose this because it seems easy enough to find them at a local Radio Shack.  A different diode, the 1N4148, appears to be more common however.  In fact, Digi-Key lists that diode as the one to buy instead of a 1N914.  Also, the 6N139 optoisolator I used could be replaced with a 6N138; Jean-Philippe feels this might be more efficient, although I stuck with the 6N139 as it seemed to have better specs for this application at a meager cost increase.  Also, my local electronics store didn't have anything other than the 6N139, so I figured what the hey.  Whatever the case, I am sure either one would work equally well.  As they often say, your mileage may vary.  Or, if you're metric, your kilometerage may very.  Heck, your system of measurement may vary.

Jean-Philippe also sent me this URL.  It has a lot of really nice MIDI hardware projects on it, as well as an Amiga MIDI interface which is sort of like the O2 interface, though in my (obviously biased) opinion I still think mine is cooler.  Check it out, though, there's some other nice stuff over there.

Paul Miller wrote in to say that he successfully built a version using the MAX233 chip instead of the MAX233A. Apparently the two have identical pinouts, it's just that the MAX233A has more impressive specs. The MAX233 might be easier to find at your local store however, so if that's all you can find, feel free to go with it.

I have left my schematics as-is without any updates, though, as I haven't tested the alternate configurations and I know my current design seems to work great for me.  Again, if you have any suggestions, feel free to e-mail them to me.

MIDI interface schematic as a .gif image (8k)
MIDI interface schematic as a postscript file (13k)
A crappy JPEG image of the prototype interface I built for myself (42k)

Back to the Bad Idea page