🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5926

Help! (serial dev & Exec)

#5926
From: D.N.Snowdon (U.G.PCC)
Date: Wed, 17 Oct 1990 09:58
40 lines
2328 bytes
Flame retardant: Sorry, if this has been covered before but I'm
new to this group, multitasking on the Amiga & am desparate.

The problem:
  I'm writing a sequencer for the Amiga. I need to be able
to get MIDI input (via the serial device)  as fast as possible and
as near to the time it arrived at the serial port as possible (so
I get note on/off time right etc). I also need to be able to write
to the serial port (for playback) with good accuracy and at high
speed.
  Because I need to be able to time each MIDI event I cannot
ask for more than 2 bytes at a time (smallest MIDI event)
though if there is more data in the serial buffer when I get
round to reading it I can get it all at once.

What I am planning to do is:

Main process (handles user interface etc)
- opens serial device (as tasks can't do this)
- allocates memory where all MIDI data will wind up
- creates a task which reads serial port and after some low level
  processing shoves it in the shared memory & uses timer device
  to get itself woken up at particular intervals.
- task & process communicate via shared variables (only the process
will change these variables & the process will not be writing to the shared data area during recording when the task will need to write 
to it)

What I want to know is:
1 - Am I on the right track & is this feasible - ie can tasks use
the serial device if it is opened for them?
2 - Is there a better way
3 - Whats the fastest way to legally hit the serial port
4 - Does my task have to repeatedly ask for timer events? - is
there any way to set the timer device to keep sending me signals
at specified (few ms) intervals. Reason I ask is that speed is 
critical and I don't (if possible) want to keep having to send
requests to the timer device.

  Sorry, for the length of this - but I would really appreciate
any help.
Technical Details
Message-ID: <1807@m1.cs.man.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!rutgers!apple!usc!cs.utexas.edu!uunet!mcsun!ukc!mucs!r2.cs.man.ac.uk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!rutgers!apple!usc!cs.utexas.edu!uunet!mcsun!ukc!mucs!r2.cs.man.ac.uk
From: snowdond@r2.cs.man.ac.uk (D.N.Snowdon (U.G.PCC))
Newsgroups: comp.sys.amiga.tech
Subject: Help! (serial dev & Exec)
Keywords: MIDI serial device Exec
Message-ID: <1807@m1.cs.man.ac.uk>
Date: 17 Oct 90 09:58:36 GMT
Sender: news@cs.man.ac.uk
Organization: Department of Computer Science, University of Manchester UK
Lines: 40