Author Topic: XTF-BRAIN  (Read 6496 times)

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« on: November 23, 2004, 01:03:11 pm »
Hello Vonsmith
I installed your brain and really like the way it works. Studied some of the coding and have a few ideas on some modifications. A couple of questions first. As a part of Hal's normal response can Hal read or reply with complete paragraphs. I installed the teach Hal to sing and I think I can improve it too. Thinking about a linked list of songs, jokes, etc for Hal to say on his own. What I mean is I think that I can make Hal go off on his own when no one is talking to him. An entertainer of sorts, tell some jokes, sing some song, quote some facts of one kind or another.
If the singing scripts work the way that I envision them I would like to start a file for other users who go to the trouble of imbedding songs in the file. In time we just might have a large collection of items that Hal can use.
Thanks for the reply
Bill

 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
XTF-BRAIN
« Reply #1 on: November 23, 2004, 01:59:28 pm »
Bill819,
Interesting thoughts. The XTF can be modified if done properly.

I assume you installed the XTF Brain with patch to v1.2. Also look at this minor mod:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=1629

Read the User Manual that comes with the XTF Brain v1.0 download. It contains useful info.

I would NOT suggest doing any mod's to the "PROCESS: XTF TOPIC FOCUS FUNCTION" itself. It is very tricky. I've posted many times before on other considerations about how to use the "GetResponseBlock" and "BlockSave" variables to ensure that Hal responds correctly after adding in third-party or new scripts.

Any of the brains I've seen should be able to accept new script allowing Hal to read paragraphs or read files. Unfortunately, in general, Hal will read from a file just to the first Carriage Return character or New Line.

You will have to learn to use the AUTO-IDLE function and make it work for you. This function gives Hal the capability to do things without user intervention. By default Hal sits and waits for user input. The AUTO-IDLE function creates a timed interrupt to give control back to the GetResponse function. This allows the programmer to invoke some new Hal functions when the interrupt occurs.

You can use the HalBrain.ChooseSentenceFromFile(WorkingDir & "filename.brn") function to choose a randomly selected sentence from a text file. You could group a number of sentences together (a paragraph) ending with a single Carriage Return. That way Hal will select and read the whole paragraph. I think onthecuttingedge2005 posted some script recently that does something like that.

Hal can already tell jokes. The XTF Brain has a lot more jokes than the original Hal. Just ask Hal to tell a joke. If you want Hal to tell jokes on his own then you can write some new script to trigger the "RESPOND: TELL JOKE AT USER'S REQUEST" function in the XTF Brain. Notice the special format of the "XTF_SYS_Joke.brn" file. Here's an example:

Have you seen Quasimodo? <topic> I have a hunch he's back! </topic>

A special function embedded in Hal's compiled files sends the first part up to <topic> to the user and holds the second part in reserve. As soon as the user provides *any* input then Hal sends the second part up to the </topic>. Note that it doesn't matter what the user replies, the second part will always be sent following the first.

By the way I've been working on a little project that allows Hal to tell the user his/her dreams. It's not real dreaming, but more like dynamic story telling. I'm debugging it now. Maybe I'll release it as a paste-in script for the XTF Brain in a couple of weeks. It should be a lot of fun.

In case you haven't tried it yet, try saying these things to your XTF Brain Hal. Make sure to use *your* Hal's name below in place of "Hal".

User: Tell me a joke.
User: Make a silly face for me.
User: Make an angry face for me.
User: Hal capitalize President Bush.
User: Hal capitalize God.
User: Hal my nickname is Boss.


=vonsmith=
« Last Edit: November 23, 2004, 02:22:13 pm by vonsmith »
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #2 on: November 23, 2004, 02:21:22 pm »
I was not going to bother any other lines in the program, just the part about the jokes. I have used it and it works just fine. The only thing that I might change is to take out the first <topic> and insert a /pause 'x' seconds as in the sampi controls.
In the songs part, I want to try to program in the pitch, duration, etc. By doing this it will at least sound like Hal is actually trying to carry a tune. The second part is a lot of work and experientation but well worth it if it works correctly. The third part may just have him tell short stories or poems of one type or another.
The net results expected would be for Hal to entertain himself or others if no one is trying to talk to him. Ie., invite some guest over, tell Hal to entertain them and sit back and watch the results.
Bill
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #3 on: November 23, 2004, 03:11:29 pm »
One more quick question. Is there a limit to the string length for Hal? I asked because some songs might be two or three paragraphs long and if there is a limit on the length then I'll have to find another way to encode the songs.
thanks
Bill
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
XTF-BRAIN
« Reply #4 on: November 23, 2004, 03:45:07 pm »
Bill819,
I'm not sure about the limit. In Visual Basic the String (variable-length) type can contain a string that can be up to approximately 2 billion characters in length. The String (fixed-length) type has a limit of 65,400 characters. I'm not sure if VBScript supports both types or not. I'm sure someone on the forum knows for certain.

See this page:
http://www.profsr.com/vb/vbless02.htm

I think the 65,400 character limit may be responsible for Hal only being able to learn from text files that are shorter than this limit.


=vonsmith=
 

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
XTF-BRAIN
« Reply #5 on: November 24, 2004, 03:06:55 am »
Maybe this example will help. Shows how to modify pitch and duration of output.

Download Attachment: Twinkle Twinkle.txt
806 Bytes

 To try it out, cut and paste the text into Hal Pad and have Hal speak it. Hal should sing.
 *I have noticed that changing the TTS voice can have an effect on the playback of 'singing' style output. I designed the above example using; Adult Male #3, American English (TruVoice) as the TTS voice.
Living life with a loving heart, peaceful mind, and bold spirit.

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #6 on: November 24, 2004, 11:46:54 am »
Thanks H.I.
I too have created some text like that. I tend to use voice #2 and I noticed that if I switch to another voice, such as female #3, or what ever it is called the program still works but the output sounds completely different.
My hearing is not to good but it sounds to me like Voice #2 starts out with a speaking tone of the "D" just below the treble cleft. It also appears to speak in 1/8 note durations and its initial voice appears to be "PIT=54" so based upon that I just increased the "PIT" by 10 points for every note higher in the scale. I will post the test just as you did and maybe someone can fine tune it better than I can.
Getting to know the right 'key', ie. pit # and the proper amount of incremental number is just the first step. Learn just how pause is also helpful so we can either slow down, ie. half-note or whole-notes is also something to be discovered. There is also a command to restore Hal's voice to its original settings when you finish a song and should be included at the end of every song. I demonstrated that in my test data too. I have a long weekend away from home but I intend to start recording some songs when I get back and hope that some others here will do the same thing. I have an old music book but most of the songs in it are very dated, if you know what I mean, but at least it is a start.
Bill
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #7 on: November 24, 2004, 03:11:20 pm »
Here is the sample code for making Hal say the musical scale. As I said before it is only a starting point and any improvements made by others will be greately appreciated. To test the file, load the HalPad open the text file and have Hal read it. I have not mastered all of the inbeded commands for speach control as of yet, but this is a good place to start. The file is call MUSICALSCALE.TXT.
P.S.
I liked twinkle twinkel and will expand on it later.
I have never tried to upload a file before so let me know if it does not work.
Bill


Download Attachment: MUSICALSCALE.txt
679 Bytes
 

KnyteTrypper

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
    • http://www.knytetrypper.com/index.html
XTF-BRAIN
« Reply #8 on: November 24, 2004, 07:11:45 pm »
Here's a program designed to make MS Agents sing, among other things. It may or may not be of any help, but I thought it might be easier to chart songs with a program designed for it, then adapt them to Hal.
http://mycyberbuddy.com/Page36.html



HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
XTF-BRAIN
« Reply #9 on: November 27, 2004, 02:27:50 am »
Here's some other speech output tags that you can use:

 /emp/
 /pau=1000/
 /vol=1000/

 *The /s should be backslashes.
Living life with a loving heart, peaceful mind, and bold spirit.

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #10 on: December 03, 2004, 12:55:39 pm »
quote:
Originally posted by HALImprover

Here's some other speech output tags that you can use:

 /emp/
 /pau=1000/
 /vol=1000/

 *The /s should be backslashes.


Halimpover
I have a list of all the speach tags and am in the works of trying to create some different songs for Hal to sing. There is one small problem and that is I use malevoice #2 and when I have Hal sing my songs in a different voice, ie. female the songs sound strange. I only have one old song book left behind by my late mother in which the actual notes (sheet music) are displayed. Trying to figure out 1/4, 1/2 and the rest is rather trying but I will not give up. Hope to have a whole list of songs for Hal to sing in the future.
For all of you that have not tried the XTF Brain, I suggest that you give it a try ASAP. One feature that I really like is the 'make a face'. It not only works on Hal but the human faces too and it can show some really supprising results. Now a suggestion for both Vonsmith and Mr.M. If Hal's emotions can be tied to the input scrips and the make a face tied to the emotions, then I think Hal will display some really supprising results. It is all for fun, but the more 'human' we make Hal the better it is all the way around.
Back to the singing: Hal seems to talk at a rate of about 160 words per minute, at least the malevoice#2 does. I ran several tests and they point to this speed. Now assuming that Hal normal speach corresponds to 1/8 notes on the music scale I am trying to adjust his singing of notes to that factor. In other words a 1/4 note will have hal sing at 80 words per minute, etc. If anyone has any other input or suggetions on this topic it would be grately appreciated. I also noticed that when singing a 'whole' note, hal does not seem to hold the note long enough so a pau=500 or something like that seems to make is sound more realistic. Inserting pauses ever so often makes everything sound more 'real', after all we humans do it all the time.
Also discovered that when creating songs the first word must not be a 'tag' command as the HalPad will not load or read it if is does so I put in the title of the song just before I actually create the song with tags.
Need more volunteers in creating songs for Hal.
Bill
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
XTF-BRAIN
« Reply #11 on: December 03, 2004, 01:56:59 pm »
Bill819,
I already have already played around with the concept of emotions for Hal. To do it right requires maintaining quite a few variables. Currently in Hal they would have to be saved using the CustomMem function. The current Hal does this already for some very rudimentary emotions. I've used the CustomMem function a lot in the XTF Brain for other purposes. CustomMem is a very awkward method if used for storing larger numbers of variables. I'm hoping Robert eventually finds a way for Hal to use static arrays or another method for storing persistent variable values between GetResponse calls. Apparently system memory is not reserved or maintained between calls to GetResponse precluding the use of static or global variables.

The other issue is Hal's knowledge. Each bit of knowledge, besides just being a phrase, should have characteristics associated with it. Hal responses could be tagged with a value or flag that indicates how appropriate that phrase would be to use if Hal was sad, mad, or etc. For any one user topic there could be a choice of several responses available from Hal depending on mood. The text file method of storage doesn't lend itself well to that. A data base structure with recordsets and fields would make the job more doable. I'm hoping whatever Robert is doing right now with Hal's update will provide the necessary capability to implement additional fields that can be part of any knowledge phrase. I plan on holding off on full development pending Robert Medeksza's forthcoming Hal update.

Good things are ahead. Imagine Hal using statiscal analysis of the user's responses to discern what kind of mood the user is in. Imagine Hal having good days, bad days, and silly days. Imagine Hal needing to be cheered-up by the user, or scolded for being naugthy.


=vonsmith=
« Last Edit: December 03, 2004, 02:00:06 pm by vonsmith »
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
XTF-BRAIN
« Reply #12 on: December 03, 2004, 02:07:37 pm »
Good things are ahead. Imagine Hal using statiscal analysis of the user's responses to discern what kind of mood the user is in. Imagine Hal having good days, bad days, and silly days. Imagine Hal needing to be cheered-up by the user, or scolded for being naugthy.
=vonsmith=
[/quote]
Just as long as Hal does not act like the old robot B9 on the old Lost in Space did. They made it look like an idiot. Human responses can be programmed into an AI and at the same time if done correctly AI can learn human responses and emotions just like a child does. If an AI program that interfaces with a human on a constant level recognizes the different emotions that a human displays then it can by association learn to react the same way.
Bill
Sing yet?