PIC speech

BeanieBots

Moderator
A certain amount of "cheating" going on there I think.
Pay attention to how well in tune it is. That can't be done with 'standard' phononems alone. To see what I mean, check out the same demo used by SPE03 speach module. Much clearer 'speach' but hoelessly out of tune.
I don't want to knock what is an outstanding achievement, but do you think you would recognise what was being sung without the tune?

Could it be done with interpreted BASIC? Very much doubt it.
However, it might well be possible if the phononems were 'stored' in the interpreter and could be called in a similar fashion to the 'tune' or 'play' commands.
 

hippy

Technical Support
Staff member
Possibly possible though it would probably be easier for a PICAXE to use allophone samples held in I2C Eeprom, pull them in and churn them out in the right sequence ala PIC Talker ...

http://home.alphalink.com.au/~derekw/pictalker/main.htm

The BBC Micro used to have an excellent Text-to-Speech ROM using allophone samples and a purely software solution. Most allophone / formant systems I've heard sound at best 'robotic' and while formant can be easyish to set up a sound, can be incredibly hard to glide between sounds to make something meaningful heard.

There are hardware solutions to replace the old SPO256 and ilk, including Rev-Ed's SPE030.

One day I'm going to try the PIC Talker technique with a PICAXE - it worked reasonably well using VB and chaining .WAV files together - though I'd personally use a Windows PC and Microsoft Agent as a text-to-speech peripheral for a PICAXE. It would take a lot of work to match the quality of that, though SPE030 comes pretty close for an embedded solution.
 
Last edited:

Texy

Senior Member
Pre-recorded sound samples also have many uses for pic and picaxe projects :

http://www.romanblack.com/picsound.htm

It shows you have to encode your own sounds into binary to store (and play back from) an eeprom or two.
Not tried it yet, but its bookmarked for future dabbling;)

Texy
 

Rickharris

Senior Member
Go on Rick.
In between chasing inflatable scarecrows you've got plenty of time and money now :)
Still pondering the mechanical larynx so time and thought process all used up (only 3 days to go to end of term, end of job, end of employment - Never thought it would come)

And now we have 2 cases of Swine flue at school. :(
 

westaust55

Moderator
Possibly possible though it would probably be easier for a PICAXE to use allophone samples held in I2C Eeprom, pull them in and churn them out in the right sequence ala PIC Talker ...

http://home.alphalink.com.au/~derekw/pictalker/main.htm

The BBC Micro used to have an excellent Text-to-Speech ROM using allophone samples and a purely software solution. Most allophone / formant systems I've heard sound at best 'robotic' and while formant can be easyish to set up a sound, can be incredibly hard to glide between sounds to make something meaningful heard.

There are hardware solutions to replace the old SPO256 and ilk, including Rev-Ed's SPE030.

One day I'm going to try the PIC Talker technique with a PICAXE - it worked reasonably well using VB and chaining .WAV files together - though I'd personally use a Windows PC and Microsoft Agent as a text-to-speech peripheral for a PICAXE. It would take a lot of work to match the quality of that, though SPE030 comes pretty close for an embedded solution.
Hippy, what you suggest should/would be certainly achievable.

Back in 1980, using an SC-01 chip (akin to the SPO256) which had 64 phonemes, I first hooked on into a OSI Challenger computer under BASIC control and 2 years later later did the same with a Commodore C64 under BASIC control.

In BASIC changed the LET keyword to SAY and used the print syntax to take text or variables and put the resulting ASCII string into a buffer which was then converted to phonemes in a macjine code routine. Then passed that sound code buffer to small interrupt driven machine code portion so that BASIC could continue doing other things (sounds, or graphics on screen etc) while the speech continued under interrupt control. Each time a phoneme sound was completed by the SC-01 chip the finished signal was used to interrup BASIC and fetch the next sound/phoneme code before returning to BASIC. All done with relatively slow microprocessors of the day.
The M/c routines for tect to speech occupies about 2kbytes of EEPROM.
 

pbaker21

Senior Member
Please help!?

I'm trying to control the SPO256 chip with the following code but, all I'm getting is white noise at the moment.

#picaxe 20X2
#Terminal 9600
#No_Data
'#No_Table

;Trying to control the SPO256-017 (very old speech chip)


Symbol ALD = C.4 'output (Address Load)
Symbol LRQ = pinC.7 'input (Load Request)


Symbol allophones = b0
Symbol bin = b1

dirsB = %00111111


table 0,(0x10,0x0F,0x0B,0x2A,0x13,0x00) 'allophones to say the word "monkey"



high ALD


for allophones = 0 to 5

readtable allophones, bin


Do : Loop While LRQ = 1 'if LRQ is high then wait for it to go low before loading address

let pinsb = bin

pulsout ALD,10

next allophones
 

pbaker21

Senior Member
Any takers on this? I'm not sure, after reading the data-sheet again (and again..) what more I can do? Ideas??
 

hippy

Technical Support
Staff member
Post your full circuit diagram, photos and anything else useful that describes the hardware you are using.

Add a pause at the start of the program, simplify the code to the bare minimum, try clocking just one specific (long duration ) allophone out every second, ignore SBY and LRQ signals. Perhaps drive the RESET pin from the PICAXE.

Do you have a scope available so you can look at what signals there are in the circuit, can check that each pin is being controlled as required ?
 

pbaker21

Senior Member
No scope I afraid. I'll try and get a photo of my circuit on here in the next couple of hours - does the code look like it should work?

Thanks for feedback.
 

hippy

Technical Support
Staff member
does the code look like it should work?
Yes, but I'd still drop to the absolutely bare minimum to start with; inline pin numbers and standard variable names rather than via symbol, constants instead of table lookups, etc.

That makes it much easier for people to tie what you have in code to the circuit and analyse what could be wrong.

Though symbol names are recommended for readability in general, for debugging base-level hardware, simplicity, obviousness and clarity are the best. You can move to more complicated code once you have the foundations sorted.
 

pbaker21

Senior Member
Post your full circuit diagram, photos and anything else useful that describes the hardware you are using.

Add a pause at the start of the program, simplify the code to the bare minimum, try clocking just one specific (long duration ) allophone out every second, ignore SBY and LRQ signals. Perhaps drive the RESET pin from the PICAXE.

Do you have a scope available so you can look at what signals there are in the circuit, can check that each pin is being controlled as required ?
P1020662.JPG

Hopefully this photo may help. If not I can upload another one/two whatever.
 

erco

Senior Member
pbaker21: I have a pile of speech chips that I haven't gotten to use yet, the SP0-256-AL2 is one of them. But I'm doing a lot with the SP0-512 now. Some thoughts:

1) Ken at speechchips is a fan of and still sells the 256; he may be able to assist. http://www.speechchips.com/shop/item.aspx?itemid=7

