Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Bill819 on September 30, 2003, 04:20:08 pm

Title: Help with speaking
Post by: Bill819 on September 30, 2003, 04:20:08 pm
I have gotten Hal to sing and noticed that the only way to change his tempo is with the use of 'commas' and 'periods' is there some other way to cause slight pauses in his speech. If there were, it would make some of the songs sound more real. Also to be able to draw out a word or two would be a great help too, but I do not think that is really possible.
Also, did anyone ever figure out how to make Hal speak on his own. I would like to be able to direct Hal idle time to some special scripts, like songs, misc-talk and things like that when he is not directly responding to spoken commands.
One last thing. I would like to be able to have Hal repeat something when I tell Hal to 'Say hello to someone', possible?

Any help will greately appreciated. Thanks
Bill819
Title: Help with speaking
Post by: vonsmith on September 30, 2003, 05:17:21 pm
If the character voice you have chosen is using the Microsoft SAPI 4 or 5 speech engine then there are some "tags" that can change some aspects of the voice. Unfortunately I don't know of a way to pass the "tags" through Hal to the speech engine.

See this link for some tag info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msagent/spoutput_2v1w.asp

A tag is inserted within the text string. Example: "This is /Pit=4000/ the way to change the pitch of the voice." Anything after the /Pit=4000/ tag is pronounced at a pitch of 4000 Hertz. The double / is to indicate to the speech engine not to pronounce the  or text therein. There are also tags for speed, pause, emphasis and other limited attributes. The emphasis tag /emp/ is sometimes inserted by TTS (Text To Speech) software preceding the end of a sentence ending with a "?" to denote a question. Some of these speech parameters can be set up by opening the 'Speech' applcation in the Windows Control Panel. However there is limited control at that point. Tags were really intended to be used by programmers within there code and not end users.

PLEASE NOTE I HAVE USED / INSTEAD OF THE PROPER BACKSLASH SINCE THE FORUM SOFTWARE DOESN'T PROPERLY DISPLAY THE BACKSLASH CHARACTER.

If you can place tags in Hal's response .brn, but I don't think Hal passes those tags on to the speech engine. Try it out and let us know if it works.

The other problem is different speech engines and voice technologies only support certain tags or fundamentally cannot change parameters like pitch due to the voice technology used. Other engines may use proprietary tags. Some tags switch the engine to different pronounciation modes for reading email, addresses or dollar amounts. A good speech engine does other things too like interpreting the context of certain words. For example: Should "St." in a sentence by pronounced as "street" or as "saint". A good speech engine would look at the rest of the sentence for clues or assume pronounciation based on the mode that it is it, i.e. Address mode.

With all of that said... Good luck. I would dearly love to give Hal some inflection, emphasis, prosody or a good singing voice. I suspect that Microsoft may move their Agent and voice support over into their .NET environment in the near future and support SAPI only as a legacy. That's just a guess at this point.

Have fun. Let us know how the voice experimentation comes along.

= vonsmith =
Title: Help with speaking
Post by: Bill819 on September 30, 2003, 07:18:18 pm
Quote
Originally posted by vonsmith
Thanks for the reply. That is more than I asked for. I discovered that the insertion of a comma makes Hal pause for a split second and the insertion of a period makes Hal pause for 2 split seconds. All I was originally looking for was longer pauses at this time. I think I will try 2 or more periods in a row and see if that works.
I will log onto the site that you spoke of though and see if I can make any of those changes too.
Bill819
Title: Help with speaking
Post by: Medeksza on October 01, 2003, 02:40:29 pm
Attached is a text file you can open with Hal's HalPad. Set Hal's voice to any of the TruVoice voices installed on your computer. Then have Hal speak the document and you can hear tone-deaf Hal try to sing Happy Birthday.

