Game Development Community

disable or modify dopple shift in TGEA 1.8.x

by Zachary Seldess · in Torque Game Engine Advanced · 07/06/2009 (5:50 pm) · 7 replies

Hello everyone,

Simple questions, and I bet there is a simple answer:

How do I disable or modify the amount of pitch shift that occurs with SFXEmitters set to 3D. I can't find any exposed properties for it, and the documentation is non-existent. I'm guessing it's in the engine code somewhere, but after looking for a bit (and searching the forums), I've had no luck.

best,
Zachary

#1
07/07/2009 (4:44 am)
Just to be totally clear, this pitch shift is occurring when my avatar WALKS in the space - this isn't just a vehicle behavior. Walking away from the SFXEmitter shifts the pitch of the file down about 1 whole-step, and vice versa when walking towards it. This is hideous sounding, and I need to get rid of the behavior. It doesn't occur in TGE. I've tested in TGEA 1.8 using OpenAL and FMod (on Mac OSX Leopard) the same ugly doppler shift occurs regardless.

Does anyone have any ideas, or do I need to revert back to TGE (which would be very disappointing)? I cannot upgrade to T3D just to fix this problem. I bought TGEA originally just for the integrated FMod functionality (I'm a composer using Torque as an environment for interactive sound installations), so to encounter audio bugs such as this is a bit disheartening.

Someone must have encountered this behavior other than myself. I can't find any mention of it in the forums though. Any help would be greatly appreciated. I'm at a loss.

best,
Zachary
#2
07/09/2009 (7:56 am)
Ok, here's a video demonstrating the problem. I downloaded a fresh version of TGEA 1.8.1 for Mac, didn't modify anything in the engine. The problem persists ONLY when the camera is attached to the avatar. If I disconnect the camera from the avatar, the pitch shifting doesn't occur.

Someone at GG, any help? See the video for a short and clear example:

http://www.zacharyseldess.com/sampleVids/TGEA_dopplerBug.mov

best,
Zachary
#3
07/09/2009 (11:30 am)

Just to confirm this in this thread also:

Confirmed and logged as THREED-572.

BTW, this must have been one of the best reports here ever. A video that explains and shows a problem step by step with commentary. Wow!
#4
07/09/2009 (11:45 am)
Thanks for getting back to me on this Rene. I hope it's an easy and quick fix! ;)

Honestly though, I'd really love to use TGEA for an upcoming sound art installation in 3 weeks, but for now, until this little pitch-shift thing goes away, I'll just have to stick with TGE.

best,
Zachary
#5
07/09/2009 (12:14 pm)

Yep, hope to have this fixed real, real quick. However, no promises this time. I've been *badly* surprised recently with some stuff that looked so easy and turned into long arduous chases through the codebase (or long arduous stares at useless docs and ugly reboot screens... thanks, Apple, for that!).
#6
07/10/2009 (12:52 pm)

Ok, stumbled across a bunch of other bugs on the way, but got this one, too.

The culprit is the doppler factor used by the devices. DirectSound uses a lower default doppler factor (0.75) and thus does not show this issue. All the other devices use a higher default doppler factor of 1.0 giving a pretty pronounced effect.

I will lower all defaults to 0.75 and also expose this setting through script.

The reason why having a free-flying camera is different to having a player view is that the free-flying camera for some reason always has a (0,0,0) velocity. Thus no doppler here.

For a temp fix, go to game.cpp and comment out the line that says:

SFX->getListener().setVelocity(velocity);

This disables all velocity-based 3D sound computations.
#7
07/10/2009 (1:35 pm)

Oopss... just remembered I'm in TGEA-land here.

The above change will solve the problem but disable all velocity-based computations. To just adjust the doppler effect:

a) for FMOD, go into sfx/fmod/sfxFMODDevice.cpp and adjust the values for the call to FMOD_System_Set3DSettings(). The three 1.0f floats are doppler, distance, and rolloff factor.

b) for OpenAL, go into sfx/openal/sfxALDevice.cpp and in the device creation function, add a line

mOpenAL.alDopplerFactor( 0.5f ); // or whatever you want