From: turner@ssdt-tempe.sps.mot.com (Robert Turner)
Subject: Music maker on DN425, play.c
Reply-To: turner@ssdt-tempe.sps.mot.com (Robert Turner)
Organization: Semiconductor Systems Design Technology, Motorola, Tempe AZ
Distribution: na
Date: Wed, 8 Apr 1992 00:05:49 GMT
Originator: usenet@nddsun1

I was digging around in some old sources and found a program called
play.c.  The program is supposed to play "music" on a 425.  It was
so long ago this may even be a SR9.7 program, but I think I got it
after migrating to SR10+.


The source will not compile, and even if it did play.c calls for a
device "/dev/rhil".  We don't seem to have "rhil". Our manuals,  a
seemingly small subset of the total manual set, yeilds no information
relating to sound, music, device rhil, EFTSBP, or ioctl (beyond man
and sys/ioctl).  

I lost the email message from the person who sent me this, and no names
can be found.  

Anybody know anything?  I'm willing to send the source and the sample
data files to anyone interested in trying to get it to work.

Sample Compile 
-------------------------------------------------------------
   $ /bin/cc -o play play.c -lm
   
    (0216)        ioctl(r8042, EFTSBP, &voice);
   
   ******** Line 216 of "play.c": [Error #023]  "EFTSBP" has not been declared.
-------------------------------------------------------------


The following is from the README file:
-------------------------------------------------------------
   To play something, type:
   
   play < playfile  (e.g. play < chop.fant)
   
   
   The "playfile" has the basic format of (starting from the first line):
   
   <key sig>
   <quarter notes per minute>
   <line of music for voice 1>
   <line of music for voice 2 or blank line>
   <line of music for voice 3 or blank line>
   .
   .
   .
   
   The key signature is in the form "n#" or "nb" where n goes from 0 to 7.
   # of course means "sharp", b means "flat".
   
   Quarter note beats per minute is just that; it's in the form  n, where 
   n is almost any reasonable number.  Note that 10 milliseconds is the
   smallest duration available.
   
   Music lines come in groups of three (3 voices).  A blank line indicates
   termination of that group, the other voices are not played.  If all
   3 voices are played in a group, DO NOT leave a blank line (bug).
   
   A music line is of the form:  | measure | measure | measure | ...
   (blanks must be present around the |).
   
   A measure is just: note note note ...  (blanks must surround notes)
   
   A note is: <pitch>[modifier][octave][length][.][attenuation]
   
     Pitch is: A B C D E F G R
        R is a rest.  It only needs to be used between notes in a measure
        or between the beginning of the measure and the first note.
        The program doesn't play anything after the last note in a measure,
        but waits for all voices in the 3 measure group to complete.
   
     Modifier is: b (flat) n (natural) or # (sharp)
        Note that n doesn't currently work (has no effect); if the note
        would be sharped (or flatted) in the key, you must use b or # to
        modify it back to the natural state.  Double-sharp or double-flat 
        is accomplished by just using a sharp or flat on a note which
        would already be sharped or flatted in the current key.
     
     octave is: 0 1 2 3 4 5 6
        Middle C translates to C2.  Some choices (e.g. A0) will be out of
        range and create squawks.
        
     length is: t s e q h w l x d
        t = 32nd note
        s = 16th note
        e = 8th  note
        q, h, w = guess
        l = 12th note
        x = 6th  note
        d = 3rd  note
        
   
     . means to multiply the note value by 1.5               
...
-------------------------------------------------------------


Robert

-- 
Robert Turner (602) 897-5441 Semiconductor Systems Design Technology, Motorola
turner@ssdt-tempe.sps.mot.com   OR   ...!uunet!dover!turner
"Pictures?  I have oceans of the mountains."  -- Aunt Betty