If you have read my disappointing results of previous attempts at M100-MIDI interfacing (see MIDI.INF), you will be pleased to know that, at last, YHWH has rewarded my efforts. Let me quote R. A. Penfold, from his book MIDI PROJECTS, to illustrate the problems one encounters in this endeavor. "The MIDI system is essentially the same as the RS232 serial ports fitted to many home computers, but in points of detail there are problems which would make it highly unlikely that a serial output from a computer could be used to drive a MIDI input. The first problem is that MIDI interafaces use standard 5 volt TTL levels, and normally have opto-isolator inputs to avoid problems with earth loops. RS232C ports use signal levels of nominally plus and minus 12 volts (plus and minus 5 volts in the case of the RS423) with no form of isolation at the inputs. This incompatibility could be overcome with suitable signal processing stages, but there is a more difficult problem with the baud rate. 31250 baud is not a standard rate, and it is not one that can be achieved with any home computer I have encountered. It might be possible to modify the serial interface to operate at the correct baud rate, but this would almost certainly render it unusable for other purposes, and would probably not be a very good idea." (p.5) The following two programs are only for the most basic MIDI I/O, and only made to work with a Yamaha PSR-70 electronic keyboard. I am sure, however, that they can be modified to work with any MIDI system. And of course, one can add many routines to these skeleton programs to print and edit the music. 1 CLS:MAXFILES=2 10 OPEN"com:98n1d"FORINPUTAS1:OPEN"music.do"FOROUTPUTAS2 The MIDI bit stream consists of one start bit, 8 data bits, and one stop bit. No parity bits are generated. The baud rate chosen is incorrect, but this will be taken care of in the next line. 20 OUT180,5:OUT181,64:OUT176,195 Let me explain this line. Port 180 is the 8155 timer register's lower byte. Poking a 5 in there causes the clock speed to be divided by 5. Port 181 is the upper byte of the timer register. Setting bit 7 with the 64T puts the output in the "continuous square wave" mode. Port 176 is the command register of the 8155. C3H is the "START" (bits 6 and 7) command, without which the baud would remain at 19200, and bits 1 and 2 set ports A and B in the output mode. For further info on this chip see Intel's EMBEDDED CONTROLLER HANDBOOK, pages 11-31 to 11-44. 25 ONCOMGOSUB30 26 COMON:N=1 27 FORX=1TO10:NEXT:N=N+1:PRINT@160,N:GOTO27 The "n" counter is my cheap way of timing the notes. 30 N$=INPUT$(1,1):IFN$