    Although many music programs have been written for the HP-28, almost all
of them made you find the frequencies of the notes you wanted to play.  This
is a lot of work if you just want to play taps from a music book.  This
little program, however, makes music on the HP as easy as A sharp.  Just place
a list of the notes on the stack, run the COMPOSER, and you have a SELF-RUNNING
PROGRAM that plays the song!  No other programs needed!
    The program accepts lists of sheet music-like notes in the format of
 
        { note1 octave1 duration1 note2 octave2 duration2 ...
          noten octaven durationn }
 
    Note can be any standard musical note from A flat to G sharp.  The notes
are all in caps with a capital S denoting sharp and capital F denoting flat.
For example, A sharp would be shown as AS, B flat would be BF, G would be G,
and so on.  The program has a three and a half octave range from -1 to 2, 0
being middle C.  The octaves range from C to B.  The duration is set for a 1
to be a quarter-note.  Adjust accordingly.
    If you wanted to play a scale starting at middle C, it would go something
like this:
 
        { C 0 1 D 0 1 E 0 1 F 0 1 G 0 1 A 0 1 B 0 1 C 1 1 } COMPOSER
 
    Note that the last C rose an octave.  When you run COMPOSER, it takes
the list and turns it into an executable program which you can store in
memory to be played at any time.  To run the program, you need to enter the
first three programs in this file into your calculator.  The fourth file is
a song that I entered when I first wrote the program.  The song is CARRIE,
by Europe (which only happens to be the greatest band in the history of
rock and roll!).  Now that I've finally posted this, I want to see music
popping up all over this channel!  As always, send comments and corrections
to DESTILL@MTUS5.cts.mtu.edu.  Have fun!
 
*Note:  This program also works on the HP-48!
 
This file may be distributed freely as long as it is distributed in its
entirety.  If you wish to publish or modify parts of this file just e-mail
your request and it will probably be granted.  Written by David Still.
 
==============================================================================
 
  FREQ [AF94]
{ { 0 0 0 0 0 90 110 130
150 180 200 0 } { 260 275 290
305 320 340 360 380 400 430 450
480 0 } { 510 540 570 600 640
690 730 770 810 860 910 960 0
} { 1020 1070 1130 1190 1270
1340 1420 1510 1600 1690 1780
1870 1980 } }
 
  NOTES [3322]
{ { "'C'" "'CS'" "'D'"
"'DS'" "'E'" "'F'" "'FS'" "'G'"
"'GS'" "'A'" "'AS'" "'B'" "'P'"
} { "'C'" "'DF'" "'D'" "'EF'"
"'E'" "'F'" "'GF'" "'G'" "'AF'"
"'A'" "'BF'" "'B'" "'P'" } }
 
  COMPOSER [E9AA]
  << -> music
    << "<<" "STOP" { } 1 music
  SIZE
    FOR j music j 2 + GET .4 *
    SWAP + FREQ music j 1 +
    GET 2 + GET NOTES 1 GET
    music j GET ->STR POS IF
    DUP NOT THEN DROP NOTES 2
    GET music j GET ->STR POS
          END GET SWAP + 3
        STEP + ->STR 2 OVER
        SIZE 1 - SUB +
" 1 CF DO IFERR BEEP
THEN 1 SF END UNTIL 1
FS? END DROP >>" + STR->
      >>
    >>
 
  CAR.S [8396]
  { G 1 1 FS 1 1 D 1 1 B
  0 4 G 1 1 FS 1 1 B 0 1 D 1 1
  G 0 1 E 1 2 P 0 1 G 0 .66 D
  1 .66 E 1 .66 D 1 .66 E 1 .66
  D 1 .66 B 0 .66 E 1 1 A 0 1
  G 1 1 C 1 1 D 1 1 G 0 1 G 1
  1 D 1 1 E 1 1 G 0 1 G 1 1 E
  1 1 FS 1 .66 D 1 .66 A 0 .66
  FS 0 .66 A 0 .66 FS 0 .66 D
  1 1 D 1 1 C 1 1 C 1 1 B 0 1
  B 0 1 G 0 .66 E 0 .66 G 0 1
  D 1 1 D 1 1 C 1 1 C 1 1 B 0
  1 B 0 1 G 0 1 G 0 1 A 0 1 D
  1 .66 B 0 .66 G 0 1 G 1 2.5 }
 
/---------------------------------------------------------------------\
|             >>>>> BIG DEAL! <<<<<            | Why ask why?         |
| Now I have a signature file, too!            | Get smashed out of   |
| **** Dave Still ******* DESTILL@MTUS5 ****   | your mind instead.   |
| Life is like a dill pickle                   | Because some things  |
| ...........I hate dill pickles...            | never change.        |
\---------------------------------------------------------------------/