2) My 512 is finnicky, I had to experiment to get it working right. It is of course its own microprocessor, which must be reset after each glitch/failed attempt. Baud rate (9600 true 8N1 in my case) is critical, obviously, as is timing of sending the serial commands and CRs.

My programs open with a one-second pause, sends two empty CRs, pauses 200 ms, monitors the "busy/speaking" line to go low, sends a line of text ending with two CRs, pauses 200 ms, monitors the "busy/speaking" line to go low, etc.

Yours might require something similar, I only found out through experimentation and patience. :)
 

pbaker21

Senior Member
Some newer code to go with photo. I have managed to get a few odd speechy sounds but, that's all.

With the code I currently have it says the words "one ten elev" when the button is pressed. It doesn't get much more exciting than that!


#picaxe 20X2
#Terminal 9600
#No_Data


;Trying to control the SPO256-017 (very old speech chip)

Symbol PA1 = 0x00
Symbol PA2 = 0x01
Symbol PA3 = 0x02
Symbol PA4 = 0x03
Symbol PA5 = 0x04

Symbol OY = 0x05
Symbol AY = 0x06
Symbol EH = 0x07
Symbol KK3 = 0x08
Symbol PP = 0x09
Symbol JH = 0x0A
Symbol NN1 = 0x0B
Symbol IH = 0x0C
Symbol TT2 = 0x0D
Symbol RR1 = 0x0E
Symbol AX = 0x0F
Symbol MM = 0x10
Symbol TT1 = 0x11
Symbol DH1 = 0x12
Symbol IY = 0x13
Symbol EY = 0x14
Symbol DD1 = 0x15
Symbol UW1 = 0x16
Symbol AO = 0x17
Symbol AA = 0x18
Symbol YY2 = 0x19
Symbol AE = 0x1A
Symbol HH1 = 0x1B
Symbol BB1 = 0x1C
Symbol TH = 0x1D
Symbol UH = 0x1E
Symbol UW2 = 0x1F
Symbol AW = 0x20
Symbol DD2 = 0x21
Symbol GG3 = 0x22
Symbol VV = 0x23
Symbol GG1 = 0x24
Symbol SH = 0x25
Symbol ZH = 0x26
Symbol RR2 = 0x27
Symbol FF = 0x28
Symbol KK2 = 0x29
Symbol KK1 = 0x2A
Symbol ZZ = 0x2B
Symbol NG = 0x2C
Symbol LL = 0x2D
Symbol WW = 0x2E
Symbol XR = 0x2F
Symbol WH = 0x30
Symbol YY1 = 0x31
Symbol CH = 0x32
Symbol ER1 = 0x33
Symbol ER2 = 0x34
Symbol OW = 0x35
Symbol DH2 = 0x36
Symbol SSS = 0x37
Symbol NN2 = 0x38
Symbol HH2 = 0x39
Symbol ORR = 0x3A
Symbol AR = 0x3B
Symbol YR = 0x3C
Symbol GG2 = 0x3D
Symbol EL = 0x3E
Symbol BB2 = 0x3F


Symbol ALD = C.4 'output (Address Load)
Symbol LRQ = pinC.6 'input (Load Request)


Symbol allophone = b0
Symbol bin = b1


dirsB = %00111111



table 0,(PA2, JH, AE, AE, NN1, PA5)

'table 0,(PA2, SSS, SSS, EH, PA3, PP, PA3, TT2, EH, EH, PA1, BB2, ER1, PA2)

