[comp.sys.atari.st] MIDI Help

AD0834@ALBNYVMS.BITNET (11/27/89)

To ST programmers/MIDI experts,

 I am trying to write a patch librarian for a 520STFM and a Roland D-10
keyboard. I am having problems because the input buffer on the ST isn't
large enough to hold the 256 byte blocks that the D-10 sends, and
unfortunately, I don't seem to be able to write a program which will
snag data from the buffer fast enough to prevent it overflowing.

Basically, my problem is this: I need to change the size of the MIDI
input buffer on the ST from the default 128 bytes to 256 (or more)
bytes. Does anyone know how to do this?!? Better yet, does anyone know
of PD MIDI librarians?

                                        Thanks,
                                        (and DESPERATELY yours,)

                                                Andy Dickinson

obryan@gumby.cc.wmich.edu (Mark O'Bryan) (12/06/89)

In article <8911270801.AA22825@ucbvax.Berkeley.EDU>, AD0834@ALBNYVMS.BITNET writes:
> 
>  I am trying to write a patch librarian for a 520STFM and a Roland D-10
> keyboard. I am having problems because the input buffer on the ST isn't
> large enough to hold the 256 byte blocks that the D-10 sends, and
> unfortunately, I don't seem to be able to write a program which will
> snag data from the buffer fast enough to prevent it overflowing.
> 
> Basically, my problem is this: I need to change the size of the MIDI
> input buffer on the ST from the default 128 bytes to 256 (or more)
> bytes. Does anyone know how to do this?!? Better yet, does anyone know
> of PD MIDI librarians?

A call to the XBios routine IoRec for device 2 (MIDI) will return a
pointer to the parameter block that contains all the information which
controls the buffering of input data.  The first item is a long pointer
to the input buffer.  So you set up your own area, then redirect the
input there by resetting that pointer.  This is followed by a buffer
size word, which you need to set, then a pair of head and tail indices.
Setting them to the same value will 'empty' the input buffer.

When you're all done, you'll want to put things back the way they
were, before your program exits.  Otherwise, you'll probably have a
nasty crash.

The above is from memory.  If you need details, I can look up the
specifics.

As for PD MIDI librarians, there are things like STMIDIEX, but they
won't be useful with Roland gear due to their need for handshaking
and timing constraints.

-- 
Mark T. O'Bryan                 Internet:  obryan@gumby.cc.wmich.edu
Western Michigan University
Kalamazoo, MI  49008