home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
MIDI
/
MIDI-CNV.LBR
/
MIDI-CNV.DZC
/
MIDI-CNV.DOC
Wrap
Text File
|
2000-06-30
|
6KB
|
137 lines
RS232 TO MIDI CONVERTER 23-Jan-89
-----------------------
1. Introduction
The following notes provide details on building an RS232 to MIDI
interface. The only requirement is that the computer have an
RS232 port that can be programmed to operate at 31.25 Kbaud.
2. MIDI
Many electronic music instruments are now fitted with a MIDI
(Musical Instrument Digital Interface) port. This allows
instruments to control (or be controlled) by other instruments.
A computer fitted with a MIDI port makes an excellent instrument
controller. Some of the applications being - a MIDI multi-track
recorder/sequencer or a voice editing program for a MIDI
synthesizer.
MIDI is actually very similar to the RS232 serial standard. The
only differences being that MIDI operates at 31.25 Kbaud and uses
a 5 mA current loop rather than voltage levels. It uses an 8 bit
word, 1 stop bit and no parity. Provided that your computer has a
serial interface that can be programmed to operate at 31.25 Kbaud
then the only other need is for a simple RS232 to MIDI interface.
3. MIDI Interface
The interface features both MIDI IN and MIDI OUT ports and uses
readily available components. The circuit has been designed
specifically to use a cheap opto-isolator rather than the
expensive (and often difficult to obtain) 6N138 or HCPL2730
usually specified. To simplify matters, 0v instead of -12v is
used as the negative RS232 output level. This should not be a
problem as most computers use the 1489 receiver chip which will
operate with 0v input. Power requirements for the interface is
modest. Either +12v or +5v (see circuit diagram) is obtainable
in most instances from the host computer's RS232 port.
To see the circuit diagram of the interface, simply send the
ascii file MIDI-CNV.CIR to your screen or printer.
4. Connections
After building the interface, check the wiring thoroughly.
Incorrect connections are likely damage either computer or MIDI
instrument.
Connect the interface between a spare serial port on your
computer (RS232 channel B in the case of the Ampro Z80 or
Bondwell 14) and the MIDI instrument. Some computers may require
the connections going to pins 2 and 3 of the RS232 connector be
reversed.
Computer Interface MIDI Instrument
RS232 RS232 MIDI MIDI
-----, ,--------------------, ,--------
| | OUT 4 | -------- | 4 IN
TX 2 | ----------- | 2 | |
| | OUT 5 | -------- | 5 IN
| | | |
| | | |
| | IN 4 | -------- | 4 OUT
RX 3 | ----------- | 3 | |
| | IN 5 | -------- | 5 OUT
| | | |
7 | ----------- | 7--, | '--------
| | | |
-----' '----|-----|---------'
| |
gnd +12v
Note - A MIDI cord consists of a two-wire cable with a 5 pin 180
degree DIN audio connector on each end. Pin 4 connects to pin 4
and pin 5 connects to pin 5. Two such cords will be required.
5. Testing
Once you have built the interface, it can be tested with the
simple Basic program provided. There are versions of the program
for the Ampro Z80 Little Board and the Bondwell 14. If using the
Bondwell you will need to make a modification to the computer
first. See note elsewhere.
If you have a computer other than these then you will have to
modify the program accordingly. The main requirement is to
correctly initialise your RS232 port for 31.25 Kbaud, 8 data
bits, 1 stop bit and no parity.
The program itself does little more than send a note to the MIDI
instrument when a key on the computer keyboard is pressed. The
pitch of the note varies depending on which key has been struck.
Make sure that your MIDI instrument is set receive on MIDI
channel 1 (there are 16 possible MIDI channels).
Well that's it. Once everything checks out you are ready to write
some good MIDI software. If you do, it is a good idea to keep
your hardware specific code (eg. serial port initialisation) in a
separate module. This will allow others with different machines
to get your code running with a minimum of trouble.
6. Bondwell 14 Modifications
The following modification to the Bondwell allows Serial Port B
to be used for MIDI applications while leaving Serial Port A
unchanged and usable for normal RS232 applications (modem,
printer etc). The modification is simple and does not require the
cutting any tracks.
The baud rate generator in the Bondwell uses a 1.8432 Mhz clock
to derive all the standard RS232 baud rates. To generate the
required baud rate for MIDI (31.25 Kbaud) a clock frequency of
500 Khz or a multiple thereof is needed. The modification
disconnects the 1.8432 Mhz clock from 8253 timer 1 and replaces
it with a 2 Mhz signal. Timer 1 can then be programmed for a
division ratio of 4 giving the required 500 Khz.
a) Remove top cover and locate 8253 timer chip. Remove it from
its socket.
b) Obtain a 24 pin IC socket which has flat pins. Bend pin 15 of
the socket upwards. Plug the socket into the socket vacated by
the 8253. Ensure that the bent pin is not in contact with pin
15 of the motherboard socket.
c) Obtain a length of wire-wrap wire. Solder one end to the
upturned socket pin. Solder the other end of the wire to pin 6
of IC39 (74LS04).
d) Insert 8253 into piggy-backed socket and replace cover.
---------------------