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   
Text File  |  1991-08-27  |  5KB  |  129 lines

  1. Tue Aug 20 14:53:47 PDT 1991
  2.  
  3. Berkeley MIDI Driver (BMD) 1.0beta
  4.  
  5. This directory contains the files necessary to install a midi driver in a 
  6. sun4c kernel.  It has not been ported to other platforms, but I think it
  7. should be possible to port to Sun 3's with a little bit of work.  
  8. I'm planning on porting it to 4.4BSD (as soon as it's running on sparcs),
  9. and ultimately I hope to have it running as a 4.4BSD streams module.
  10.  
  11. This is a *1.0beta* release, so be prepared for changes in the interface.
  12. Hopefully, we can establish a somewhat standardized interface for midi
  13. under unix.  I don't expect that this driver is anywhere close to being 
  14. an accepted standard, but it represents one approach.  We'll probably have 
  15. to go through a few design iterations and many debates (arguments) before
  16. we decide on an acceptable interface.
  17.  
  18. FILES
  19. -----
  20. README        this file
  21. bmd.4        the bmd man page
  22. app/midifile    Tim Thompson's midifile distribution along with mfplay,
  23.         a program that will output standard midifiles to bmd.
  24.         This version is slightly out of date.  A version that
  25.         handles writing midifiles was posted to comp.sources.misc
  26.         not long ago.
  27. app/midifile/mfdata/*
  28.         Some sample midifiles.
  29. scripts/b50patch.csh
  30.         A script to patch a SunOS vmunix causing the unix baud rate
  31.         B50 to map to 31.25kb (the midi baud rate).
  32. sun4c/*        kernel source files
  33. sundev/*    kernel source files
  34. app/mtools/*    various tools and diagnostic programs, nothing fancy
  35.         (see app/mtools/README)
  36. app/omtd    a simple command-based sequencer; the code is not great
  37.         and it hass been abandoned in favor of a graphical
  38.         (InterViews based) sequencer currently under development.
  39.  
  40. CHANGES
  41. -------
  42. The driver has undergone considerable changes from the midi-alpha
  43. pseudo-release.  (I didn't mean for that code to become so widespread.)
  44. Here is a summary:
  45.  
  46.     - write side select works
  47.     - no more read timeouts -- select works just fine
  48.     - the interrupt handler is far more efficient (it runs in the 
  49.       trap window)
  50.     - timestamp wraparound is dealt with
  51.     - each file has its own time base, so you can change the midiclock
  52.       without affecting other files
  53.  
  54.  
  55. KERNEL INSTALLATION
  56. -------------------
  57.  
  58. 1. Copy the files in sundev to /sys/sundev.
  59.  
  60. 2. Copy the files in sun4c to /sys/sun4c.
  61.  
  62. 3. Copy sundev/*.h to /usr/include/sundev and sun4c/*.h to /usr/include/sun4c.
  63.  
  64. 4. Add these lines to /sys/sun4c/conf/files:
  65.  
  66.     sun4c/midiclock.c    optional bmd
  67.     sun4c/bmdtrap.s        optional bmd
  68.     sundev/dbx_bmd.c    optional dbx bmd symbolic-info
  69.     sundev/bmd.c        optional bmd
  70.     sundev/zs_midi.c    optional zs bmd device-driver
  71.  
  72.    bmd.c doesn't belong in sundev, but I don't see any better options.
  73.    I'm open to suggestions.
  74.  
  75. 5. Add an entry for midi in cdevsw (in /sys/sun/conf.c).
  76.    You need these routines: bmdopen(),bmdclose(),bmdread(),
  77.    bmdwrite(),bmdioctl(),bmdselect().
  78.  
  79. 6. Add some variant of the following lines to your kernel config file:
  80.  
  81.     options "NBMDFILES=4","BMDCLOCKGRAN=1000"
  82.     pseudo-device bmd 2 init bmdattach
  83.  
  84.    NBMDFILES is the max number of open files allowed (as opposed to 
  85.    NBMD which is the number of interfaces).  Don't make it too big.
  86.    (Note that the running /etc/config will generate the file bmd.h, 
  87.    so if you run make before config, this file will not be found.)
  88.    BMDCLOCKGRAN is the granularity of the midi time stamps in microseconds.
  89.    1000us should be plenty adequate.  Also, you can add the following line 
  90.    to change the default baud from 31250, e.g.,
  91.     options "MIDIRATE=38400"
  92.    assuming you have a hardware baudrate converter.
  93.  
  94. 7. Create the device files.  E.g.:
  95.     % foreach i ( 0 1 2 3 )
  96.     > mknod /dev/midi$i c 106 $i
  97.     > chmod 666 /dev/midi$i
  98.     > end
  99.    (Remember that your major device number may differ from 106.)
  100.  
  101. 8. Run config, do a make, and boot the new kernel.
  102.  
  103.  
  104. PROGRAMMING NOTES
  105. -----------------
  106.  
  107. 1. The exit() system call blocks all signals before closing each open file.
  108.    This can be a problem for a midi file that has events scheduled far
  109.    into the future, causing the process to block uninterrupably in close.
  110.    Sometimes kill works; I haven't figured out the details of this behavior.
  111.    Anyway, the situation easily avoided by explicitly calling close on the 
  112.    midi device file.  In this case, signals won't be blocked and ctrl-c works 
  113.    just fine.
  114.  
  115. 2. BMD is for real-time midi event scheduling.  Large sysex messages are not
  116.    handled by this driver.  Patch editors, and the like, that need this
  117.    support should use the raw serial device (i.e. /dev/ttya).  The serial
  118.    chip in the SparcStation can be prgrammed for 31.25kb using a simple
  119.    hack.  We can patch a table in SunOS to turn a seldom used Unix baud
  120.    (say B50) into the MIDI baud rate.  The script in scripts/b50patch.csh 
  121.    will make the necessary change.  See app/mtools/dx7dump.c for an example.
  122.  
  123.  
  124. Good luck!  I welcome all questions, suggestions, and constructive gripes.
  125.  
  126. Steven McCanne
  127. mccanne@ee.lbl.gov
  128.  
  129.