Software speech for Orangutan

Support for the A-Star and the Orangutan family of robot controllers.

Software speech for Orangutan

Postby Jim Remington » Thu Sep 19, 2013 11:45 am

The Texas Instruments Speak & Spell from the 1970's lives on! This was a pretty remarkable toy that generated quite passable speech, based on an extremely primitive 4-bit microprocessor.

Peter Knight wrote an AVR emulator for the Linear Predictive Coding algorithm used in the Speak & Spell and together with binary dumps of several different ROMs that used the TI speech processor, one can cobble together a pretty cool package for purely software-generated speech.

See http://elek101.blogspot.com/2012/12/ard ... clock.html for a talking clock based on the code. That link gives an audio example of the speech quality and has a link pointing to Peter's GitHub deposition, which includes a great deal of interesting stuff, including experimental MATLAB code to roll your own speech libraries.

I would NOT recommend connecting a speaker to an output pin as the above clock example shows. I used a small audio amp instead.

I modified Peter's Talkie code to run on the 20 MHz Orangutan LV-168 (after removing the C++ constructs and changing the output of timer2 to PB3). I also had to change one of the delay timing constants in the routine Say() to get the voice cadence to be reasonable. Below is the main routine for a talking demo, but you can download a self-contained package with all the mods at http://molbio.uoregon.edu/~remington/talkie.zip

This was developed using AVR Studio 4, so there may be issues with later versions of the IDE. Let me know if so! Note: my example takes up about 7K bytes of flash, so it is memory intensive.

Code: Select all Expand
Jim Remington
 
Posts: 590
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR

Re: Software speech for Orangutan

Postby BrandonM » Fri Sep 20, 2013 1:39 pm

Hello, Jim.

Thank you for sharing your work with us. This is really neat! We are going to try it here and look into getting a quick example video to post with it on our blog.

-Brandon
User avatar
BrandonM
Pololu Employee
 
Posts: 438
Joined: Thu Jun 06, 2013 12:28 pm
Location: Las Vegas, NV

Re: Software speech for Orangutan

Postby kevin » Fri Sep 20, 2013 5:17 pm

Hi, Jim.

I've made some minor changes to your project to get it working with Atmel Studio 6 and the Orangutan SV-328 (since we've discontinued the LV-168), and I noticed something interesting: since PB3 is a motor control pin, you can use the SV-328's motor driver as an improvised audio amplifier by connecting a speaker across the M2 motor outputs!

For better results, you can set PD3 high to make the TB6612FNG motor driver hold M2B low and toggle the M2A output between high and low. (Otherwise, with PD3 low, M2A stays at high impedance and M2B toggles between high impedance and high.)

Increasing the input voltage to the SV-328 had a noticeable effect on the volume; it sounded quite a bit louder at 12 V than at 6 V.

- Kevin
User avatar
kevin
Pololu Employee
 
Posts: 588
Joined: Thu Oct 14, 2010 5:22 pm
Location: Las Vegas, NV

Re: Software speech for Orangutan

Postby Jim Remington » Fri Sep 20, 2013 8:34 pm

What a great idea to use the motor driver as an amplifier!

It gets cooler: Peter Knight wrote MATLAB routines to generate LPC byte codes from .wav files, and included them in his distribution. He seems to have dropped the project, but he did encode part of Suzanne Vega's vocal piece "Tom's Diner", and it sounds much better than the data from the old TI roms.

For your entertainment, I include part of that byte code to demonstrate the high quality below. Others have created (see e.g. http://furrtek.free.fr/index.php?a=spea ... l&ss=1&i=2) non-MATLAB routines to convert arbitrary .wav files to LPC byte code. Your robot should speak with your voice! Or, use byte codes to send voice messages by email, challenging the NSA.

Code: Select all Expand
Jim Remington
 
Posts: 590
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR

Re: Software speech for Orangutan

Postby Jim Remington » Sat Sep 21, 2013 5:57 pm

I didn't like the "clock" library for formatting numbers, as it lacked "zero", so here is another example that would be great for a talking weather station or other measurements. The voice is U.S male, very intelligible and the vocabulary is excerpted from a large library of aviation and weather phrases ("Vocab_US_Large" in the Talkie Library).

For this example, I wrote a simple routine to vocalize a formatted (ascii) number string. It sounds great!

Note that there are two different synthesizer chips (TMS5200 and TMS5220) with different coefficient sets and the speech roms are optimized for one or the other. Some experimentation will help determine which works best with which vocabulary set. See the comments on GitHub, Talkie Issues, for an explanation.

This particular routine takes up about 5K bytes of flash.

Code: Select all Expand
Jim Remington
 
Posts: 590
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR

Re: Software speech for Orangutan

Postby kevin » Wed Sep 25, 2013 6:15 pm

I've attached an Atmel Studio 6 project for Jim's last demo (the "weather station") converted to run on an Orangutan SV-328. We'll be putting up a YouTube video and blog post demonstrating it soon. Hopefully, this will serve as a good template for anyone else wanting to experiment with the Talkie library (lots of additional examples and speech data can be found in Peter Knight's Talkie repository on GitHub).

I didn't have to make many changes, though I did have to add "const" to all of the speech data definitions so the compiler wouldn't complain:
Code: Select all Expand


Also, I added some code to set up the motor driver pins for connecting a speaker on the motor outputs, and I made the LCD show what's being spoken to make the video a little more interesting (so the project now depends on the Pololu AVR C/C++ Library).

Jim, thanks again for porting Talkie to the Orangutan and sharing your work with us!

- Kevin
Attachments
talkie-SV-328.zip
Talkie demo for Orangutan SV-328 (Atmel Studio 6)
(22.27 KiB) Downloaded 55 times
User avatar
kevin
Pololu Employee
 
Posts: 588
Joined: Thu Oct 14, 2010 5:22 pm
Location: Las Vegas, NV

Re: Software speech for Orangutan

Postby kevin » Wed Oct 02, 2013 5:22 pm

The blog post and video are up.

- Kevin
User avatar
kevin
Pololu Employee
 
Posts: 588
Joined: Thu Oct 14, 2010 5:22 pm
Location: Las Vegas, NV

Re: Software speech for Orangutan

Postby Jim Remington » Wed Oct 02, 2013 9:20 pm

Cool. And, it sounds better than that famous theoretical physicist!
Jim Remington
 
Posts: 590
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR


Return to A-Star and Orangutan Robot Controllers

Who is online

Users browsing this forum: No registered users and 1 guest