Applying Randomization to Motion Paths
As the bird flies around the Scene, you may want to create some slight variance to the path. To accomplish this, you can add a randomization value to the X, Y, or Z coordinates. Each time the Object travels on the path, a slightly different value will be created for the destination motion point. That new value is an offset that won’t exceed the random value you indicate.
- In the Position area, set the Randomness value for the X, Y and Z coordinate to .5 meters.
Now each time the bird flies on this path, it will fly within a half meter of variance from the path defined in the motion path list.
- Play the Scene multiple times.
You can see that each time you play the Scene, the Object representing the flying bird takes a slightly different path each time, resulting in a natural effect.
Applying Doppler Effect
An extremely important aspect of conveying the movement of a sound emitting Object is the acoustic principle called Doppler effect. As a sound-emitting Object moves closer to a listener, it causes a subtle rise of the sound's pitch. If the Object moves away from the listener, the pitch will subtly get lower. These pitch changes only occur when there is movement. This is easy to hear as an approaching train honks its horn and continues to honk as it passes. The horn’s pitch is constant, but the movement of the train causes the Doppler effect. Spatial accounts for this phenomenon and its use can significantly increase the realistic perception of a moving sound source.
To exercise the use of the Doppler effect, imagine that high above the aviary, a small propeller plane flies over the park.
- From the Lesson 5 folder, import Airplane.wav sound as an Object.
The plan appears in the center of the Scene at ground level. That’s ok for now.
- Solo the plane and play the Scene.
Notice that the plane sound has a droning sound at a specific pitch that is unwavering.
You’ll now create a motion path to give the plane flight, but at a very low altitude of 20 meters.
- Position the plane to fly very low at the far rear of the Scene. (0, -100, 20)
This low altitude will exaggerate the Doppler effect.
- Add a motion point to the plane at 0, 100, 20and set the speed of the plane at 45 meters per second and play the Scene.
The plane flies from back to front. You hear the position change, but you don’t hear a change in pitch.
To enable the Doppler effect, you must add it as an effect, but this is not the same as Distance effects. Conventional audio effects are configured in the Effects area of the Inspector.
- In the Effects area click the [+] symbol.
A new effect appears called Pitch. The Pitch effect is for offsetting the pitch of a sound, but this is a static change. To allow for the Dopplereffect, there’s a specific effect type called Doppler.
- Change the effect Type to Doppler.
With Doppler now configured, you see an intensity value to the far right. This can be used to exaggerate the effect. To make it more noticeable, increase the Intensity value.
- Change the Intensity value to 10 and play the Scene.
You hear the plane swoop through the Scene with the pitch rising as it approaches the center of the Scene and then the pitch falls as it moves beyond the center of the Scene. The pitch change is currently too much, to the point of being silly. A value of 1.0 is a setting that resembles the Doppler effect in nature.
- Change the Intensity to be more natural. 1.0 and play the Scene.
This sounds much more natural, but the plane is flying way too low! Raise the plane’s altitude and listen again.
- Change the Z axis on both Motion Points to 100.
Now you hear the plane high in the air and the Doppler effect makes it sound believable!
Depending on your Distance Effect settings, you may notice that the doppler effect unnaturally stops after the motion path ends. This is the intended behavior as doppler only applies to moving Objects.
- Open your Distance Effects and change the Amplitude Falloff value to be 1.2.
Now the Airplane should fade in, fly over and fade out as it gets farther away.
You have reached the end of Lesson 5.