[comp.music] setting serial port's baud rate for midi

hmloo@trillium.uwaterloo.ca () (12/03/90)

According to midi specifications, the baud rate the serial port should be
set to is 31.25kbaud.  How is this accomplished on the Mac?  Using the serial
driver there are predefined ones which include 1200, 2400, 9600, 52700, but
nothing near 31250.  Using the advance calls and the control function from
the device driver you can specify any integer baud rate and it should set it
to the closest possible value.  However, the control function doesn't seem
to be setting the right baud rate all.  My question is, does anyone have any
good solution to this? Hopefully a fix or pointing out what I'm going wrong.
Also is there a function that returns the value the serial port is currently
set at? Here's how the code looks like:  (it's in Think pascal, this is not an
exact buffer)   

	{ port is all initiated and set, just a matter to setting the baud
	  rate to 31250, baudrate and i are both integers}

	baudrate := 31250;
	i:= control(-6, 13, pointer(ord(@baudrate)+1));
	i:= control(-7, 13, pointer(ord(@baudrate)+1));
	writeln(i, baudrate);
	
	{ the output is no error an baudrate of 31250, but the port still
	  isn't set to 31250}

hmloo@trillium.waterloo.edu

steve@Advansoft.COM (Steve Savitzky) (12/04/90)

In article <1990Dec3.034829.11333@watdragon.waterloo.edu> hmloo@trillium.uwaterloo.ca writes:

   According to midi specifications, the baud rate the serial port should be
   set to is 31.25kbaud.  How is this accomplished on the Mac? 

All of the Mac MIDI interfaces that I know about supply the exact baud
rate via the external clock input, which is available on the mini-DIN
connector.  (My reference material is elsewhere, so I can't tell you
which pin this is.)
--
\ --Steve Savitzky--  \ ADVANsoft Research Corp \ REAL hackers use an AXE! \
 \ steve@advansoft.COM \ 4301 Great America Pkwy \ #include<disclaimer.h>   \
  \ arc!steve@apple.COM \ Santa Clara, CA 95954   \        408-727-3357      \
   \__ steve@arc.UUCP _________________________________________________________

nick@cs.edinburgh.ac.uk (Nick Rothwell) (12/04/90)

Standard Suggestion Follows: you should use the MIDI Manager for MIDI.

-- 
Nick Rothwell,  Laboratory for Foundations of Computer Science, Edinburgh.
                nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcsun!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
 "You ain't seen nothing yet. I can take this floor out too, no trouble."

kevin@cbmvax.commodore.com (Kevin Klop) (12/05/90)

In article <2931@skye.cs.ed.ac.uk> nick@lfcs.ed.ac.uk writes:
>Standard Suggestion Follows: you should use the MIDI Manager for MIDI.
>
>-- 
>Nick Rothwell,  Laboratory for Foundations of Computer Science, Edinburgh.
>                nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcsun!ukc!lfcs!nick
>~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
> "You ain't seen nothing yet. I can take this floor out too, no trouble."

To expand on this...

Basic is just not fast enough to process the data at MIDI speeds.  You will
have to use some external library/driver/software to drive the serial port
at that speed.

			-- Kevin --