home *** CD-ROM | disk | FTP | other *** search
-
- midi_in - replacement MIDI port input handler for midi.library
-
- version 0.0a, release data 2/15/90
-
- This is an alpha release of my alternate MIDI input port handler for
- Bill Barton's MIDI library.
-
- The advantage of midi_in over the MidiIn input port handler that comes
- with the library is that midi_in incurs far fewer data overruns and
- missed bytes.
-
- Anyway, midi_in can be double-clicked on, then routed from just like
- the default MIDI handler, MidiIn. To use, double click on midi_in,
- or start it from the CLI. Then route to it. Don't use MidiIn if
- you're going to use midi_in.
-
- How it works is that midi_in's interrupt handler is written in assembly
- and does the minimum handling necessary to support MIDI. As quickly as
- it can, it gets the byte out of the UART receive register and into a
- memory queue, then notifies a handling task via a signal to indicate that
- data is available. (A task was necessary because the MIDI library does
- not allow interrupt handlers to queue directly to MIDI library source
- ports -- the MIDI library calls AllocMem and such behind your back)
-
- Anyway, the queue is rather clever in that there are two fairly large
- buffers, one that the interrupt handler is writing into and one that
- the task is reading out of. When the task is notified that there is
- data in the queue, it uninterruptibly swaps the two buffers and processes
- all the data received so far in that buffer. This way if it gets behind
- multiple bytes can be efficiently received while already received data
- is being pumped on out.
-
- One bug is that the handler signals the midi_in task pretty indiscriminately,
- like per byte received. It should only signal when an entire MIDI message
- has been received, and maybe after a certain number of bytes or time
- interval elapsing without data being received while receiving system
- exclusive messages. I have a version which was written to work that way,
- but it is currently too buggy to release. Anyway, because of that, the
- Amiga is pretty close to 100% busy when receiving system exclusive data
- just from all the signalling and context switching going on with midi_in.
- The smarter version will probably cut that overhead to five percent or less.
-
- This is a binary-only release, sorry. There may be a source release later,
- I don't know.
-
- Anyway, enjoy the program if you have a use for it. I imagine that people
- who are trying to use the MIDI library will find this program quite useful.
-
- Regards,
-
- Karl Lehenbauer @ The Hacker's Haven
- 3918 Panorama, Missouri City, TX 77459
- (713) 438-4964
- Internet: karl@sugar.hackercorp.com
- Usenet: uunet!sugar!karl
-