Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ll-xn!adelie!mirror!rayssd!unisec!mark From: mark@unisec.UUCP Newsgroups: comp.sys.amiga Subject: HNeed help with MIDI program Message-ID: <432@unisec.USI.COM> Date: Tue, 3-Mar-87 13:44:38 EST Article-I.D.: unisec.432 Posted: Tue Mar 3 13:44:38 1987 Date-Received: Fri, 6-Mar-87 05:18:18 EST Distribution: comp Organization: UniSecure Systems, Inc. Newport, R.I. Lines: 57 Keywords: MIDI interrupt handler timer serial dammit! Hello, fellow Amigans. This message is coming to you from just the other side of insanity. I was pushed there by a public domain program that doesn't work, inadequate documentation and just plain not knowing what the hell is going on! Let me explain. I recently purchased a Casio CZ-1 synthesizer and after about 3 weeks of waiting, my Golden Hawk MIDI interface box finally arrived. The only software I currently own is Music Studio which, though it provides some MIDI capability, is grossly inadequate for my needs (I'd like to hear about your favorite MIDI-capable music program). Anywho, there is a crude public domain program, written in Lattice C (3.03) which allows you to upload and download patch libraries and to record/play back keyboard input. I have Aztec C, version 3.20a, and probably will have for a while to come, considering how slow MANX is at getting around to updating lower-than- whale-turd developer system licencees such as myself. Though I have gotten most of the program ported to Aztec C by adding the functions.h include, casting to longs where appropriate, etc., I have been driven to distraction in my attempts to get the record/playback stuff to work. The program was designed to use timer A with a countdown interrupt at every 1/11 second. An interrupt handler, written in C is added via AddICRVector (I think that's the correct name - don't have source in front of me) for which I have no documentation. I DO have a set of Amiga developers manuals for which I paid my $100.00, which make NO MENTION of this routine. Though I can surmise what it does, I sure would like more specific information. Reading through the errata sheets for the hardware manual, I found a description of the 4 timers which indicated that timer A is also used by the serial device handler. When? The program uses BeginIO, IOQuick and WaitIO. The interrupt handler does nothing more than count microseconds and seconds, with microseconds being updated at 90909 per hit. When micros reaches 999999, seconds is incremented. The record loop adds to these values the time elapsed since the last interrupt by directly reading the CIAA timer registers. I added an interrupt counter to the interrupt handler and some debug stuff to see if interrupts ever occur. Once in a great while I'll get a 'hit'. I've done things like #asm move.l d1,a4 #endasm at the beginning of the interrupt handler, written the handler entirely in asm, etc. to no avail. Could someone explain to me the significance of setting a4 if the handler only references global data? I can see no reason to do this in such a simple routine which does not utilize a4 in any of its addressing. If someone has already dealt with this or a similar problem, PLEASE tell me what you did. If someone is willing to examine what I have so far, let me know and I'll mail you a copy. If someone has an example of timer / interrupt stuff that works with Aztec 3.20a, again - would you share it with me? Thanks. p.s. I modified the program to use CurrentTime and SubTime (to get the actual delta time) and though it works somewhat, the timing is too sloppy to be useful. -- | Mark R. Rinfret, SofTech, Inc. mark@unisec.usi.com | | Guest of UniSecure Systems, Inc., Newport, RI | | UUCP: {gatech|mirror|cbosgd|uiucdcs|ihnp4}!rayssd!unisec!mark | | work: (401)-849-4174 home: (401)-846-7639 |