RC2014 speaks

Back in the 1980s when the ZX Spectrum 48K was the only computer my family had I had a speach synthesizer for it. It was made by Currah if I remember correctly. It was possible to generate comprehensible speech as long as you manually translated the text you wanted it to speak into phonemes which required some trial and error. I must have sold it with the rest of my ZX Spectrum gear (several years later I was raising money to buy an Amiga) but thanks to the MG005 kit by Jerry Frost I’ve been able to re-visit that 1980s experience on my RC2014.

This was the first chance I had to make use of my new PCB holder and it made soldering the board a lot more convenient than my previous methods of wedging the board down on the work-surface or using an old “helping hands” with aligator clips.

Board under construction

The board itself was easy to assemble following the instructions on Jerry Frost’s website. It needed a bit of a clean in places to get the solder to adhere to a couple of the connections but otherwise it’s a nicely laid out board and not particularly tricky to solder. A nice touch is the included speaker so that you can use the board without requiring any other equipment (a jumper is provided to use an external speaker though).

Front of completed board Back of completed board

It’s possible to configure the output port used to communicate with the board. I left it as the default of 31. The instructions include the following short BASIC program to say “Hello World”

1
2
3
4
5
6
7
8
9
10
11
10 DATA 27,7,45,15,53,3,46,51,45,1,21,3
20 LET LE=12
30 DIM XX(LE)
40 FOR Y = 1 TO LE
50 READ XX (Y)
60 NEXT Y
70 FOR Z=1 TO LE
80 IF (INP(31) AND 2) = 2 THEN GOTO 100
90 GOTO 80
100 OUT 31,XX(Z)
110 NEXT Z

As fun as it was to hear my RC2014 speak; I found myself lacking the patience to translate text to allophones myself and so went looking for software to do it for me. I soon found github.com/nmacadam/SP0256-AL2-Lexicon which converts text to the allophones used by the SPO256A-AL2 chip. However the software was intended to support an arduino board and didn’t generate the numeric codes I needed for the MG005 board. That was easy to fix though and I forked the project with this change at github.com/davesnowdon/SP0256-AL2-Lexicon. My next thought was to make the software say something about the RC2014. However the dictionary-based lookup of the conversion software wasn’t able to handle numbers (it tried to find “2014” in the dictionary) or acronyms so I made a couple more changes to convert numbers to words (2014 -> two thousand fourteen) and expand acronyms to individual letters so they could be pronounced correctly.

With these changes I could enter text like this:

Hello human This is your RC 2014 speaking This is an authentic nineteen eighties experience

and get this list of allophones

HH1 AX LL OW PA5 HH1 YY2 UW1 MM AX NN1 PA5 DH1 IH S PA5 IH ZZ PA5 YY2 AO RR1 PA5 AA RR1 PA5 S IY PA5 TT2 UW1 PA5 TH AW ZZ AX NN1 D1 PA5 FF AO RR1 TT2 IY NN1 PA5 S PP IY KK3 IH NG PA5 DH1 IH S PA5 IH ZZ PA5 AE NN1 PA5 AX TH EH NN1 TT2 IH KK3 PA5 NN1 AY NN1 TT2 IY NN1 PA5 EY TT2 IY ZZ PA5 IH KK3 S PP IH RR1 IY AX NN1 S PA5

or in decimal

27, 15, 45, 53, 4,27, 25, 22, 16, 15, 11, 4, 18, 12, 0, 4, 12, 43, 4, 25, 23, 14, 4, 24, 14, 4, 0, 19, 4, 13, 22, 4, 29, 32, 43, 15, 11, 0, 4, 40, 23, 14, 13, 19, 11, 4, 0, 9, 19, 8, 12, 44, 4, 18, 12, 0, 4, 12, 43, 4, 26, 11, 4, 15, 29, 7, 11, 13, 12, 8, 4, 11, 6, 11, 13, 19, 11, 4, 20, 13, 19, 43, 4, 12, 8, 0, 9, 12, 14, 19, 15, 11, 0, 4

You can hear the results here: https://youtu.be/PvYM6WoTm8o

There are still improvements that could be made to the software:

  • add options to control whether to generate the arduino source, and to generate a BASIC program instead (I just used the example program above and replaced the first 2 lines, but it’s also necessary to split long lists of allophones over multiple DATA lines).
  • implement command line parsing to make it easier to select where the text should come from and what the output should be.
  • improve handling of input like “RC2014” - currently this needs to be entered as “RC 2014” in order for the software to handle the acronym correctly as it currently expects acronyms to be ALL CAPS A-Z.
  • be smarter at recognising years so 1980 gets converted to “nineteen eighty” - would need some kind of heuristic to determine whether a 4-digit number was likely to be a year (for example treat numbers from 1900 to 2021 as years).