[sci.electronics] MIDI Interface

drfoam@watcsc.waterloo.edu (Dennis Henry) (11/06/90)

A friend of mine has embarked on a project to interface his computer
to some MIDI instruments.  He wishes to build the hardware and to
write the software.

Any information or references to information on the hardware interface
and the data formats would be much appreciated.

I will summarize any responses Emailed to me.

Thanks in advance.

drfoam@watcsc    (Dennis Henry)

clemon@lemsys.UUCP (Craig Lemon) (11/10/90)

In a message posted on Tue, 6 Nov 90 12:05:35 GMT,
drfoam@watcsc.waterloo.edu (Dennis Henry) wrote:
DH>A friend of mine has embarked on a project to interface his computer
DH>to some MIDI instruments.  He wishes to build the hardware and to
DH>write the software.
DH>
DH>Any information or references to information on the hardware interface
DH>and the data formats would be much appreciated.
DH>drfoam@watcsc    (Dennis Henry)
DH>

	For the portion of MIDI that comes FROM the computer, all you need
to do is invert SD pin of your serial port (ie. 74LS04) for every port you
would like to run.  For input you must opto-isolate the path.  I can mail
 GIF or Amiga IFF schematics to anyone interested.

	This interface works on my Amiga and a general knowledge of your
computer (ie port configurations) will be necessary.

--
 Craig Lemon - Kitchener, Ontario. Amiga B2000/10--2400 bps--AmigaUUCP 1.03D
 clemon@lemsys.UUCP   or   lemsys!clemon@xenitec.on.ca
 ....!{uunet}!watmath!xenitec!lemsys!clemon

whinery@hale.ifa.hawaii.edu (Alan Whinery) (11/13/90)

In article <3757.658193903@lemsys.UUCP> clemon@lemsys.UUCP (Craig Lemon) writes:
>In a message posted on Tue, 6 Nov 90 12:05:35 GMT,
>drfoam@watcsc.waterloo.edu (Dennis Henry) wrote:
>DH>A friend of mine has embarked on a project to interface his computer
>DH>to some MIDI instruments.  He wishes to build the hardware and to
>DH>write the software.
>
>	For the portion of MIDI that comes FROM the computer, all you need
>to do is invert SD pin of your serial port (ie. 74LS04) for every port you
>would like to run.  
>
>	This interface works on my Amiga and a general knowledge of your
>computer (ie port configurations) will be necessary.
>
>--
> Craig Lemon - Kitchener, Ontario. Amiga B2000/10--2400 bps--AmigaUUCP 1.03D

Whoa! Although the serial port and serial device on the mighty Amiga can 
handle the 31,250 baud necessary for MIDI, most other machines (for 
instance, IBM & compatibles generally cannot. You will find that the 
serial handler in MS-DOS is not capable of higher than 19200 baud, not
necessarily because of speed, but because they don't build 'em for MIDI.
If you have an IBM type machine, you need to build the interface from
the ground up, and then you should stick close to the Roland MPU 401
de facto standard if you want to use store-bought software. Unless you
are supremely masochistic, or you just want to tinker, buy a compatible
MIDI interface, or and AMIGA! 8^). 
Alan Whinery 
(whinery@hale.ifa.hawaii.edu)

brewer@ace.dec.com (John Brewer) (11/14/90)

In article <3757.658193903@lemsys.UUCP>, clemon@lemsys.UUCP (Craig Lemon) writes...
>In a message posted on Tue, 6 Nov 90 12:05:35 GMT,
>drfoam@watcsc.waterloo.edu (Dennis Henry) wrote:
>DH>A friend of mine has embarked on a project to interface his computer
>DH>to some MIDI instruments.  He wishes to build the hardware and to
>DH>write the software.
>

	An Atari ST is a good choice as it has built in MIDI as well.

	/john wb5oau

lairdkb@mentor.cc.purdue.edu (Kyler Laird) (11/14/90)

In article <10268@uhccux.uhcc.Hawaii.Edu> whinery@hale.ifa.hawaii.edu (Alan Whinery) writes:
>Whoa! Although the serial port and serial device on the mighty Amiga can 
>handle the 31,250 baud necessary for MIDI, most other machines (for 
>instance, IBM & compatibles generally cannot. You will find that the 
>serial handler in MS-DOS is not capable of higher than 19200 baud, not

1) Some programs push the serial port to 56K baud, no?

2) I've seen a MIDI adapter for the (serial/parallel?) port of an IBM-compat.
	Looked like a good investment for my laptop - check Electronic Musician.
	(Probably had a driver to make it MPU-401 compat.)

--kyler

bender@oobleck.Eng.Sun.COM (Michael Bender) (11/14/90)

In article <10268@uhccux.uhcc.Hawaii.Edu> whinery@hale.ifa.hawaii.edu (Alan Whinery) writes:
-->In article <3757.658193903@lemsys.UUCP> clemon@lemsys.UUCP (Craig Lemon) writes:
-->>In a message posted on Tue, 6 Nov 90 12:05:35 GMT,
-->>drfoam@watcsc.waterloo.edu (Dennis Henry) wrote:
-->>DH>A friend of mine has embarked on a project to interface his computer
-->>DH>to some MIDI instruments.  He wishes to build the hardware and to
-->>DH>write the software.
-->>
-->>	For the portion of MIDI that comes FROM the computer, all you need
-->>to do is invert SD pin of your serial port (ie. 74LS04) for every port you
-->>would like to run.  
-->>
-->>	This interface works on my Amiga and a general knowledge of your
-->>computer (ie port configurations) will be necessary.
-->>
-->>--
-->> Craig Lemon - Kitchener, Ontario. Amiga B2000/10--2400 bps--AmigaUUCP 1.03D
-->
-->Whoa! Although the serial port and serial device on the mighty Amiga can 
-->handle the 31,250 baud necessary for MIDI, most other machines (for 
-->instance, IBM & compatibles generally cannot. You will find that the 
-->serial handler in MS-DOS is not capable of higher than 19200 baud, not
-->necessarily because of speed, but because they don't build 'em for MIDI.
-->If you have an IBM type machine, you need to build the interface from
-->the ground up, and then you should stick close to the Roland MPU 401
-->de facto standard if you want to use store-bought software. Unless you
-->are supremely masochistic, or you just want to tinker, buy a compatible
-->MIDI interface, or and AMIGA! 8^). 
-->Alan Whinery 
-->(whinery@hale.ifa.hawaii.edu)

I've had very good sucess modifying a standard IBM-type serial port card
(based on the 8250 UART) for MIDI work; I believe there was an article
posted on the modification several days ago.  I used it on a 6MhZ PC/AT,
with my serial drivers written in optimized TurboC.

mike
--
Won't look like rain,           Won't look like snow,            | DOD #000007
Won't look like fog,            That's all we know!              | AMA #511250
We just can't tell you anymore, We've never made oobleck before! | MSC #298726

fmgst@unix.cis.pitt.edu (Filip M Gieszczykiewicz) (11/14/90)

	Greetings. This is for those of you interested in building 
	a MIDI interface board for the IBM PC. 

	I have an article from BYTE (1985-86ish) that describes the
	MIDI protocol in detail, has drawings and parts layout for
	a DART (Z80 family) based board, and has listings of MIDI
	software in BASIC. It was a simple project with 2 input
	ports (or was it 2 output ports?). I actually though
	of building it (for "hacker" reasons, not musicaly inclined)
	but never got around to it. Parts for that project can be
	bought for peanuts these days and you can get a wire-wrap
	board from Vector (sp?) and tools and wire from RatShack


	I'm sure you can get a back issue of BYTE at your local library,
	since I'm not sure that BYTE wants me to give out photocopies
	of that article  :-)

	Take care. 
-- 
_______________________________________________________________________________
"The Force will be with you, always." It _is_ with me and has been for 10 years
Filip Gieszczykiewicz  "... a Jedi does it with a mind trick... " ;-)
FMGST@PITTVMS  or  fmgst@unix.cis.pitt.edu "My ideas. ALL MINE!!"

whinery@hale.ifa.hawaii.edu (Alan Whinery) (11/15/90)

In article <16585@mentor.cc.purdue.edu> lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:
>In article <10268@uhccux.uhcc.Hawaii.Edu> whinery@hale.ifa.hawaii.edu (Alan Whinery) writes:
>>Whoa! Although the serial port and serial device on the mighty Amiga can 
>>handle the 31,250 baud necessary for MIDI, most other machines (for 
>>instance, IBM & compatibles generally cannot. You will find that the 
>>serial handler in MS-DOS is not capable of higher than 19200 baud, not
>
>1) Some programs push the serial port to 56K baud, no?
>
 There may be increased speed built into BIOS in the latest versions of 