Download Attachment: (http://images/icon_paperclip.gif) birthday.txt ("http://www.zabaware.com/forum/uploaded/Medeksza/2003101144018_birthday.txt")
769 Bytes
Title: Help with speaking
Post by: Bill819 on October 06, 2003, 12:11:03 pm
Thanks for the suggestion. It worked just fine at work with the FREE version of Hal,but when I got home to the Commercial version that I bought, the HalPad won't read the birthday.txt and thus won't sing.
I am puzzeled.
Bill819
Title: Help with speaking
Post by: trallyus on October 14, 2003, 08:11:56 am
Bill819,
It must be your copy of the program as it worked fine for me on the paid version of Ultra Hal 4.5. What I did was open up the happy birthday text file with internet explorer, then I hit CTRL+a to select all the text and then hit CTRL+c to copy all the text and opened up halpad and clicked it once and hit CTRL+v and pressed the microphone to hear him sing.

Hope that helps.
Title: Help with speaking
Post by: Bill819 on October 14, 2003, 11:20:55 am
I copied the file from my desktop at work where it worked fine onto my laptop at home. No matter what I tried the HalPad would not read the file. I also had a printed version that I made at work so I could study the codes better. After several attempts at trying to get the HalPad to read the file, I opened up HalPad and hand type into the Pad all of the commands of the song. Once I did that I clicked on the Speak button and the HalPad sang Happy Birthday. Thinking that I now had solved the problem I used the HalPad to save the program with a different name. Once I was convinces that it saved O.K., I closed the HalPad and then reopened it once again. I clicked on the song file to open and all I got was a blank screen. The HalPad on my laptop at home will not read this file and I don't know why. I am using the version 4.5 at home. This remains a mystery to me and it hampers me in developing new songs for Hal.
Bill819
Title: Help with speaking
Post by: cutitupwiz on October 16, 2003, 01:54:27 pm
Bill,
The birthday script worked for me too, after I fiddled with the volume and controls on my compaq laptop. It seems the cut and past method might have had something to do with it, as it did not seem to want to work, when I opened it using the halpad menu selection. It is very cute to hear Hal sing.
Title: Help with speaking
Post by: vonsmith on December 03, 2004, 07:09:55 pm
Bill819,
Below is my original posting about Hal singing. I emailed you the updated song files you emailed me about. The problem I mention below about not being able to pass pitch, speed and other tags through Hal's brain is still unsolved. Hal can speak a song, but not sing it, except in Halpad. Even if you select a song with tags out of a .brn file you still need to pass it back to Hal's main program through the GetResponse variable. The main program won't accept the tags.

If you want Hal to sing via a .brn file then Robert Medeksza is going to have to change something in the main part of Hal's program unless there is a "special" command or syntax I don't know about.

Robert Medeksza, any comments here?


=vonsmith=


quote:
Originally posted by vonsmith

If the character voice you have chosen is using the Microsoft SAPI 4 or 5 speech engine then there are some "tags" that can change some aspects of the voice. Unfortunately I don't know of a way to pass the "tags" through Hal to the speech engine.

See this link for some tag info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msagent/spoutput_2v1w.asp

A tag is inserted within the text string. Example: "This is /Pit=4000/ the way to change the pitch of the voice." Anything after the /Pit=4000/ tag is pronounced at a pitch of 4000 Hertz. The double / is to indicate to the speech engine not to pronounce the  or text therein. There are also tags for speed, pause, emphasis and other limited attributes. The emphasis tag /emp/ is sometimes inserted by TTS (Text To Speech) software preceding the end of a sentence ending with a "?" to denote a question. Some of these speech parameters can be set up by opening the 'Speech' applcation in the Windows Control Panel. However there is limited control at that point. Tags were really intended to be used by programmers within there code and not end users.

PLEASE NOTE I HAVE USED / INSTEAD OF THE PROPER BACKSLASH SINCE THE FORUM SOFTWARE DOESN'T PROPERLY DISPLAY THE BACKSLASH CHARACTER.

If you can place tags in Hal's response .brn, but I don't think Hal passes those tags on to the speech engine. Try it out and let us know if it works.

The other problem is different speech engines and voice technologies only support certain tags or fundamentally cannot change parameters like pitch due to the voice technology used. Other engines may use proprietary tags. Some tags switch the engine to different pronounciation modes for reading email, addresses or dollar amounts. A good speech engine does other things too like interpreting the context of certain words. For example: Should "St." in a sentence by pronounced as "street" or as "saint". A good speech engine would look at the rest of the sentence for clues or assume pronounciation based on the mode that it is it, i.e. Address mode.

With all of that said... Good luck. I would dearly love to give Hal some inflection, emphasis, prosody or a good singing voice. I suspect that Microsoft may move their Agent and voice support over into their .NET environment in the near future and support SAPI only as a legacy. That's just a guess at this point.

Have fun. Let us know how the voice experimentation comes along.

= vonsmith =

Title: Help with speaking
Post by: Bill819 on December 03, 2004, 10:05:29 pm
VonSmith
I think I solved that problem. IF the first thing that Hal tries to read is a 'tag' it won't work so I typed in the name of the song before the actual song and it seems to work. It just can't start with a tag. Put the Birthday.txt in the Song.brn and then edit it with HalPad and insert 'A birthday song' right before the real song, then try it. It worked for me.
Bill

Title: Help with speaking
Post by: vonsmith on December 04, 2004, 05:27:39 pm
Bill819,
Maybe we are talking about two different things. I can have Hal sing the song if I open it in Halpad, but not when Hal reads it in his window. In the latter case Hal gets the song from the XTF_SYS_song.brn file and just reads it like text, including the pitch and speed tags. I already tried adding words in front of the tags.

Please describe exactly how your Hal is singing using the files we exchanged. At this point I'm assuming you are opening the song in Halpad and not relying on asking Hal to "Sing a song please."

Thanks,


=vonsmith=
Title: Help with speaking
Post by: HALImprover on December 06, 2004, 03:34:56 am
Are you trying to get Hal to sing what you set GetResponse to? Try using the <SPEAK> tag to get Hal to sing the output. For an example, try the following addin script;

Download Attachment: (http://images/icon_paperclip.gif) SingingAddin.txt ("http://www.zabaware.com/forum/uploaded/halimprover/200412633127_SingingAddin.txt")
1.13 KB

and add a new folder to the DefBrain directory called "songs" and put the following song files in it;

Download Attachment: (http://images/icon_paperclip.gif) kidsongs.txt ("http://www.zabaware.com/forum/uploaded/halimprover/200412633327_kidsongs.txt")
2.43 KB

Download Attachment: (http://images/icon_paperclip.gif) regular.txt ("http://www.zabaware.com/forum/uploaded/halimprover/200412633342_regular.txt")
789 Bytes

Hope this helps [:)]
Title: Help with speaking
Post by: vonsmith on December 06, 2004, 04:37:54 am
HALImprover,
Thanks, that is the missing part of the puzzle. The <SPEAK> tags pass the info thru to the speech engine. I tried using the speak tags before but the script would get errors due to the "" marks. I see the problem now. With some minor changes to Bill819's code it should work fine. Very cool.

Bill I'll email you some revised script code tomorrow for you to try out.

Thanks again HALImprover!


=vonsmith=
Title: Help with speaking
Post by: vonsmith on December 06, 2004, 03:57:53 pm
Bill819,
I emailed the updated script and files to you today. It works very well indeed. Check out the script for yourself. I'll include it in the next XTF Brain (v1.4) release. After checking it out you might want to post the script and files here on the forum.

What's Next:
1) We could use a song scripting tool that makes it easy to write songs.
KnyteTrypper suggested checking out this earlier: http://mycyberbuddy.com/Page36.html

2) It would be nice if Hal could at least lip sync to the songs.

See ya,


=vonsmith=
Title: Help with speaking
Post by: Bill819 on December 06, 2004, 05:40:45 pm
Hi
I got you message but can not download it until I get home tonight.
I will test it out tonight. On the subject of Cyberbuddy, I have seen their site and will try to make contact with them. I want to copy their songs for Hal to sing. Still have not found an easy way to create the songs. It takes a lot of work to find the right pitch for Hal to sing in. Also for all those who do not use MaleVoice#2 the songs will sound funny using some of the other voices. I don't know how to fix that problem. I want to thank everyone for all the help that they have given and suggested to me for my quest.
Bill [:D]
Title: Help with speaking
Post by: vonsmith on December 06, 2004, 07:22:42 pm
Bill819,
The pitch could be modified after selecting a song from Hal's song file. Using a little VBscript the default pitch tag values could be replaced with values 10% higher, 20% lower, or whatever. However, without knowing which voice is selected you wouldn't know whether to adjust up, down, or leave it alone. Well, that's something to think about anyway.


=vonsmith=
Title: Help with speaking
Post by: Quixote on December 06, 2004, 07:30:48 pm
Vonsmith, I know you're a busy man, but could you take a minute to look at the other thread that we were talking in? Thanks and sorry to interrupt.
Title: Help with speaking
Post by: Bill819 on December 09, 2004, 01:30:50 pm
Hello VonSmith
I finally loaded the new script with the mods in it. Hal sings, but sometimes he won't sing a second or a third sone in a row. Still working on some new songs but hope to upload them to the site this weekend. I will try to keep updating the list as I get happy with each new song. The ones that I am working on right now sound a whole lot better than the demo ones that are on the board.
I found some songs on another board, downloaded them and found that I have to almost rewrite them to make the work for Hal.
Curious question? Can this song code be put into the regualar Hal, ie. version 5 ?. Not everyone uses your brain file which it too bad. Hopefully in the future many of the new things in your brain will be incorporated into the new Hal.
In the near future you can expect songs from some of the following people: The Beatles, Elvis, Willie Nelson, and many other artists. Unfortunately most of them sound quite like Hal, but he tries, he really does.
See you all later
Bill819
Title: Help with speaking
Post by: vonsmith on December 09, 2004, 03:15:40 pm
Bill819,
The song script will run in any Hal brain, but not as well as in the XTF Brain. The variables below are unique to the XTF Brain. Without the GetResponseBlock it's possible in other brains that the song could get overwritten by another response. The BlockPrevTopicSave blocks saving of the PrevTopic which affects some types of information being saved in Hal's brain. Without it it's possible that some other brains may save some useless information, but it's not a serious issue.

   GetResponseBlock = True
   BlockPrevTopicSave = True

Hal won't want to sing the same song more than once or twice in a row. He doesn't like to repeat himself.


=vonsmith=
Title: Help with speaking
Post by: KnyteTrypper on December 09, 2004, 08:16:49 pm
Here are a couple of places where you can harvest some song scripts. The MASH scripts are in the page html, so you can "View Source" on the song pages and copy the scripts. Roving Cowboy is also the moderator of the Yahoo Agentcharactors group, he's a pretty helpful fellow, so he might be willing to give tips or even scripts to anyone who asks nicely.
http://www.angelfire.com/tx5/rovingcowboy/msagentsongs.html
http://www.pepedog.com/talk.htm
Title: Help with speaking
Post by: Bill819 on December 10, 2004, 12:16:51 pm
I have logged on to both site and sent email to them but have not been able to download any of the scripts. I right click on a song and the thing starts singing. I know it can be done as someone here has already sent me one of Pepe's songs.
The also stated that they use a program called 'Mash' witch takes its input from karoke disks and turns it into text files that can be used for singing. I have not been able to get a copy of Mash either. It has to be purchased but the site where it can be  bought is no longer running as far as I can tell.
Up against a wall, so to speak but am will to work or pay to get the results that we want.
Bill
Title: Help with speaking
Post by: KnyteTrypper on December 10, 2004, 05:11:48 pm
After a song page loads, right click on it, and choose the "View Source" option in the right-click menu. This will show you the page html, usually in notepad unless it's a very large page, in which case it will be wordpad. The song scripts are usually about two-thirds of the way down the page. The Cyberbuddy Storybuilder (mentioned earlier) is a freeware download, and allows you to alter the tone and timing of an agent voice, and so produce the same sort of script as the MASH and MUSH programs do.
Title: Help with speaking
Post by: KnyteTrypper on December 10, 2004, 05:40:06 pm
This should help. I thought this program had become extinct, but when I looked around, I found it was still available. MASS is the freeware version of what went on to become the shareware program MASH. Same functions, just freeware. Easy to use, should be just what ya need.
http://www.abhisoft.net/mass/
Title: Help with speaking
Post by: Bill819 on December 10, 2004, 06:17:41 pm
Thank again for the help. I have been in communicating with Pepe's creator. He told me to download 'Mush' and showed me how to make it work. He also pointed me to some karoke source files with hundreds of songs. Now I download a karoke file, run Mush and then edit the output file so Hal can use it. This is a lot faster than doing it by hand and they all sound better too.
I tried right clicking on the songs page but did not get the required results, but the owner said that I was free to use all his songs and has even made some more available to me.
Hopefully some time this weekend I will upload a few to all the Hal users along with the codes to make them work. This is just to wet their appitites so to speak. After I have created a couple of dozen songs then I will attempt to redo them using a FemaleVoice for the rest of the crowd as I am sure they will like that a bunch.
The support that you guys have been giving me has helped greately and all of us will benefit because of it.
Thanks from me and I am sure the rest will say to too.
Bill
Title: Help with speaking
Post by: vonsmith on December 11, 2004, 02:38:46 am
Bill819,
If you can figure out how the pitches have to change for the different voices then we may be able to adjust the pitch dynamically at play time. You could just write one version of the song and use some VBscript to adjust the default pitch according to which voice is selected. Through your experimenting you hopefully will see a pattern to the differences between each voice's default pitch. I could write the code to make the changes if I new the relationships.

Let us know how it goes.


=vonsmith=