Try It! Creating an Event Sound

An event sound is associated with something that happens in a scene--for example, a door banging as it closes or a pot falling off a table and crashing on the floor. An event sound usually requires a script to synchronize the sound with the accompanying action.

The following file contains an example of an event sound and a simple script:

/usr/share/Insight/library/SGI_bookshelves/Help/books/CosmoWorlds_UG/Models/doorSample.wrl

Click here to preview the file. Click the door to make it close. Notice how the sound occurs at the end of the door's swing cycle, just when it is in the closed position. The touch sensor's start time is routed to a script, which adds a delay of 1.8 seconds to produce the start time for the door sound. The door animation is also triggered by a touch sensor.

To view this file and examine the routes in the Outline Editor, click here. (The blue routes are for the door animation. The black routes are for the sound.)

Steps for Creating an Event Sound

Follow these steps to create an event sound (refer to the example file doorSample.wrl to help you get started):

  1. In Cosmo Worlds, open the file /usr/share/Insight/library/SGI_bookshelves/Help/books/CosmoWorlds_UG/Models/door.wrl

    This file contains the house and door model as well as a keyframe animation that opens and closes the door.

  2. Click the Sound Editor button on the Editors palette.

  3. Select the door, which is the object associated with the event.

  4. In the Sound Editor, click the Create Local button. (If the button is grayed out, choose Edit > Create Parent Group to enable the Create Local button.)

  5. Click the Browse button and choose a sound file to add to the scene. Click OK.

  6. The sound is named Sound1 by default. Type a new name for your sound in the text field--for example, doorSlam.

  7. Use the green sound icon to position the sound at the site of the slamming door. The sound icon can be positioned and rotated in the same way as the standard manipulator. (If the icon is not visible, choose View > Show/Hide Iconic Objects > Show Sounds.)

  8. Type new range values into the text fields for Max Front, Max Back, Min Front, and Min Back. To check the range of the sound, click the Show Range box. A wireframe sphere indicates the range of the sound.

    In the door example, notice how the sound range is mostly in front of the door. Also, because the sound range is not spherical, the range values need to be typed into the fields (that is, you can't simply use the thumbwheel).

    Tip: If you want to create a sound range with a shape not directly supported by the Sound Editor, you can choose Edit > Create Parent Group to create a Transform grouping node above the sound node. Then, in the Outline Editor, you can scale the Sound to create a different shape, such as a flattened ellipsoid.

  9. Use the default settings for spatialization (on) and looping (off).

  10. Click the Create Trigger to Activate Clip button to create a trigger for the sound. Event sounds are typically triggered by a touch sensor, a collision node, or a proximity sensor. (The door example uses a touch sensor.)

  11. If you want to synchronize the sound with something other than the start time of the sensor, write a script that builds in the proper timing of the sound with the event. The door example uses a script to delay the noise until the door is almost closed.

  12. Click the arrow button to preview the sound.

Jump to: