default rate. If your computer speaks a little faster or slower than the
animation, adjust the value of 55 slightly to achieve proper results.
Even though the animation algorithm is simple and easy to implement,
the effect on a person interacting with your robot can be powerful. When
the mouth moves as expected, the illusion of life is far greater than with
the voice alone.
Figure 8 shows the subroutines for initializing speech and creating the
various mouth movements, as well as routines for moving the eyes,
producing a frown, etc. Just making your robot look right and left, for
example, when its perimeter sensors detect an object on that side of it can
change how people view your creation far more than you might imagine. If
50 SERVO 03.2014
Figure 5.
Figure 7.
Figure 6.
InitAnimateSay: SpeechDelay=0 MaxWords= 20 Dim words[MaxWords] VowelState=false // draw nose LineWidth 1 arc 360,320,440,340, 2. 9, 3. 65, 3,darkgray line 372,323,390,260, 3,darkgray line 425,322,410,260, 3,darkgray //cheeks arc 200,330,350,200, 4. 5,1.3, 2,gray arc 600,330,450,200, 3. 6,1.3, 2,gray // brows line 240,180,300,170, 5 lineto 350,175, 5 line 560,180,500,170, 5 lineto 450,175, 5 gosub EyesNorm gosub Smile return EyesRight: LineWidth 15 circle 250,200,350,250 circle 450,200,550,250 LineWidth 5 er= 20 circle 315-er,225-er,315+er,225+er,blue, lightblue circle 515-er,225-er,515+er,225+er,blue, lightblue er= 10 circle 315-er,225-er,315+er,225+er,black,black circle 515-er,225-er,515+er,225+er,black,black LineWidth 15 arc 250,200,350,250 arc 450,200,550,250 return EyesLeft: LineWidth 15 circle 250,200,350,250 circle 450,200,550,250 LineWidth 5 er= 20 circle 285-er,225-er,285+er,225+er,blue, lightblue circle 485-er,225-er,485+er,225+er,blue, lightblue er= 10 circle 285-er,225-er,285+er,225+er,black,black circle 485-er,225-er,485+er,225+er,black,black LineWidth 15 arc 250,200,350,250 arc 450,200,550,250 return sub IsVowel(c,&answer) if c="a" or c="e" or c="i" or c="o" or c="u" or c="y" answer= true else answer= false endif return Smile: linewidth 20 rectangle 290,390,510,450,White,White line 300,395,320,400 lineto 480,400 lineto 500,395 return Normal: linewidth 20 rectangle 290,390,510,450,White,White line 300,400,500,400 return Frown: linewidth 20 rectangle 290,390,510,450,White,White line 300,405,320,400 lineto 480,400 lineto 500,405 return Constant: linewidth 10 rectangle 290,390,510,450,White,White circle 300,400,500,410,black,red delay _SpeechDelay return Vsound: linewidth 10 rectangle 300,390,500,440,White,White //circle 300,395,500,430,black,red arc 320,390,480,405, 3.1633, 3.09 arc 320,390,480,430, 3.1, 3. 22 floodfill2 400,410,red delay 2*_SpeechDelay return Osound: linewidth 10 rectangle 290,380,510,450,White,White circle 320,400,480,410,black,red delay _SpeechDelay/2 rectangle 290,380,510,450,White,White circle 350,395,450,420,black,red delay _SpeechDelay* 2 rectangle 290,380,510,450,White,White circle 320,400,480,410,black,red delay _SpeechDelay/2 return Figure 8.