________________________________________
VRHOTWIRES
DIRECTIONAL SOUND TOOL
________________________________________
version 2.0
Directional Sound
-------------------------------------
Directional sound is for panoramas, so a sound gets louder when you pan towards it.
As well the right left audio 'pan' is changed as you pan.
Ok let's add the sound track in the movie 'glass.mov' to the vr, and make
it directional.
------------------------------------
Remember, the vrhotwires directional sound tool uses calls that require
at least qt5.
Tutorial 1: 1 Directionals Sound
Steps to make the movie 1dirsnd.mov
(by Anders Jiras)
First download the pano andersPlane.mov
now a sound track : drums.mov
-First open vrhtowires.
-drag the vr movie called andersPlane.mov
' onto the open movie window.
-now under the 'tools' menu choose directional sound.
-when the tool opens, you'll notice that when you pan, the numbers
change in the ‘Play loudest when panned to’ field...showing you your current
pan angle as a numerical value.
-drag your sound track, drums.mov onto the qtvr.
-pan the vr to where you want the sound to eminate from.
-(adjust the slider for the width of the cone of sound if you want...)
-set minimum when panned away if you want. Try zero to really get a feel
for the directional on/off.
-press APPLY
It should be done. When you pan the movie away you should hear the
directional sound.
If something doesn't work, check the
1dirsnd.mov
movie and compare...
More than one directional sound in the pano will work simply ...
as a second turial we'll make a 4 dir snd movie like this :
If you're interested in the script take a look by pressing command r.
(read it!)
THIS TOOL REQUIRES QUICKTIME 5 !!!!!
This is the c code it is based on .
Note tim's comments.
the vol angle is the width of the cone
and kNoVolume is the min here.
thePan is the loudest location
//////////
//
// VRMoov_SetOneBalanceAndVolume
// Set the balance and volume attenuation of an embedded QuickTime
movie.
//
//////////
void VRMoov_SetOneBalanceAndVolume (Movie theMovie, MediaHandler theMediaHandler,
float thePan, float theTilt, float theMoviePan, float theVolAngle)
{
#pragma unused(theTilt)
short myValue;
float myPanDelta;
float myCosDelta; // cosine of pan angle delta from movie center
float myCosLimit; // cosine of attenuation cone limit angle
myPanDelta = thePan - theMoviePan;
// ***set the balance
myValue = kQTMaxSoundVolume * sin(myPanDelta);
MediaSetSoundBalance(theMediaHandler, myValue);
// ***set the volume
myCosDelta = cos(myPanDelta);
myCosLimit = cos(theVolAngle);
if (myCosDelta >= myCosLimit)
// inside cone of attenuation, volume scales from 1.0 (at center)
to 0.0 (at cone edge)
myValue = kQTMaxSoundVolume * ((myCosDelta - myCosLimit) / (1 - myCosLimit));
else
// outside cone of attenuation, volume is 0.0;
myValue = kNoVolume;
if (myValue != GetMovieVolume(theMovie))
SetMovieVolume(theMovie, myValue);
}
If you look at the vrnacular script of the directional sound you’ll
see something very similar to the c code above... Even the variable names
(set with the //define statements at the top, are the same... )
Check out 2 Cool new Macros for directional Sound!
IdleDirSound is the same algo as above, but it allows multiple dir
sounds at once!
Also the Point Sound macro for placing sounds in cubics...
A ZoomToSound and ZoomFromSound macro is around too... not quite finished,
but
it’s great for simulating getting louder when you zoom towards or away
from something...
Tutorial 2: 4 Directionals Sound
Steps to make the movie anderDirsnd.mov
(by Anders Jiras)
First download the pano andersPlane.mov
now 4 sound track2 :
drums.mov
Violas.mov
bass.mov
rhodes.mov
STEPS:
-First open vrhtowires.
-drag the vr movie called
andersPlane.mov
' onto the open movie window.
-now under the 'tools' menu choose directional sound.
-when the tool opens, you'll notice that when you pan, the numbers
change in the ‘Play loudest when panned to’ field...showing you your current
pan angle as a numerical value.
FOR EACH OF THE 4 SOUND TRACKS DO THESE STEPS:
-drag your sound track, onto the qtvr.
-pan the vr to where you want the sound to eminate from.
-(adjust the slider for the width of the cone of sound if you want...)
-set minimum when panned away if you want. Try zero to really get a feel
for the directional on/off.
-press APPLY
It should be done. When you pan the movie away you should hear the
directional sound.
If something doesn't work, check the
anderDirsnd.mov
movie and compare...
More than one directional sound in the pano will work simply ...
as a second turial we'll make a 4 dir snd movie like this :