Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!acsu.buffalo.edu From: terpin@acsu.buffalo.edu (christophe d terpin) Newsgroups: comp.sys.atari.8bit Subject: Re: Homemade MIDI Interface -- Part 2 of 2 Message-ID: <68434@eerie.acsu.Buffalo.EDU> Date: 2 Apr 91 20:28:59 GMT References: <67653@eerie.acsu.Buffalo.EDU> <67656@eerie.acsu.Buffalo.EDU> <4484.27f222d7@miavx1.acs.muohio.edu> Sender: news@acsu.Buffalo.EDU Organization: SUNY Buffalo Lines: 74 Nntp-Posting-Host: lictor.acsu.buffalo.edu In article <4484.27f222d7@miavx1.acs.muohio.edu> rlcollins@miavx1.acs.muohio.edu (Ryan 'Gozar' Collins) writes: >After seeing the diagram for the MIDI interface I was wondering. How hard >would it be to hook it up to an ST through the MIDI ports, and be abel to >transfer data back and for? (Or even to use the ST as a pseudo disk drive >for the Atari. I'd be willing to write the software for the ST, hopefully >writing it as a DA so you can be using both your ST and your 8-bit at the >same time.) > >Any thoughts or ideas? > >------------------------------------------------------------------------------ >Ryan 'Gozar' Collins Question for IBM Users: rlcollins@miavx1.BITNET > |||| Power Without How DO you move/copy a rc1dsanu@miamiu.BITNET > / || \ The Price!! Subdirectory? R.COLLINS1 on GEnie >------------------------------------------------------------------------------ It would probably be fairly easy. In fact, I originally used my interface as an RS232 link to my IBM-PC to transfer data at 19200 baud. The 8bit software for this Null modem was virtually identical to the MIDI source code. The only differences were that it didn't insert the VBI timing marks during input ("recording") and the values for AUDF3 and AUDF4 were different. (I've seen a formula that relates AUDF3,AUDF4 to baud rate-- I believe it's in the Operating System listing.) The V: handler I wrote for the MIDI interface will work fine for SENDING data TO the ST: i.e. here's a basic 8bit program to transfer a file from your 8bit to your ST through the interface: 5 REM make sure D:MIDI.OBJ has been loaded 10 DIM FILE$(20) 20 PRINT "Enter filename to send";:INPUT FILE$ 30 CLOSE #1: OPEN #1,4,0,FILE$ 40 I=USR(39158,ASC("I")) : REM initialize handler 50 CLOSE #2: OPEN #2,8,0,"V:" 60 TRAP 80 70 GET #1,A:PUT #2,A:GOTO 70 80 CLOSE #1:CLOSE #2 The ST program would dump its MIDI data to some buffer. Unfortunately, I don't own an ST (which is what motivated me to build a MIDI in the first place :) ), so I have no idea how to access the MIDI port through the ST. The V: handler as I have written it, however, doesn't work very well for input nor does it use the normal SIO protocol. The source code would have to be modified by disabling the VBI timer routine in the RECORD section of the source. Using the new object code, the 8bit receive program goes something like this: 5 REM make sure modified MIDI.OBJ is loaded in. 10 DIM DATA$(20000) :REM buffer for received data 20 DIM FILE$(20) 30 DATA$(1)=CHR$(0):DATA$(20000)=CHR$(0):DATA$(2)=DATA$ 40 I=USR(39158, ASC("I"): REM init V: handler 50 CLOSE #1:OPEN #1,4,0,"K:" 60 PRINT "Hit any key to start receiving":GET #1,K 65 REM ST starts transmission here. 70 I=USR(39158, ASC("R"), ADR(DATA$)): POKE 204,1 80 PRINT "Hit any key to stop receiving": GET #1,K:POKE 204,0 90 PRINT "Filename to save data to?":INPUT FILE$ 100 CLOSE #2:OPEN #2,8,0,FILE$ 110 ?#2;DATA$; 120 CLOSE #2 To load in the object code you can use one of 2 methods: 1) POKE 106,153:GR.0:DOS & load binary file MIDI.OBJ 2) POKE 106,153:GR.0:XIO 41,#1,0,0,"D:MIDI.OBJ" The POKE is necessary to move the HIMEM page value down so that the screen data and the program don't overlap. Hope this helps. Chris Terpin terpin@ubunix.acsu.buffalo.edu