Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Processing 2 Creative Coding Hotshot.pdf
Скачиваний:
10
Добавлен:
17.03.2016
Размер:
5.28 Mб
Скачать

Project 1

6.Make the path of the system property point to the folder where your mbrola binary and the us1 voice are located.

7.Now you can change the Juliet TTS object to the following:

TTS juliet = new TTS( "mbrola_us1" );

8.You will also need to change the pitch of the voice as mbrola_us1 is already a female voice and we don't need to simulate it anymore.

MBROLA is a text-to-speech engine developed at the Faculte Polytechnique de Mons in Belgium. The author requires every publication that mentions their work to mention their book, An Introduction To Text-To-Speech Synthesis, Thierry Dutoit, Kluwer Academic Publishers, Dordrecht, Hardbound, ISBN 1-4020-0369-2, April 1997, 312 pp.

Building robots

Now we are ready for the final task of our Romeo and Juliet project. We will take some cardboard boxes, Styrofoam spheres, and a pair of cheap speakers or headphones and turn them into our robot-actors.

The robots described in this section are just my version. If you like, you can build them to be completely different and as complex or as simple as you want.

Prepare for Lift Off

To build our robots, we need some materials and tools, which should not be too hard to find. I used the following for my robot-actors:

ff

ff

ff

ff

ff

ff

ff

ff

Two cardboard boxes for the bodies

Two Styrofoam spheres for the heads

A pair of cheap speakers or headphones

Googly eyes

Acrylic paint

Marker pens

Needles

A hot glue gun

23

Romeo and Juliet

The following picture shows the main materials I used for my robots:

Engage Thrusters

Let's build some robots:

1.Disassemble your speakers and try to get rid of the body. We only need the speakers, but make sure you don't remove or destroy the cables.

2.Cut a hole into your cardboard boxes where the speakers should go. Make the holes a bit smaller than the speakers, as shown in the following picture, because we need to glue them to the box later:

24

Project 1

3.Paint your cardboard boxes. I made one white and the other green.

4.While the boxes are drying, paint some hair on the heads like in the following picture. I made Romeo-Robot's hair black and Juliet-Robot's hair brown.

5.After the paint has dried, fix the speakers to the cardboard box using some hot glue, as shown in the following picture. Make sure you don't get any glue on the membrane of your speakers.

25

Romeo and Juliet

6.Now use some markers to draw a face for the robots. You can see the faces of my robots in the following picture:

7.Use a needle to attach the heads to the bodies of the robots.

8.Now connect your robot-actors to your sound card and place Juliet on a balcony (for example an empty shoe-box) and make them act.

Objective Complete - Mini Debriefing

In this task, we completed our robot-actors by building bodies for them. We used some cardboard boxes, painted them, and added a cheap pair of speakers by gluing them into the boxes. Each robot got a head made of a painted Styrofoam sphere.

As I already said in the introduction to this task, there is no right or wrong way to build your robots. Build them as small or as big as you like. Add some hair, make them a nose, sew a dress for Juliet, draw Romeo a mustache, and so on.

Mission Accomplished

In this mission, we added speaking capabilities to Processing by installing the ttslib library. We learned how to simulate multiple speakers by changing the pitch of voice or installing an additional TTS engine on Linux.

We also defined a speak text format for the Shakespeare script to make parsing easier and created a Drama thread that manages our text lines and controls our robots.

26

Project 1

We completed our robot-actors, and they are eagerly waiting to perform in front of an audience. So gather your friends and family and make your robots a stage. They will love it, trust me. Well, at least your robots will love it, as you can see in the following picture:

You Ready to go Gung HO? A Hotshot

Challenge

Now that you have completed building your robot-actors, why don't you try to take them to the next level?

ff

ff

ff

ff ff ff

Make them perform different plays. There are plenty of famous dialogs out there that could be performed by your robot-actors.

Currently your robot-actors are stationary. Try to add some servo motors and make them move their heads using an Arduino.

Connect some webcams to your computer and use Processing to record some videos of the performances from different angles.

Make your robot-actors perform a play with a real actor.

Make your robots read live input from the Web such as Twitter feeds or the news.

Your robots don't have to look like humans; make them look like zombies, aliens, animals, and so on.

27

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]