Short:    V1.0 Plays MIDI Files via GMPlay & cli.datatype
Author:   dbusse@primus-online.de (Dirk Busse)
Uploader: dbusse@primus-online.de (Dirk Busse)
Type:     util/dtype
Requires: GMPlay and cli.datatype


Pre-History & Description:
   Did you ever wonder why IBrowse never plays Midi background sounds?
   You could setup a external viewer audio/midi
   with the command  $GMDIR/GMPlay
   and the arguments <>CON:100/80/500/120/GMPlay "%f" V=400 B=2 PRI=21
   If you load a Midi file via the URL, IBrowse plays it. But when you load
   a web page with a Midi background sound, IBrowse doesn't plays it.
   The reason is: IBrowse loads background sound only via datatypes.
   So my idee was to write a datatype which forwards the file to GMplay.
   My knowledges of programming datatypes and of programming in C are nearly
   zero. I didn't found an example datatype in assembler, but I found the
   cli.datatype.
   The first solution (starting directly GMPlay via cli.datatype) wasn't
   very well.
   The second solution (starting GMplay via a shell script via cli.datatype)
   was a little better. But it doen't works "clean".
   So I wrote a little assembler program "PlayMidi", which gives a little
   note to the caller (for example MultiView), breaks the actually GMPlay
   (you couldn't start GMPlay twice) and runs GMPlay with the new file.

Installation:
   - You need a successfully installed GMPlay.
     (Aminet:mus/midi/GMPlay13.lha)
   - You need a successfully installed cli.datatype.
     (AMinet:util/dtype/clidt_39_2.lha)
   - copy "c/PlayMidi" somewhere in your path (for example in c:)
   - copy "datatypes/MIDI" to devs:datatypes
   - create a env variable GMDIR with the path of GMPlay.
     for example with:
     setenv envarc:GMDIR "DH0:MIDI/GMPlay"
   - create a env variable PlayMidiGMopts with your options which you want
     to use for GMPlay.
     for example with:
  setenv envarc:PlayMidiGMopts ">CON:100/80/510/120/GMPlay V=400 B=2 PRI=21"
     (You could use there all GMPlay options. Now you could simple use
      PlayMidi instead of GMPlay for playing your Midi files.)
   - add to the file envarc:datatypes/cli.prefs the following line:

     MIDI     COMMAND=PlayMidi "%s"

   - That's all! Now IBrowse should play Midi background sounds!
     Now also every datatype viewer like MultiView should play midi files.


   (- Setting up IBrowse External Viewers for Midi support:
      Type:      audio/midi     and    audio/x-midi
      Mime:      midi mid kar
      Action:    Ext. viewer
      Viewer:    PlayMidi
      Arguments: "%f"                                       )



Example envarc-files and the source code of PlayMidi is also in the archive.


Author:
   Dirk Busse
   Kropsburgstraße 8
   D-67141 Neuhofen
   Germany
   <dbusse@primus-online.de>
   <100.141999@germanynet.de>


Questions&Answers:

   Q: Where are pages on the Internet with Midi background sounds?
   A: For example at:
      http://www.elaborate-bytes.com/deutsch/firma/index.htm
      and at:
      http://www.brenner-sievritts.com/hauptmenu.htm

   Q: IBrowse doesn't plays Midi-Files from the GMPlay archive as
      background sound.
   A: IBrowse plays only background sounds with the datatype class sound.
      The Midi-Files from the GMPlay archive are xpk-packed. Xpk isn't a
      sound datatype class.
      But this shouldn't be a problem. If you open the Midi file directly,
      IBrowse should play it. And as background sound you must not use
      packed Midi files. Because xpk isn't a standard in the Internet. It's
      only a standard on the Amiga.

   If you have some other questions or problems, you could send me a EMail
   or letter.


History:
   1.0 (07.May 1999)
       - First version.


============================= Archive contents =============================

Original  Packed Ratio    Date     Time    Name
-------- ------- ----- --------- --------  -------------
    3745    1622 56.6% 08-May-99 00:15:32  PlayMidi.readme
     112      84 25.0% 04-May-99 20:48:20 +MIDI
     467     278 40.4% 04-May-99 20:48:20 +MIDI.info
      25      25  0.0% 17-Apr-99 17:34:12 +GMDIR
      44      44  0.0% 07-May-99 20:49:50 +PlayMidiGMopts
    2201     791 64.0% 08-May-99 11:06:54 +PlayMidi.s
     608     284 53.2% 08-May-99 11:06:58 +PlayMidi
-------- ------- ----- --------- --------
    7202    3128 56.5% 14-May-99 21:51:00   7 files
