Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!cbmvax!andy From: andy@cbmvax.UUCP Newsgroups: comp.sys.amiga Subject: Re: Message-ID: <2282@cbmvax.UUCP> Date: Tue, 1-Sep-87 10:13:35 EDT Article-I.D.: cbmvax.2282 Posted: Tue Sep 1 10:13:35 1987 Date-Received: Thu, 3-Sep-87 00:47:37 EDT References: <3826@well.UUCP> <586@sugar.UUCP> Reply-To: andy@cbmvax.UUCP (Andy Finkel) Distribution: na Organization: Commodore Technology, West Chester, PA Lines: 149 Keywords: MIDI In article <586@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >As the originator of the latest MIDI thread, I'd like to say one thing... >You also need accurate timing. I have been informed that the Amiga does >not produce accurate enough timing for professional musicians. I am still >trying to determine if this is because: > > a) You can still lose timing despite following the rules in > the RKM/Libraries. > > b) The authors of SoundScape, etc, don't follow the rules. > > c) Something else. All that is needed is a midi.device version of the serial.device that timestamps the midi events, so that, even if you have to go away for awhile (because another task would like a bit of time) you can tell exactly when the event happened. (occasionally you find musicians complaining about the time intervals that a given program lets them use, but that's another story entirely. In that case, you just have to point out that program X is placing the limit on them, not the Amiga. No matter what the seller of program X says :-) ) >I'd also like to make a wish. Attention Commodore-Amiga: > > In 1.3, could you please add a mode to timer.device > whereby I get periodic signals, and can take the rather > complex procedure described in the RKM for keeping time > events synched down the toilet? Timer.device use is *not* complicated. In fact, its no more complicated that if I added a mode for repeated events. But I'd heard this complaint enough so here's a simple example of using the timer.device to get a tick every 300 microseconds or so. Its pretty short... (Example compiled under Greenhills; your compiler may vary a little) ---------------------- CUT HERE ------------------------------------ #include "exec/types.h" #include "intuition/intuition.h" struct IntuitionBase *IntuitionBase=NULL; struct GfxBase *GfxBase=NULL; struct NewWindow nw = { 100, 10, 300,40, -1, -1, CLOSEWINDOW, SMART_REFRESH | NOCAREREFRESH | WINDOWCLOSE, NULL, NULL, "Timer Example", NULL, NULL, 10, 10, ~0, ~0, WBENCHSCREEN}; struct Window *window=NULL; struct MsgPort *timerport=NULL; struct IOStdReq *timermsg=NULL; ULONG timerbit=NULL; UBYTE buffer[80]; struct IntuiText text = {0,1,JAM2,0,0,NULL,buffer,NULL}; SetTimer(sec, micro, timermsg) ULONG sec, micro; struct IOStdReq *timermsg; /* This routine simply sets the timer to interrupt us after secs.micros */ { timermsg->io_Command = TR_ADDREQUEST; /* add a new timer request */ timermsg->io_Actual = sec; /* seconds */ timermsg->io_Length = micro; /* microseconds */ SendIO(timermsg); /* post a request to the timer */ } main() { ULONG wakeupbits, windowbit; struct IntuiMessage *message; ULONG class; USHORT code; int i; if(!(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0) ))cleanup(20); if ((window = (struct Window *)OpenWindow(&nw)) == NULL) cleanup(20); if(!(timerport = (struct MsgPort *)CreatePort(0, 0)))cleanup(20); if(!(timermsg = (struct IOStdReq *)CreateStdIO(timerport)))cleanup(20); if (OpenDevice(TIMERNAME, UNIT_VBLANK, timermsg, 0))cleanup(20); timerbit = 1 << timerport->mp_SigBit; windowbit = 1 << window->UserPort->mp_SigBit; SetTimer(0, 300, timermsg); /* set for first message */ while (TRUE) { wakeupbits = Wait(timerbit | windowbit); if (wakeupbits & timerbit) { GetMsg(timerport); /* this does nothing more than "clear" */ SetTimer(0, 300, timermsg); sprintf(buffer,"timer tick %8ld received\0",i++); PrintIText(window->RPort,&text,10,25); } if (wakeupbits & windowbit) { message = (struct IntuiMessage *)GetMsg(window->UserPort); class = message->Class; code = message->Code; ReplyMsg(message); switch (class) { case CLOSEWINDOW: cleanup(0); break; } } } } cleanup(err) int err; { if (window) CloseWindow(window); if (timerport) { Wait(timerbit); GetMsg(timerport); CloseDevice(timermsg); DeleteStdIO(timermsg); DeletePort(timerport); } OpenWorkBench(); if(IntuitionBase)CloseLibrary(IntuitionBase); exit(err); } ------------------- CUT HERE ------------------------------- -- andy finkel {ihnp4|seismo|allegra}!cbmvax!andy Commodore-Amiga, Inc. "Interfere? Of course we'll interfere. Always do what you're best at, I always say." Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors.