home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
ANSIPAS.ZIP
/
ANSIIO.DOC
next >
Wrap
Text File
|
1990-08-14
|
12KB
|
171 lines
+---------------------------------------------------------------------------+
| |
| ANSIIO.PAS Now supports |
| Version 2.00 ANSI Music! |
| |
| ANSI code Generation and Processing |
| Compatable with most PASCAL Compilers |
| |
| Written by: ANSIWrite adapted from |
| ANSISIM.PAS by |
| |
| Michael Booth William A. Blaylock |
| 797 East 5050 South 437 East 3250 North |
| South Ogden, UT 84403 North Ogden, UT 84414-1617 |
| (801)479-3553 (801)479-7618 |
| |
| |
| IF YOU MAKE CHANGES, IMPROVEMENTS, ENHANCEMENTS, ETC., PLEASE |
| MAKE THEM AVAILABLE TO ALL OF US. |
| |
| THIS PROGRAM IS IN THE PUBLIC DOMAIN. THE AUTHORS WILL NOT BE |
| HELD RESPONSIBLE FOR ANY DAMAGES WHICH MAY BE CAUSED BUY THIS |
| PROGRAM OR IT'S NOT FUNCTIONING AS YOU EXPECT IT TO. |
| |
| WARNING! - Because PASCAL's strings have a limit of 255 characters, |
| ANSI lines that exceed this limit will be truncated! |
| To fix this, the user must make use of CHARACTER BUFFERS |
| instead. This can be done with little difficulty. |
| However, for the sake of simplicity and versatility, I |
| have not made this modification. |
| |
+---------------------------------------------------------------------------+
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code for a Clear Screen. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIClrScr : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code for a Clear to End of Line. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIClrEol : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to move the cursor to (X,Y). ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIGotoXY(X, Y : word) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to move the cursor up "Lines" ***}
{*** number of lines. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIUp(Lines : word) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to move the cursor down "Lines" ***}
{*** number of lines. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIDown(Lines : word) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to move the cursor "Cols" ***}
{*** positions forward. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIRight(Cols : word) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to move the cursor "Cols" ***}
{*** positions backward. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSILeft(Cols : word) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns the ANSI code to change the screen color ***}
{*** to an "Fg" foreground and a "Bg" background. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIColor(Fg, Bg : integer) : string;
{****************************************************************************}
{*** ***}
{*** Function that returns an ANSI code representing a music string ("s") ***}
{*** ***}
{*** Usage is the same as BASIC's "PLAY" command. (Except you don't ***}
{*** need to begin the music string with an "MF" or an "MB" ***}
{*** ***}
{*** ***}
{*** A-G [#,+,-] A-G are notes. # or + following a note produces a ***}
{*** sharp; - produces a flat. ***}
{*** ***}
{*** Any note followed by a #, +, or - must refer to a ***}
{*** black key on a piano. ***}
{*** ***}
{*** L(n) Sets the length of each note. L4 is a quarter ***}
{*** note, L1 is a whole note, and so on. n may be ***}
{*** from 1 to 64. ***}
{*** ***}
{*** Length may also follow the note to change the ***}
{*** length for that note only. A16 is equivalent to ***}
{*** L16A. ***}
{*** ***}
{*** MN Music normal. Each note plays seven-eighths of ***}
{*** the time determined by L (length). ***}
{*** ***}
{*** ML Music legato. Each note plays the full period ***}
{*** set by L. ***}
{*** ***}
{*** MS Music staccato. Each note plays three-quarters ***}
{*** of the time determined by L. ***}
{*** ***}
{*** N(n) Play note n. n may range from 0 to 84. In the 7 ***}
{*** possible octaves, there are 84 notes. n set to 0 ***}
{*** indicates a rest. ***}
{*** ***}
{*** O(n) Octave 0 sets the current octave. There are 7 ***}
{*** octaves (0 through 6). Default is 4. Middle C ***}
{*** is at the beginning of octave 3. ***}
{*** ***}
{*** P(n) Pause. P may range from 1-64 ***}
{*** T(n) Tempo. T sets the number of L4s in a minute. n ***}
{*** may range from 32-255. Default is 120. ***}
{*** ***}
{*** .(period) A period after a note increases the playing time ***}
{*** of the note by 3/2 times the period determined by ***}
{*** L (length of the note) times T (tempo). Multiple ***}
{*** periods can appear after a note, and the playing ***}
{*** time is scaled accordingly. For example, A. will ***}
{*** cause the note A to play 1 1/2 times the playing ***}
{*** time determined by L times T; two periods after A ***}
{*** will cause the note to be played at 9/4 times its ***}
{*** ascribed value; an A with three periods at 27/8. ***}
{*** ***}
{*** >n A greater-than symbol preceding the note n plays ***}
{*** the note in the next higher octave. ***}
{*** ***}
{*** <n A less-than symbol preceding the note n plays the ***}
{*** note in the next lower octave. ***}
{*** ***}
{****************************************************************************}
FUNCTION ANSIMusic(s : string) : string;
{****************************************************************************}
{*** ***}
{*** Procedure to process string "s" and write its contents to the ***}
{*** screen, interpreting ANSI codes as it goes along. ***}
{*** ***}
{****************************************************************************}
PROCEDURE ANSIWrite(s : string);
{****************************************************************************}
{*** ***}
{*** Procedure that calls ANSIWrite, then line feeds. ***}
{*** ***}
{****************************************************************************}
PROCEDURE ANSIWriteLn(s : string);