COMPLETE MUSIC (ZX80)
by Robin Arlott, Seaford, East Sussex
from Your Computer (August/Septemebr 1981), page 61

My program allows one to input the notes directly from a sheet of music with
their appropriate length and pitch to form tunes of up to 100 notes long.
The program can be altered for tunes longer than 100 notes.

The notes are input as C F BF - B flat - AS - A sharp - and so on. The
length of note is input as "0" "1" "1." and so on for semi-quaver, quaver,
dotted quaver and so on. Crotchets are taken as standard and input by
pressing newline only.

The pitch and timing of a tune, once input, can be raised or lowered, made
faster or slower, either uniformly for all notes in the tune, or for
individual notes. The program compensates for the variation of length of
note with pitch automatically so that high notes last as long as low notes -
see the factor 20*C/Y in lines 80/92.

The number of times a tune is played is determined by the loop at 105; the
program can be interrupted by pressing Space at the end of any recital.

A surprising feature of the program is that it can be played directly on to
any transistor radio or music centre without any wired connections, provided
the ZX-80 is reasonably near the radio. The pitch at which the tune is
played can be varied by adjusting the tuning of the radio.

The quality of the sound is improved if the TV set is switched off, though
of course the ZX-80 must remain plugged in. With several radios nearby at
the same time, one can obtain striking effects - for example, a haunting
performance of Shenandoah.

The machine-code routine used is that suggested by David Harris but the
overall program has been developed very considerably beyond the rather brief
program he offered.

The program will accept any tune containing up to 100 notes. If more is
wanted, line 1010 should be amended to enlarge the B array. The tune will be
played three times by the loop at line 105 which can also be altered. The
program calls first for the number of notes in the tune and then for each
note and its length separately.

The pitch or length of any note can be altered by command. For example:

    LET B(25)=F or B(36)=800

Odd numbers are notes and even numbers lengths of notes. The pitch or length
of all the notes in a tune can be changed uniformly by using GO TO 13 and
then input S = 0 for changing length and S = 1 for changing pitch.

The variable T then input increases all values by 1/3 - if -3 is input for
example - and reduces by 1/3 if 3 is input; if the values are just to be
printed out without alteration, give T as 3000 or larger. Use Continue for a
long tune.

The program sets out, at lines 42/44, exactly how length and pitch are to be
input, for each note. Note particularly that all values are for the octave
of middle C. Notes in higher or lower octaves can be input by using C/2 or
C*2, F/3 or G*3 giving respectively higher and lower octaves.

If the music has a dotted note, the "." should be input along with the
appropriate length indication, e.g., as "1.". To repeat the tune after
alterations, use GO TO 105.