'table 0,(0x01,0x10,0x0F,0x0B,0x2A,0x13,0x01) 'allophones to say the word "monkey"
'table 7,(0x04,0x24,0x3B,0x02,0x21,0x0C,0x0B) 'allophones to say the word "monkey"



high ALD

pause 50



pressButton:

high c.0

button c.3,1,200,100,b2,1,PlaySound ; jump to cont when C.0 = 1

goto pressButton





PlaySound:

low c.0


for allophone = 0 to 5

readtable allophone, bin

Do : Loop While LRQ = 1 'if LRQ is high then wait for it to go low before loading address

let pinsb = bin

pulsout ALD,10

next allophone


goto pressButton
 

erco

Senior Member
And per http://www.redcedar.com/sc01.htm , here's a good book, I got one on Ebay.

Prochnow, Dave, Chip Talk: Projects in Speech Synthesis, Tab Books, Blue Ridge Summit, PA: 1987. ISBN is 0-8306-1912-7 (hard cover) and 0-8306-2812-6 (paperback). Hardcover is Tab # 2812.
A hobbyist-oriented book on speech synthesizers circa 1987, including

Votrax SC-01A (analog formant)

General Instruments SP0256-AL2 (CTS256A-AL2)

National Semiconductor DT1050 Digitalker (Mozer)

Silicon Systems SSI 263 (analog formant)

Texas Instruments TMS5110A (LPC)

Oki Semiconductor MSM5218RS (ADPCM)

as well as stand-alone systems. Schematics, pin-outs, construction hints. Not much detail on theory. All but certainly out of print, but that's what inter-library loans are for!
 

pbaker21

Senior Member
So it's now working then ?
Not quite yet! It makes some sounds (the occasional burst of white noise) but, it seems another member 'Erco' says "Oops, I just noticed that your chip is the SP0-256-017, not the -AL2. Yours is a special chip designed for a speaking alarm clock, it has a specific preprogrammed vocabulary." So I might well be wasting mine and your time! :confused:
 

pbaker21

Senior Member
Oops, I just noticed that your chip is the SP0-256-017, not the -AL2. Yours is a special chip designed for a speaking alarm clock, it has a specific preprogrammed vocabulary. You're sending it phonemes that would make an AL2 speak, but IIRC, that won't happen with the 017 chip. See http://www.speechchips.com/downloads/sp0256-17 datasheet.pdf
Well, that's a little embarrassing now. Erm, if I can get it going properly, I guess I'll have no choice but make a clock! ;)
 

hippy

Technical Support
Staff member
Well, that's a little embarrassing now. Erm, if I can get it going properly, I guess I'll have no choice but make a clock! ;)
Add an LDR and a tilt switch, repeatedly send 30 / "Good Morning" when the light levels come up until the PICAXE detects it's been pummelled into the ground :)
 

erco

Senior Member
Ken just confirmed my suspicions via email:

The 17 isn't an AL2. The AL2 stands for phonemes. The 17 is preprogrammed with words for a talking clock. Just so happens that I've gotten 27 SP0-256-AL2 in stock. If you feel like it, you can send him my way. :)

Thanks,
Ken
 

pbaker21

Senior Member
Add an LDR and a tilt switch, repeatedly send 30 / "Good Morning" when the light levels come up until the PICAXE detects it's been pummelled into the ground :)
I think I'll give up on this project for the moment. Maybe a clock will become of it...or a hammer, who know. I've just found another old chip 'TMS1000NLP', they keep popping up :D
 

erco

Senior Member
No,... you're so close! At least verify the 256-017 works as it should while you have it hooked up. Youtube it speaking , I'd be interested to hear if the built-in words sound better than the text-to-speech chip on an AL2.
 

westaust55

Moderator
It would seem that the SP0-256-AL2 is in fact very similar to the SC-01 chips I have previously mentioned.
Although hardware is still the current problem, the text from BYTE magazine available here and starting at page 95.

Since the Phonemes are the same, from what I can see) the old US Naval Research Labs text to speech rules as docuemnted at the link could still be used.
Would be very slow to convert under BASIC but once a phoneme struing is generated, can use interrupts to send the new codes to the SP0-256-AL2.
 

pbaker21

Senior Member
Some good news!

I added some 100k pull-up resistors (based on the sp0256-17 datasheet) on the address lines (1-6, 7 & 8 still grounded) and now it counts from 'oh' to '10', almost eleven. I say almost, as it seems to start with 'elev' then goes nnnnnnn.

I did try grounding 7 & 8 but nothing. So, I can't seem to get past eleven. I've tried other value and nothing. Any thoughts?
 

hippy

Technical Support
Staff member
Does the "nnnn" continue for every or stop after a while ? What happens if you skip 11 and go straight to 12 or some other number ?

You could try adding pauses after each activation, triggering on SBY rather than /ALQ. It could be the hardware locking up for some reason; power out, of spec crystal.
 

pbaker21

Senior Member
I have tried a few numbers after 11 and nothing! I have added in a long pause (more than long enough to cover the word eleven).

I might as well try as you say SBY rather than ALQ - thanks.
 
Top