home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.lbl.gov
/
2014.05.ftp.ee.lbl.gov.tar
/
ftp.ee.lbl.gov
/
bmd-1.0beta.tar.Z
/
bmd-1.0beta.tar
/
bmd-1.0beta
/
README
< prev
Wrap
Text File
|
1991-08-27
|
5KB
|
129 lines
Tue Aug 20 14:53:47 PDT 1991
Berkeley MIDI Driver (BMD) 1.0beta
This directory contains the files necessary to install a midi driver in a
sun4c kernel. It has not been ported to other platforms, but I think it
should be possible to port to Sun 3's with a little bit of work.
I'm planning on porting it to 4.4BSD (as soon as it's running on sparcs),
and ultimately I hope to have it running as a 4.4BSD streams module.
This is a *1.0beta* release, so be prepared for changes in the interface.
Hopefully, we can establish a somewhat standardized interface for midi
under unix. I don't expect that this driver is anywhere close to being
an accepted standard, but it represents one approach. We'll probably have
to go through a few design iterations and many debates (arguments) before
we decide on an acceptable interface.
FILES
-----
README this file
bmd.4 the bmd man page
app/midifile Tim Thompson's midifile distribution along with mfplay,
a program that will output standard midifiles to bmd.
This version is slightly out of date. A version that
handles writing midifiles was posted to comp.sources.misc
not long ago.
app/midifile/mfdata/*
Some sample midifiles.
scripts/b50patch.csh
A script to patch a SunOS vmunix causing the unix baud rate
B50 to map to 31.25kb (the midi baud rate).
sun4c/* kernel source files
sundev/* kernel source files
app/mtools/* various tools and diagnostic programs, nothing fancy
(see app/mtools/README)
app/omtd a simple command-based sequencer; the code is not great
and it hass been abandoned in favor of a graphical
(InterViews based) sequencer currently under development.
CHANGES
-------
The driver has undergone considerable changes from the midi-alpha
pseudo-release. (I didn't mean for that code to become so widespread.)
Here is a summary:
- write side select works
- no more read timeouts -- select works just fine
- the interrupt handler is far more efficient (it runs in the
trap window)
- timestamp wraparound is dealt with
- each file has its own time base, so you can change the midiclock
without affecting other files
KERNEL INSTALLATION
-------------------
1. Copy the files in sundev to /sys/sundev.
2. Copy the files in sun4c to /sys/sun4c.
3. Copy sundev/*.h to /usr/include/sundev and sun4c/*.h to /usr/include/sun4c.
4. Add these lines to /sys/sun4c/conf/files:
sun4c/midiclock.c optional bmd
sun4c/bmdtrap.s optional bmd
sundev/dbx_bmd.c optional dbx bmd symbolic-info
sundev/bmd.c optional bmd
sundev/zs_midi.c optional zs bmd device-driver
bmd.c doesn't belong in sundev, but I don't see any better options.
I'm open to suggestions.
5. Add an entry for midi in cdevsw (in /sys/sun/conf.c).
You need these routines: bmdopen(),bmdclose(),bmdread(),
bmdwrite(),bmdioctl(),bmdselect().
6. Add some variant of the following lines to your kernel config file:
options "NBMDFILES=4","BMDCLOCKGRAN=1000"
pseudo-device bmd 2 init bmdattach
NBMDFILES is the max number of open files allowed (as opposed to
NBMD which is the number of interfaces). Don't make it too big.
(Note that the running /etc/config will generate the file bmd.h,
so if you run make before config, this file will not be found.)
BMDCLOCKGRAN is the granularity of the midi time stamps in microseconds.
1000us should be plenty adequate. Also, you can add the following line
to change the default baud from 31250, e.g.,
options "MIDIRATE=38400"
assuming you have a hardware baudrate converter.
7. Create the device files. E.g.:
% foreach i ( 0 1 2 3 )
> mknod /dev/midi$i c 106 $i
> chmod 666 /dev/midi$i
> end
(Remember that your major device number may differ from 106.)
8. Run config, do a make, and boot the new kernel.
PROGRAMMING NOTES
-----------------
1. The exit() system call blocks all signals before closing each open file.
This can be a problem for a midi file that has events scheduled far
into the future, causing the process to block uninterrupably in close.
Sometimes kill works; I haven't figured out the details of this behavior.
Anyway, the situation easily avoided by explicitly calling close on the
midi device file. In this case, signals won't be blocked and ctrl-c works
just fine.
2. BMD is for real-time midi event scheduling. Large sysex messages are not
handled by this driver. Patch editors, and the like, that need this
support should use the raw serial device (i.e. /dev/ttya). The serial
chip in the SparcStation can be prgrammed for 31.25kb using a simple
hack. We can patch a table in SunOS to turn a seldom used Unix baud
(say B50) into the MIDI baud rate. The script in scripts/b50patch.csh
will make the necessary change. See app/mtools/dx7dump.c for an example.
Good luck! I welcome all questions, suggestions, and constructive gripes.
Steven McCanne
mccanne@ee.lbl.gov