SPEECH
Your Computer, May 1984

J N Creak gets into conversation with his ZX-81.

Using the excellent 48K Spectrum Speaks article in the June 1983 edition of
Your Computer, it is possible to make an actual speech processor on a 16K
ZX-81.
    This program uses a "ZX-81isation" of that routine as its basis.
Manipulation of the data is, however, made far easier.
    The sounds can be stored and retrieved so that it is possible to
construct whole sentences phonetically by joining together the stored
sounds. 16K RAM is very limiting for the amount of data necessary to make
useful speed possible, but the program uses it to its best possible
advantage.
    To enter the program first set RAMTOP to 19712 in the usual way by:

		POKE 16389,77
		NEW

    Next type in the hexadecimal loader program - listing 1 - and enter the
machine code. When this is complete delete the loader program line-by-line
and enter listing 2.
    I suggest you now save it several times in case the machine code
crashes when executed. A single error will generally cause a complete
system reset, deleting everything, including any data above RAMTOP.

Set up tape recorder

    The next thing to do is to set up your tape recorder and ZX-81 as in
figure 1. This works on the principle that almost all portable tape
recorders have a monitor function during recording. This means that what is
being recorded through the microphone can be put to an external loudspeaker
or, in this case, to a computer. If you have no separate microphone but
your tape recorder has a built-in one, then use that.
    Set up the equipment, insert a fairly long blank tape - or one that can
be overwritten - and start recording. Alternatively, you can play a
recorded tape into the computer directly, without speaking, at about 1.25
times the normal loading volume.
    Set to FAST mode. Type RUN and you will get a prompt. Decide what to
say into the machine first, press NEWLINE, and say it. If you make a
mistake or over-run the time limit, hold down T when the prompt reappears.
When it reappears for a second time it is ready to go again. If you have
said the word correctly, just press NEWLINE. The TV screen should then show
a black screen with small white lines, which are the speech. If not, no
sound is reaching the computer, in which case, check everything and rerun
by pressing T.
    Assuming the lines are there, disconnect the equipment and reconnect as
in figure 2. An external loudspeaker is usually only necessary with tape
recorders with built-in microphones. If RECORD is again actuated then the
voice - or other sound - should be heard. If not, you have equipment
problems.
    Once this stage is reached, one can move on to the more interesting
aspects of the program. The complete sound input can be divided into 24
parts and they can be used singly or in groups, for hearing, storing and
retrieving.
    Press 1. You will be asked for a start-part - 1 to 24 inclusive is
allowed. The end-part is similar but must be more than or equal to the
start-part. If the end is the same then only that one part is output.
Narrow down the parts, by inputting smaller and smaller sections of the
sound, until you only hear the sound you wish to store, eg. the B in
Ball. Consonants are usually two parts long and vowels four parts long. If
in doubt make consonants longer and vowels shorter.
    To store a sound press S. You should input the limits you found to be
the best and give it a single letter name. If storing a sound like P at the
end of a word - as in help - store only the actual noise and not the
silence which preceeds it, as this can be added later and is a waste of
valuable memory. To delete a stored phoneme at any time, press D.    When
you have stored all the sounds you want from a particular word in memory,
press T to input another word - to get more sounds from - or,
alternatively, press V to synthesize some speech.
    The string input should consist of sets of named phonemes to make up the
words. Separate the words by spaces - to generate the sound and to make
a long delay - and you can use the numbers 1 to 9 to make short, timed
delays at any point.
	Example answers to the synthesis input:

"FLS SWIM QICLIF" - 'eels swim quickly'
"HW NW BRWN CW" - 'how now brown cow'
"TEL MF HF TIM PLFZ" - 'tell me the time please'
"CELIP IS SLJM1F" - 'kelp is slimy'

    Note the repetition of sounds to save memory, the use of E and F as
soft and hard E, and the use of 1 as a short delay. If a word overruns the
memory a tone is generated. From these basic principles large, complex
words and phrases can be synthesized, within the confines of the memory.
For example, using the fact that A,B,C,D etc end in "ee", it can even say a
large part of the alphabet, if correctly programmed.
    This program does all it can with the RAM available, but is still very
limited. Nevertheless, it gives a good demonstration of what can be done on
a small microcomputer.
