        ANSI is an  acronym  for  "American National Standards Institute"          and actually has little to do with  this "ANSi Music" stuff.  However,          the American  National  Standards  Institute  defined  a  set of codes          for terminals to provide  a  standard  for  cursor  control.  This was          expanded to include graphics modes  and  color with the release of the          ANSI.Sys device driver.  It wasn't  actually ANSI who expanded the set          of  codes  to  include  the  graphics,   which  are  specific  to  IBM          compatible  computers  with certain video adapters,  but the name ANSI          stuck.  The original purpose of ANSI cursor control was to give  main-          frames a way to control the  cursor on various  terminals connected to          them.  The purpose  of  the  ANSI.Sys  driver  was  to give programs a          simple and  compatible way of controlling  the video screen.  However,          it seems that the only real use  for  ANSi  has been to give BBS's the          ability to control  the screen  colors  and  cursor positioning.  This          even led to a new  artform,  but  let's  not  even  think  about that.          It's too much like Art Deco.  In EGA color, no less.                                                                                                                 The ANSI.Sys driver also includes  provisions for redefining keys          on the keyboard.  This can be  used  for  character  translation or to          create simple macros.  It has even been  used  to create  "ANSi Bombs"          that can redefine  your keys to  destroy  data  (i.e.  your enter  key          becomes  "DEL *.* <Return> Y <Return>").  Watch  out for this  kind of          thing.  It's not hard to do.                                                                                                                                         Now I said  that the  actual  "ANSI"  organization had  little to          do with "ANSi Music."  The reason that the  music codes were given the          name "ANSI"  is because they  start  with  the  same escape sequences.          All ANSI codes start with <Esc>[  as  do the music codes.  What I mean          by <Esc>[ is the  escape  character  <Control-[>  (27 decimal, 1E hex)          and  the open-bracket character.  Now,  on to the REAL details of ANSi          music.                                                                                                                                                               As I stated above,  ANSi music  starts  with the characters <Esc>          <open-bracket>.  An  ANSi  music  sequence  ends  with  the  character          <Control-N> (14 decimal, 0E hex). In between, the commands are exactly          exactly the same as those used  for  the "PLAY" command in BASIC.  Now          you can just look up the  PLAY  command  and  you know most everything          you need to  know  about  ANSi  music.  But  for  those  of you  still          confused,  I'll summarize the  PLAY  commands  and give a few examples          and pointers.  Here we go:                                                                                                                                                                                                                           The PLAY commands are pretty simple. This info was taken from                   MS DOS 4.01 BASIC reference manual:                                                                                                                              A - G    Plays the notes corresponding  to the notes A-G on the musical                  scale. A # or + after the  note  makes it sharp, and a - makes                  it flat. A #, +, or - is not  allowed unless it corresponds to                  a black key on a piano.  For example, B# is an invalid note.                                                                                           Ln       Sets the duration of the notes that follow. n is a number from                  1 to 64.  1 is a whole note, 2 is a half note,  4 is a quarter                  note, 8 is an eighth note, etc.                                                                                                                                Ŀ                  Length   Equivalent                                                        ĳ                   L1      Whole note                                                           L2      Half note                                                            L3      One of a triplet of three half notes (1/3 measure)                   L4      Quarter note                                                         L5      One of a quintuplet (1/5 of a measure)                               L6      One of a quarter-note triplet                                         .                                                                           .                                                                           .                                                                          L64     Sixty-fourth note                                                                                                                                                  The length can also follow  the note  when you  want to change                  only the length  of the note.  For example,  A16 is equivalent                  to L16A.                                                                                                                                               On       Sets the current  octave.  There are  7 octaves,  0 through 6.                  The default octave is 4.  Each  octave  starts with C and ends                  with B. Octave 3 starts with middle C.                                                                                                                 Nn       Plays a note.  n is in the range 0 to 84.  Instead of specify-                  ing the note's letter  and octave,  you may specify the note's                  number.  Note zero is a rest.                                                                                                                          Pn       Plays  a rest  (if that's  the  right terminology).  n is  the                  same as for  the L command,  but specifies  the length  of the                  rest.                                                                                                                                                  .        Plays the note as a dotted note.  You music  experts know that                  means  that the  note  is one  half it's  length  longer  when                  dotted.  Place  the dot after  the note,  not before it.  More                  than one dot may be used after a note, and dots may be specif-                  ied for rests.                                                                                                                                         MF, MB   Music Foreground  and  Music  Background.  The MF option  will                  stop  the computer  in what is  executing and play the  note.                   While MB will cause the  sounds  to be  buffered so  execution                  does not stop and will continue to  play the notes at the same                  time.  The default for this option is MB, or Music Background.                                                                                         >n       Go up to the next  higher  octave  and play note n.  Each time                  note n is played, the octave  goes up, until it reaches octave                  six.  After  octave 6 has  been  reached,  it will  not go any                  higher.                                                                                                                                                <n       Go down  one octave  and  play  note n.  Each  time  note n is                  played, the octave goes down,  until  it  reaches octave zero.                  After octave 0 has been reached, it will not go any lower.                                                                                             MN       "Music Normal." Each note plays 7/8 of the duration set by the                  L command.                                                                                                                                             ML       "Music Legato."  Each note plays  the  full duration as set by                  the L command.                                                                                                                                         MS       "Music Staccato."  Each note plays 3/4 of the  duration set by                  the L command.                                                                                                                                         Tn       Tempo.  Sets the number of  quarter  notes in a minute.  n can                  range from 32 to 255.  The default is 120.                                                                                                                                                                                                    That's it for the basic set of commands.  There are other options          in BASIC that are unusable in  the  ANSi music,  such as the X command          which lets you  include a variable  name  in the  play command,  where          a string variable name  is  given  and  the string  contains a  series          of  play commands.  Another  command which  is usable only on  a Tandy          or other  computer  with  the TI sound chip (the  PCjr, for  instance)          is  the V command, for setting the volume  of the sound.  Now for some          examples.                                                                                                                                                     <Esc>[MCDEFGAB<Control-n> plays the notes  "CDEFGAB" (the entire octave)                                 on the default octave 4.                                                                                                               <Esc>[ML4AL2CL8E<Control-n> plays a quarter-note A,  a half note C,  and                                   an eighth-note E.  Not  too  musical,  but an                                   example nonetheless.                                                                                                                        I'm not one for giving too  many examples, I think  that's plenty          for you to get the basic idea.  Try it  in  BASIC before you try it as          an ANSI code in a  message/picture.  Just  type  PLAY "ABCDE" <Return>          and put whatever you like in  the  quotes.  That's  the easiest way to          work out the notes and get the  timing  right  before you upload it up          to your favorite Bulletin Board System.                                                                                                                             NOTE:  When creating an ANSi Music sequence, be sure to insert an           M after the  <Esc>[ and  use upper  case  letters  for the music,  as           some ANSi Music interpreters  will  not  recognize  the notes  unless           there is an M after  the open  bracket  and  the notes are upper case           (ie. QModem and ANSIALL.)                                                                                                                                                                                                                                                                                                  USING ANSi-MUSIC WITH WWIV                                                                                                                                                                            You  have  two  options.  Use  the  full-screen  editor known  as          FSED13 (the full-screen editor used  by most WWIV systems,  if not all          of them) or use the //UPLOAD command  at  the main menu to upload your          creations.  I prefer  the FSED  method,  since  it allows  for musical          macros  and other annoying  tricks  like  that.  To  use the  //UPLOAD          method,  you must first create your  message  with music and  all with          some off-line  text editor that lets  you put the escape  character in          a file by hitting <Esc>, <Alt-27> or <Control-[>.  (I recommend Q-Edit          for doing this.)                                                                                                                                                     You'll end up with something  that  looks  like an arrow pointing          to the beginning of the line if you  did i t right.  Then put an open-          bracket, the series of PLAY  commands,  and  the  <Control-n>.  You'll          notice that the <Control-n> character  is represented by two connected          musical notes.  Pretty  witty  of  the  designer.  Anyway,  place this          file in  your  upload  directory,  call  your  favorite  WWIV  system,          type //UPLOAD at the main menu,  and  upload the file you created like          you would  any other uploadable  file.  Your next  message  (posted or          e-mailed)  will  contain that text,  and the codes for the music.  Use          a protocol like Zmodem or Ymodem  for  your  //UPLOAD,  no need to use          ASCII.                                                                                                                                                               To use FSED13,  it's a  bit  easier.  The  backslash key will let          you enter  the  hex  value  of  any  character,  and  it'll  send that          character  in  the  message  without   interpreting  it  in  any  way.          Therefore, an escape can be created  by  typing \1b and a Control-N is          \0e.  That way you can without ever logging off the system, type:                                                                                                                       \1b[cdefgab\0e                                                                                                                          ...and it'll send the  notes  "cdefgab"  as  music.  Incidentally, you          don't actually see the \1b on the  screen,  but  if you hit backslash,          it should let you type  the  two  hex  digits without displaying them.          That's how you know if it's  working  properly.  And  that's all there          is to the FSED method.                                                                                                                                               On my comm program, the music codes are not hidden, and I have to          to manually add  normal  ANSI codes to  hide them.  The  ANSI code for          "invisible" is:                                                                                                                                                               <Esc>[8m    The "m" has to be lowercase.                                                                                                                        Using FSED, that can be entered as \1b[8m                                                                                                         The command for "Normal text" is <Esc>[0m (\1b[0m for you FSED users.)                                                                                               So, using FSED, you would probably do something like this:                                                                                                                      \1b[8m\1b[cdefgab\0e\1b[0m                                                                                                                 If you don't  use the ANSi hide  and  unhide commands,  you will see a          bunch of your notes on the screen, which looks mighty ugly.                                                                                                                    --+++****(( Closing Comments ))****+++--                                                                                                              I only know of two  major comm programs  that support ANSi music:          TeleMate  and  Qmodem.  I  personally  prefer  TeleMate.  If  we  (the          collective we,  that is) spread the  use of ANSi music,  hopefully the          makers of other comm programs will  incorporate  this feature.  If the          makers of Telix and Procomm included this, that would cover 75% of IBM          compatible BBS'ers.                                                                                                                                                  If I was inaccurate, unclear, or otherwise confusing or wrong, or          if you simply  have comments,  we  can be  reached  through your local          CelerityNet board by  posting a  message in  the ACiD-Net #31.  If you          can't possibly reach us by CelerityNet  and it is really urgent to get          us a message, ACiD Production's P.O. Box is:                                                                                                                                                                                                                            c/o  ACiD Productions                                                           1023 So. Adams St #84                                                           Olympia,  WA    98501                                                                                                                                                                                                  This file, and the contents herein were written, compiled and edited by         Rad Man and Genesis.  This file  is  Copyright (c) ACiD Productions and         may not be reproduced in whole  or  in part without the Express Written         Consent  of  ACiD  Productions.   However,  this  file  may  be  freely         distributed in it's original form without any modifications whatsoever.                                                                                       