ANSI music

from Wikipedia, the free encyclopedia
ANSI music
File extension : .ans, .ams, .mus
MIME type : text / x-ansi
Type: Text file
Contained in: ANSI-BBS , ANSI-Art
Standard (s) : ANSI escape sequence (not part of the specifications ANSI X3.64, ECMA -48, ISO / IEC 6429)


An example of ANSI type.

As ANSI music , English for ANSI music , an extension to be ANSI BBS called, with the per ANSI escape sequences simple tunes on the PC speakers can spend.

BBS clients and ANSI drivers

ANSI music was only common on Bulletin Board Systems , or BBS for short, and requires a BBS client or an ANSI driver that supports ANSI music . Programs for this were mainly limited to PC-compatible DOS such as MS-DOS . Few of these programs were ported to Windows 9x and Windows NT . Well-known DOS programs with ANSI music support:

  • QModem
  • Telemate
  • CI Link
  • Slick Terminal
  • SMT
  • QCom
  • BananaCom

Simple programs with support for ANSI music under DOS are A_TYPE, an implementation of TYPE, the ANSI driver ANSIALL as well as the playback program ANSIPLAY.

construction

ANSI escape sequence

The structure of the music function is designed as an extension for ANSI.SYS and is introduced with the escape sequence CSI, Control Sequence Intro , followed by the letter N. The original introduction was ←[M, this, however, is in ANSI X3.64 or ECMA-48 already on SGR0, switch off character attributes , awarded why in later versions (from the mid-1990s), the initiation ←[Nis used. However, ANSI BBS programs of the late 1990s can usually interpret both variants correctly.

With ANSI-CSI escape sequences, the function is only specified with the last character. For this , ANSI music uses Strg+Nunder DOS, which corresponds to ASCII SO in position 14 decimal or 0E hexadecimal . The spelling is common in DOS ^N. Escis displayed in DOS in most text editors with the left arrow .

The entire structure of ANSI music follows the ANSI escape sequence CSI:

←[N <Musik-Befehle...> ^N

This corresponds to decimal or hexadecimal . 027 091 078 <Musik-Befehle...> 0141B 5B 4E <Musik-Befehle...> 0E

Music commands and syntax

For the sound output, ANSI music is based on the function PLAYof BASIC . Since GW-BASIC is included in MS-DOS up to version 4.01 , a piece of music can be created in advance relatively easily and then transferred to an ANSI escape sequence in a text editor. Its successor QBasic is included in later MS-DOS versions .

ANSI music commands
A-G Note from the scale ; Example in C major:C D E F G A B
P Pause (no sound)
+ or # ( English sharp ) - simple increase by a semitone step ; must follow a note
- ( English flat ) - simple lowering by a semitone step ; must follow a note
. dotted note - the note is extended by half of its duration; must follow a note or a rest; several points are possible
Tnnn Tempo, nnn between 32and 255; Presetting:120
On Octave number n ; Default setting: octave3
< or > Decrease the octave by one (<) or increase it (>).
Lnn Length ( English length ) or duration ( English duration ) of the tone, corresponds to the ratio between note / pause; Presetting:4
MF and MB Music in the foreground ( English foreground ) or music in the background ( English background ), the default setting is usually the background process .
MN Music normal, sets the duration to 7/8 with an L command
ML Music Legato, sets the duration to full (1/1) with an L command
MS Music staccato, sets the duration to 3/4 with an L command

There are two methods of writing grades:

  1. with setting a tone length via length command Lor
  2. with note length after each note.

The legibility of the programmed notes is less when using the note length command.

Using the example of the first line of the song Mary Had a Little Lamb , according to the 1st method with length command:

L4 EDCDEE E2 DD D2 EG G2

And according to the 2nd method with the tone length after each note:

E4 D4 C4 D4 E4 E4 E2 D4 D4 D2 E4 G4 G2

The full ANSI music command for this line of song can look like this:

←[N T90O2E4D4C4D4E4E4E2D4D4D2E4G4G2 ^N

Part of an ANSI escape sequence

Because ANSI music will otherwise interrupt the text output on the monitor and possibly lead to display problems, the current line position and the attributes should be saved before the music output and then reset. The ANSI escape sequences do this ←[s ←[8mbefore and ←[u ←[a ←[0mafter the music part .

ANSI escape sequences according to ANSI X3.64
←[s Saves the current line ( English column ) in which the cursor is located.
←[8m Prevents the output on the screen (character attribute "invisible", English invisibility ).
ANSI music ... Example:←[Ncdefgab^N
←[u Resets the cursor to the line previously ←[ssaved with .
←[a Moves the cursor to the beginning of the current line.
←[0m Resets the character attributes (no longer invisible).

Upper / lower case

The English term case sensitivity describes how a system handles upper and lower case letters. DOS is traditionally case insensitive , so it is irrelevant whether a capital letter or a small letter is written. This means the ←[Msame as ←[mand the notes can be written in both upper and lower case.

See also

Web links

Individual evidence

  1. fileformat.info
  2. Mime types for ANSI graphics - the MIME type was only a suggestion and was not adopted.
  3. Linda R. Bloom: BBS ANSI Music Tutorial 4.1 (BBSAMT41). ( ZIP ; 50KB) September 28, 1994, accessed March 9, 2019 (English, part of the BBS Documentary Library ).