TRANSPOSITION (1K ZX81)
by J F Vincent, Reading, Berkshire
from Your Computer, December 1981, Page 78

This program was developed to transpose music from one key to another. The
string A$ contains the 12 notes of the chromatic scale - the flattened notes
are represented by inverse characters.

The rest of the program converts the notes input in string B$ to integers or
near-integers, then adds T, which is the number of semi-
tones through which you want to transpose the music, and reads the
appropriate note from A$.

Obviously, if you want to transpose down you either use (12-T) or change the
plus sign in line 110 to a minus symbol. The program
has been simplified in line 310 which will not return an integer - as you
can see if you put line 130 to

    PRINT P;A$(P)

Yet the number is treated as the next highest integer - this saves some
space. Some interesting patterns can be generated by this program. For
instance, put T=5, enter B$ as

    "CDEFGABCDEFGAB"

then enter the result which the program prints out. Do this until your first
B$ is repeated.

The program can also be used to compose music - albeit music of a rather
modern nature - if T is replaced by a random function. For example, delete
line 30 and change 110 to

    LET P=P+INT (RND*10)
