[Back to ANSI SWAG index]  [Back to Main SWAG index]  [Original]

{
JACK DYBCZAK
                               ANSI MUSIC

It's Really simple to create this music. Hopefully many more will start
using those codes inside online games etc.

Small examples:

 O3     Sets octave 3
 T120   Sets tempo to 120 (default)

You can use several statements on each line. Could it be more simple.
It's exactly the same command as the BASIC command called PLAY from
IBM BASIC or GW-BASIC and all those.

         MUSIC:

          Syntax: ESC[MF T120 O2C8D8E8F8G8 (All lines must end With ASCII 14)

          Music Strings in the BASIC Play format are supported.
          Multiple Strings per line may be entered.

          Music Strings should begin With the Characters "<esc>[M"
          where <esc> is a True ESC Character (DEC 27, Hex 1B).
          Please refer to your BASIC manual For information on the
          BASIC Play commands.  The following are all valid for
          beginning a Music String in SMILE: MF, MB, MN, ML, MS, M .
          Although MB (Music Background) is valid, True backgroud
          music is not supported.

          Music Strings should end With the musical note Character
          (DEC 14, Hex 0E, CTRL-N).  if this Character is missing,
          SMILE will look For the next ESC Character or the
          end-of-line marker to terminate the music String.  This
          option was added to try and catch as many incorrectly
          formated music Strings as possible.  However, for
          compatiblity With other viewers, I suggest you always end
          your music Strings With CTRL-N (DEC 14)

          Sound:
          ( Thanks to Julie Ibarra, author of ANSIPLAY For this idea )

          Syntax:
          ESC[MF Freq; Duration; Cycles; CycleDelay;Variation (DEC14)

          Custom Sounds are supported in SMILE by using a Sound CODE
          similar to that found in BASIC and the Program ANSIPLAY.
          However, the Sound generator in SMILE differs from the
          Sound command in BASIC.  Therefore, different frequency
          values must be used to produce the musical notes.  These
          are listed somewhere down the page.

          The Sound statement must begin and end in the same manner
          discussed above For a normal music String.  The Sound CODE
          consists of the following parameters serparated by a
          semicolon (;) :

          FREQ     : Frequency of note to be played.  The affective
                     range of frequencies is 0 to 7904.
                     (0..65535)

          DURATION : Time, in milliseconds, the note should be played.
                     (0..65535)

          CYCLES   : Number of times to Repeat Frequency/Duration.
                     (0..65535)

          Delay    : Time, in milliseconds, between cycles.
                     (0..65535)

          VarIATION: Frequency value is changed by this number for
                     each CYCLE the note is played.
                     (-65535..65535)

          (NOTE: 1 second = 1000 milliseconds)

          Press ESC to Exit a DURATION or Delay action.  You may
          have to press ESC a couple of times to completely Exit
          a Sound sequence.

          Sound CODE Musical Note Frequency Values (7 Octives):

            C    C#   D    D#   E    F    F#   G    G#   A    A#   B

            65   69   73   78   82   87   92   98  104  110  116  123
           131  139  147  156  165  175  185  196  208  220  233  247
           262  278  294  312  330  350  370  392  416  440  466  494
           524  556  588  624  660  700  740  784  832  880  932  988
          1048 1112 1176 1248 1320 1400 1480 1568 1664 1760 1864 1976
          2096 2224 2352 2496 2640 2800 2960 3136 3328 3520 3728 3952
          4192 4448 4704 4992 5280 5600 5920 6272 6656 7040 7456 7904

          One advantage of the Sound CODE is the ability to place a
          PAUSE in your ANSI screens Without having to use a
          multitude of ESC[s codes.  Just use a Sound CODE With the
          Delay set very high to get a pause.  For example,

          ESC[MF ;;;60000

          would pause your ANSI Screen For 60 seconds, or Until a key
          is pressed when viewing it With SMILE.  Remember, these
          Sound CODES are not supported by bulletin boards...(yet)!

[Back to ANSI SWAG index]  [Back to Main SWAG index]  [Original]