home *** CD-ROM | disk | FTP | other *** search
-
-
- MSTRINGS.DOC - Copyright 1991-1992, J. Ibarra
-
- This documentation file gives specific information regarding
- Music strings syntax, Music codes and Sound Codes which
- are compatible with ANSIPLAY.
-
- This file does not contain information on how to edit your
- ANSI file to insert these codes. That information is found
- in the MANUALS.DOC file which is included with the ANSIPLAY
- program.
-
- The text below is broken into the following categories:
-
- 1. Music string syntax
- 2. Music string contents (and definition)
- 3. Using Music Codes (how they are interpreted)
- 4. Using Sound Codes (how they are interpreted)
- 5. Variation in Music String formats
-
-
- 1. MUSIC STRING SYNTAX
- -----------------------
- Once your ANSI file has been created, all that's left to do to
- make it musical is add a few extra escape command sequences, for
- example, a music code of...
-
- ESC[MF O2 CDEC CDEC EFG.... EFG....(music note)
-
- would play the introduction to the song "Frere Jacques".
-
- Below is a breakdown of how the music strings are to be used.
- By using your own text editor, you can insert these codes into
- any desired location in your ANSI file, then play it back using
- ANSIPLAY.EXE.
-
-
- 2. MUSIC STRING CONTENTS
- -------------------------
- The word "string" simply means a set of characters (including
- spaces and ascii characters) strung together.
-
- There are 3 sections to a Music string, broken down as follows:
-
- ESC[MF CDEC CDEC EFG (music note)
- ------ ------------- ------------
- 1 2 3
- All music strings must be prefixed with ESC+"["+"MF" (or "MB") in
- upper-case text, and final character must be a (music note).
-
- 1. Music strings are prefixed with the ESCape character followed
- by a [ character (just like ansi escape control sequences),
- and then followed by MF (for Music/Sound to be played in
- Foreground) or MB (for Music to be played in Background).
-
- *Or for a shortcut you may use ESC[M which will
- be treated as ESC[MF.
-
- *** Note that the ESC above actually resembles the ESCAPE
- character (Decimal CHR$(27)) and not the actual letters
- E S C.
- * Page 1 *
-
-
- 2. The middle part of the string can be 1 of 2 types of
- commands...
-
-
- Music Codes
- -----------
- a) the actual <notes, octaves, etc> specification
- (for musical tunes).
-
- Spaces and carraige returns (CR-LF) are ignored.
- This portion of the music string can be of any
- size length.
- -or-
- Sound Codes
- -----------
- b) a <tone frequency; duration; cycles; delay; vari>
- specification (for other sound tones and
- repeated cycles of sound tones).
-
- Parameters must be separated by semi-colons.
-
- Details on these codes and command syntax are referenced in
- the file MUSICODE.REF.
-
- 3. The final(music note) (Decimal CHR$(14)) is a must.
- This tells ANSIPLAY where the music string ends. The
- (music note) character can be entered on most text editing
- programs by holding down the [ALT] key, then typing the
- number 14...similarly to entering the ESC character.
-
-
- -------------------------------
- 3. USING MUSIC CODES
- -------------------------------
-
- ESC[MF <music notes and commands)> (music note)
- (MB may be used in place of MF)
-
- Example: ESC[MF CDEC CDEC EFG (music note)
-
- MF will play the music in the foreground, or in other words will
- stop displaying temporarily until the music string is played
- completely.
-
- MB will place the music string into a buffer, allowing the
- program to execute while the music string is playing in the
- background.
-
- The number of notes that can be played in the background at
- one time varies according to the particular machine. Maximum
- number of notes that can be played in the background at one
- time is 32.
-
- When there are more notes to be played than the buffer will hold,
- the display will temporarily pause until the remainder of the
- music string is processed.
-
-
-
- * Page 2 *
-
-
- More than 1 MB statement in the music string will cause the
- music to be played sequentially (NOT simultaneously.) In other
- words, you cannot play 2 or 3 strings of music simultaneously.
- If a carraige return (CR-LF) is needed within the music string,
- ANSIPLAY will ignore it and just continue playing. This feature
- was developed so that user's could use L-O-N-G strings of music
- without interruption.
-
- A breakdown of MUSIC CODES available are listed in the file
- MUSICODE.REF. You may also consult your DOS user's manual under
- the section on BASIC's "PLAY" statement.
-
-
- ----------------------------------------------------
- 4. USING SOUND CODES (IN PLACE OF MUSIC CODES)
- ----------------------------------------------------
-
- In place of music codes, you may use numeric values for FREQENCY,
- DURATION, CYCLES, DELAY and VARIATION to create sounds that are
- not available with musical code syntax. Another way to use them
- is to place them next to music strings that contain music codes
- to add glissando, rythmatic sounds, tapping, beeping, or whatever
- sounds you'de like to create. A music string containing SOUND
- CODES would look like this:
-
- ESC[MF <FREQ; DURA; CYCLES; DELAY; VARI; SPKOFF> (music note)
-
- Example: ESC[MF 100;5;5;10;-5 (music note)
-
- The <> brackets are not to be typed. They are only there for
- display purposes to you can see where the <SOUND CODES> are to be
- placed.
-
- Since SOUND CODES are processed differently from MUSIC CODES,
- SOUND will always be played in foreground regardless of "MF"
- or "MB" specification.
-
- SOUND CODE Parameters must be separated by semicolons.
-
- Minimum/Maximum values and descriptions are as follows:
-
- FREQUENCY : a numeric value from 37 to 32,767
- Frequency is the desired frequency in hertz.
- This allows more control over the pitch of the
- tone than what is available with music codes.
-
- DURATION : an numberic value from 0 to 65,535
- Duration is how long the tone should play, measured
- in clock ticks. There are 18.2 clock ticks per second
- regardless of CPU speed.
-
- CYCLES (optional) : an integer from 0 to 9,999
- Cycles is the number of times to repeat the
- frequency/duration.
-
- DELAY (optional) : an integer from 0 to 999,999,999
- Delay is the length of pause between cycles.
- ANSIPLAY will count from 0 to DELAY before proceeding.
-
- * Page 3 *
-
-
- The DELAY time lapse will vary among computer systems.
- (My XT NEC V20 averages 723 counts per second)
-
- If the [ENTER] key is hit during execution of a DELAY,
- the delay will be ended.
-
- VARIATION (optional): an numeric value from -9,999 to 9,999
- Variation will change the FREQUENCY each time the tone
- is repeated using the CYCLES variable. FREQUENCY will
- use it's current value, add the VARIATION value to
- itself (per cycle) to get a new FREQUENCY, then play
- the new FREQUENCY.
-
- A negative value used for VARIATION will make the
- FREQUENCY decrease; a positive value will make the
- FREQUENCY increase. If the new FREQUENCY is too low
- or too high, exceeding its playable limits (minimum of
- 37 to maximum 32,767) then the VARIATION value will be
- changed to reverse itself (from positive to negative,
- or from negative to positive).
-
- A "*" wildcard may be used in place of a value, which
- will make the play function select a value at random
- between -999 and 999.
-
-
- SPKOFF (optional): an integer of 1 or 0 (SpeakerOff)
- If SPKOFF = 1, then speaker will turn off for 1 clock
- tick between CYCLES. This produces a broken sound
- effect.
-
- If SPKOFF = 0 (default), then speaker remains on between
- CYCLES. This produces a smooth glissando effect.
-
-
- Any non-integer numbers used for CYCLES or DELAY will be
- converted to integers automatically.
-
- SOUND CODES are interpreted and executed as they are read,
- therefore requiring them to be played in the foreground.
-
- The interpretation process is basically structured like this:
-
- :START_OF_CYCLE
- Play Frequency/Duration
- Add DELAY if applicable
- Change Frequency if VARIATION is used
- Go to :START_OF_CYCLE (Loop for number of CYCLES specified)
-
- If you have ANSIPLAY, you can see some examples of how MUSIC
- CODES and SOUND CODES may be used by ANSIPLAY'ing the .ANS files
- included with the program package.
-
-
- 5. VARIATION IN MUSIC STRING FORMATS
- -------------------------------------
- Although there are several ANSI viewers on the market which
-
-
- * Page 4 *
-
-
- support music, there is currently no "standard" as to the format
- used with the music strings.
-
- Some viewers will not support music strings of a length longer
- than 71 characters. Some viewers use a Prefix with ESC[M while
- others use ESC[MF or ESC[MB. Some viewers will support music,
- but only if it's the final text of the file, not if it's
- integrated into the file.
-
- Many viewers will not support one continuous music string thus
- requiring the string to be broken into segments. This may cause
- the music to sound choppy when it's played.
-
- ANSIPLAY will support all of the above formats, along with
- unlimited music string length and sound codes. Though if you
- wish to use another viewer, you will need to consult the
- documentation included with the program regarding the required
- format for that program. Sound codes, however, will most likely
- not be supported as they are a new concept just released by the
- author of ANSIPLAY. Hopefully, they will soon be supported by
- other ANSI viewers as well.
-
-
- --end of documentation---
-
- * Page 5 *
-