---------------------------------------------------------------
                     ZX81 MUSIC INTERPRETER
                      KELLY ABRANTES MURTA
                           ABRIL 2005
                      kmurta@yahoo.com.br
                        http://zx-81.tk
---------------------------------------------------------------

This program implements in the ZX81 a macro musical language 
similar to command "PLAY" of microcomputers TRS Color and MSX.
The necessary subcommands for the execution of music in an 
ample range of scales had been implemented all, which is 
presented more ahead.

The sintax of the command is:

PRINT USR 16656," MUSICAL STRING "

The string musical is a set of subcommands that represents the
musical information, composed of some parameters:

- NOTES: They are codified with the letters of 'A' to 'G' and
has the following equivalences:

  Do  Re  Mi  Fa  Sol  La  Si
  C   D   E   F   G    A   B

To get sharp, is enough to place caracter '+' after the note;
for flat, use the caracter '-'. Example:

  C+ = Do sharp        D- =  Re flat

- Octaves: Represented by the letter 'O' followed of the
number of the octave.  The value default is O4, that
corresponds to the central octave of the piano.

- Duration of the note: It is represented by the letter 'L'
followed of a number from 1 to 255. The default value is L4
and the usual durations are:

L1 = Semibreve
L2 = Minim
L4 = Crochet
L8 = Quaver
L16 = Semiquaver
L32 = Demisemiquaver
L64 = hemidemisemiquaver

The point ('.') to increase the duration of the note in 50% 
will have to be placed after the note: L16C.

- Rests: They are codified with letter 'P' followed of a number
from 1 to 255, being valid the same definitions of duration of
'L'. The rests also can have the duration increased in 50% with
the use of '.' after the command: P16.

- Tempo: It is codified with letter 'T' followed of a number 
from 1 to 255. For slower musics, use lesser values and, for 
faster musics, bigger values. The default value is 120, that is
equivalent to 120 crochets per minute.

- Subcommand X: It allows the execution of musical strings 
stored, for convenience, in 'REM' lines, as for example, 
stretches that is repeated inside of music. It is used in the 
form 'Xn', where n is the number of the 'REM' line where it is 
the musical string.

As example of the use of all these musical subcommands, see as 
it is the codification of a stretch of the Nineth Symphony of 
Beethoven:

 810 REM BP96BO5CDP96DCO4BAGP96GAB
 820 REM AP96ABGAL8BO5CO4L4BGAL8BO5CO4L4BAGADL4B
 830 PRINT USR 16656,"T112O4L4X810P96B.L8AP96L4AP4
X810A.L8GP96L4GP4X820X810A.L8GP96L4GP4"


OBS.: Two equal notes played one after to another one sound to 
the ears as if it was a note alone, but in a musical instrument
they are played separately. The solution for this small 
problem, is to use a small rest between two equal notes. In the 
previous example, they had been used rests of duration 96 (P96) 
when we come across with this situation.