DOS, but one of the bones of contention that most programmers have had
historically with MS-DOS (through at least ~3.2) is that it doesn't handle
higher than 19200. There was an article in Dr. Dobb's on or around May '87 
which presented a new serial driver for MSDOS -- it added divisors, pushed 
up the speed, etc. I've got it at home somewhere. Ironically, it was one
issue after their MIDI issue in that same year.  As for those programs that
push up at higher speeds, they are generally "bare metal" (not through BIOS).
Making the serial port on an IBM compatible do non-standard baud rates is 
a complex, non-trivial problem. Once you get the baud rate, you have to handle
the queues, all of which represents an interrupt driven fancy bit o' 
programmin'.:^)   All I'm saying is that you should be someone who loves 
the tinkering process before you attempt to homebrew useful MIDI on an
MSDOS machine. Timers and timestamps, data compression on-the-fly,
those and other considerations  make MIDI a hairy proposition. I only 
mention all of this to stay someone from doing it "to save a little money".

Do some consulting. Spend THAT money on the MIDI. 
:^) :^) :^) {Send email flames to yourself.}

Alan 
whinery@hale.ifa.hawaii.edu

davet@tsdiag.ccur.com (Dave Tiller N2KAU) (11/16/90)

In article <16585@mentor.cc.purdue.edu> lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:
-In article <10268@uhccux.uhcc.Hawaii.Edu> whinery@hale.ifa.hawaii.edu (Alan Whinery) writes:
->Whoa! Although the serial port and serial device on the mighty Amiga can 
->handle the 31,250 baud necessary for MIDI, most other machines (for 
->instance, IBM & compatibles generally cannot. You will find that the 
->serial handler in MS-DOS is not capable of higher than 19200 baud, not
-
-1) Some programs push the serial port to 56K baud, no?

The problem here is not whether the serial port can run _fast_, it's
whether it can run 31.25 Kbps.  The typical 8250 uarts use a guzinta
circuit (a programmable divider) to set the bit rate.  Unfortunately
the accuracy at high speeds just isn't there.  As I recall they use a
1.8432 MHz xtal to drive the divider and the fixed div-16 prescaler in the
uart.  Thus, 1.8432 MHz / 31250 / 16 = 3.6864.  Using 3, we'd get 38.4 Kbps,
using 4, we'd get 28.8 Kbps.  Other values:
115200 = 1, 19200 = 6, 9600 = 12, 4800 = 24, 2400 = 48, etc..
This number get stuck in a register on the serial card.
-- 
David E. Tiller         davet@tsdiag.ccur.com  | Concurrent Computer Corp.
FAX:  201-870-5952      Ph: (201) 870-4119 (w) | 2 Crescent Place, M/S 117
UUCP: ucbvax!rutgers!petsd!tsdiag!davet        | Oceanport NJ, 07757
ICBM: 40 16' 52" N      73 59' 00" W           | N2KAU @ NN2Z

bender@oobleck.Eng.Sun.COM (Michael Bender) (11/17/90)

In article <1138@tsdiag.ccur.com> davet@tsdiag.ccur.com (Dave Tiller N2KAU) writes:
->In article <16585@mentor.cc.purdue.edu> lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:
->-In article <10268@uhccux.uhcc.Hawaii.Edu> whinery@hale.ifa.hawaii.edu (Alan Whinery) writes:
->->Whoa! Although the serial port and serial device on the mighty Amiga can 
->->handle the 31,250 baud necessary for MIDI, most other machines (for 
->->instance, IBM & compatibles generally cannot. You will find that the 
->->serial handler in MS-DOS is not capable of higher than 19200 baud, not
->-
->-1) Some programs push the serial port to 56K baud, no?
->
->The problem here is not whether the serial port can run _fast_, it's
->whether it can run 31.25 Kbps.  The typical 8250 uarts use a guzinta
->circuit (a programmable divider) to set the bit rate.  Unfortunately
->the accuracy at high speeds just isn't there.  As I recall they use a
->1.8432 MHz xtal to drive the divider and the fixed div-16 prescaler in the
->uart.  Thus, 1.8432 MHz / 31250 / 16 = 3.6864.  Using 3, we'd get 38.4 Kbps,
->using 4, we'd get 28.8 Kbps.  Other values:
->115200 = 1, 19200 = 6, 9600 = 12, 4800 = 24, 2400 = 48, etc..
->This number get stuck in a register on the serial card.

that's true if you use the stock oscillator, but if you replace it
with either a 1 or 2 MhZ oscillator, it works fine.  I believe some
of the early MIDI implementations in keyboards/drum machines used
the motorola 6850 clocked at 1 MhZ.

mike
--
Won't look like rain,           Won't look like snow,            | DOD #000007
Won't look like fog,            That's all we know!              | AMA #511250
We just can't tell you anymore, We've never made oobleck before! | MSC #298726