[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

1214.0. "Unix, X windows, and midi" by ROYALT::ORSHAW (Associate FTSG membership pending.....) Sat Dec 07 1991 18:33

    In my search for a system that runs unix, X windows, and has a midi
    port, I've come up with the following solution:
    
    A used sun workstation (unix and X) that talks to my atari ST over the
    serial port. The atari will pass data untouched between the serial port
    and the midi port.  (One of those serial to midi convertors would work
    just as well but I'll make use of my atari).
    
    Question: What's the best way to write a program for the atari to do
    the serial to midi pass-thru?? I can always poll both ports but I'm
    looking for a better way (a select() call??).
    
    There are various reasons I've chosen the sun/atari combination. I'll
    tell y'all if you're interested.
    
    Jim
T.RTitleUserPersonal
Name
DateLines
1214.1Some thoughts on howPRNSYS::LOMICKAJJeffrey A. LomickaMon Dec 09 1991 12:0129
I could make a case for a TT here, but the used Sun is likely to be
cheaper, and I'm not 100% sure of the status of Unix for the TT.  I will
know soon and let you know.

Absolutely the best way to do the Serial ot Midi connection on the ST
is to hang at IPL 7 and poll the hardware.  The interrupt latency at
these speeds is too large, and the midi port is unbuffered, and the
keyboard service routine takes more than a Midi character time to run. 
If you want to accept full speed Midi, this is clearly the best way. 
If you don't believe me, ask Mr. Miskinis, who also has a lot of
experience with this.  It's possible to do this with interrupts, but you
have to take over the keyboard/Midi vector, and make sure the system's
keyboard routine never runs, because the keyboard service hangs at IPL7
for longer than a Midi character time.  This results in overrun errors.
(I'm thinking of a scheme to get around this, but I haven't tried it yet.)

In any case, your biggest problem here will be flow control.  It would
be best if you could set up link between the Atari and the Sun such that
you transmit to the Atari at 19,200, and receive at 38,400, since then
you wouldn't have to buffer anything.  Since the ST can't do split speed
on the serial port, you will have to use 38,400 for both directions, and
rate limit the transmission from the Sun to Midi rate of 31,200.  Also,
you should keep a buffer in the Atari in case the rate limiting has
occasional glitches that cause the data to come in bursts of a few bytes
each back to back.

If the Sun doesn't do 38,400, then use 19,200, and keep a large buffer
on the ST for incoming data, and hope it doesn't overrun.  (It shouldn't
on real data, but it could in the "lab".)
1214.2more infoROYALT::ORSHAWAssociate FTSG membership pending.....Mon Dec 09 1991 23:3411
    I'm a little confused. I thought the midi port was buffered. I did an
    iorec in my librarian to increase the midi buffer size.
    
    So the solution is to put myself at ipl7 (how?? -- from C) and poll. I
    wasn't really thinking of "real time". I was thinking in terms of
    packets. I wait until I receive a full midi packet and then transmit it
    to the Sun and visa-versa. 
    
    I assume I poll with the Bcon*** routines??
    
    Jim
1214.3Poll means poll the hardwarePRNSYS::LOMICKAJJeffrey A. LomickaTue Dec 10 1991 12:128
Oh, it's software buffered, but the Atari has trouble reading from the
midi port without data overruns, beacuse there is no hardware buffering.
When processing events from the keyboard, the keyboard service stays at
high IPL long enough to prevent getting back to the midi port.

The easy way is to write a small assembly program that goes to IPL 7,
and polls the MC6850 hardare directly for data, as well as the 68901
serial port.
1214.4interrupt level methodAIDEV::MISKINISTue Dec 10 1991 18:2716
The ACIA that handles input from MIDI/KEYBOARD only has a one byte
buffer, and that's what causes all these "problems"...

You'd be best to place your own routine at address (hex) 118, which
is called whenever a level interrupt is encountered.  You could read
the byte out of the ACIA, and if it's a MIDI byte, send it out
the RS232 port...

The downside of this is that normal keyboard/mouse/joystick bytes
(as well as MIDI) would not get to their "normal" place.  This
then would prevent other applications from being run concurently...

_John_

P.S.  Has anyone ever got LINEAE (raster copy) to work?  I'm frustrated!
1214.5Atari Hardware midi thru???ROYALT::ORSHAWMon May 25 1992 03:5225
    Well I have some progress to report. I have the program written that
    passes data between the midi and serial ports. Initial tests (me
    playing quickly on a midi keyboard and small sysex messages) showed no
    loss of data. 

    I did find one problem:

    When I implemented a "midi-echo" program on the Sun, I got 2 notes out for
    every note sent in. As it turns out, the atari implements a midi-thru
    by tying 2 unused pins (1 & 3??) to the real midi pins (4 & 5). For
    whatever reason, my roland d-110 recognized the signals on the renegade
    pins as well as the signals on the correct pins. So of the 2 notes that
    I got back, 1 was from the atari hardwired pins, and the other was
    echoed from the sun. This was a problem. The solution (one of several)
    is to run midi out from the atari to my pocket merge. The pocket merge
    seems to not propagate the renegade pins.

    Can anyone verify that the atari is supposed to implement a midi-thru
    in hardware? Does anyone know why a roland d-110 recognizes data on
    non-standard pins? Does anyone know what's inside a pocket merge?

    thanks,
    Jim

    
1214.6It's supposed to do thatPRNSYS::LOMICKAJJeffrey A. LomickaMon May 25 1992 20:367
Atari's implementation of hardware Midi-thru on the midi out connector
is well documented in the Atari user's manual, on the page that gives the
pin-out for the connector.  I have build Y-adaptors to split this out
into a real Midi-thru jack for occasions when I actually WANT this.

I don't know whey the D110 has fits with it - check it's own connector
pin-out manual!