Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!amdahl!oliveb!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: losing MIDI bytes Message-ID: <27773@sun.uucp> Date: Fri, 11-Sep-87 13:24:12 EDT Article-I.D.: sun.27773 Posted: Fri Sep 11 13:24:12 1987 Date-Received: Sat, 12-Sep-87 19:27:47 EDT References: <8709110105.AA27649@cory.Berkeley.EDU> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 27 In article <8709110105.AA27649@cory.Berkeley.EDU> (Matt Dillon) writes: > Sure it will freeze the machine for a while... while your playing >your keyboard, but hey... now you have ~4uS accuracy (tight way loop on >serial data loop exit -> immediate read of hardware timers. The 4uS is >due to the fact that the serial data is asyncronous and can latch in >the middle of an instruction). It takes about 300uS per byte, I believe. Actually the above is entirely practical. You can use the hardware timer associated with the serial device to timestamp your 'events' down to a micro-second resolution, however the darn bytes take 320 uS to arrive and a full 'NOTE-ON' - 'NOTE-OFF' sequence is something like 10 bytes anyway so now your down to 3 milleseconds. I think that is may be a question of thinking your not fast enough when you really are, anyway I'm working on a Midi.device that will do all of the above and be 'easy' to use. I'll post it when it works enough to be usable. Note to the previous poster about problems with dropping bytes, the thing to do is after you read a byte from the serial port you check it again, because another byte may have arrived already. In my 'critical' applications I wait in the interrupt loop for 1/2 a character time before I return from the interrupt. That way streams of characters like system dumps will be caught correctly. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.