Game Engine - 3D Sound Actuator - maximum distance bug #32449

Closed
opened 2012-08-30 19:41:13 +02:00 by Karja Krähwald · 7 comments

Category: Audio

%%%Conditions:
An Object with 3D sound music moves endless away from the camera.
You will recognize a decrease of loudness.

Lets say you want it to be complete unhearable at the range of 10 and above.
Object with Sound

  • Distance: 1 5 10 15 20
  • Loudness: 1,0 0,5 0,0 0,0 0,0
    You see the option "max distance at which you can hear the sound" and set it to 10.

Unfortunately this doesnt work correct.

  • You can still hear it, no matter how far it goes.
    So whats the problem, what does the setting instead:

Pictorially, the sound of the object can not pass the distance of 10 (referring to the camera).
Object with Sound

  • Distance: 1 5 10 15 20 25 30
  • Loudness: 1,0 0,75 0,5 0,5 0,5 0,5 and so on

Its just an example, the fadeout isnt linear and will never reach zero.
Its more like 1,0 - 0,76 - 0,57 - 0,29 ... (curve)
Have tryed a lot. Even With high rolloff its impossible to get a good/smooth fadeout
when it always fades to infinity.

Attached file:

  • Play around with the maximum distance to see.
    Most noticable: =1 it wont get lower, =20 sound becomes more quiet, but stops at this distance
  • Load a Soundfile
  • Start Game Engine%%%
**Category**: Audio %%%Conditions: An Object with 3D sound music moves endless away from the camera. You will recognize a decrease of loudness. Lets say you want it to be complete unhearable at the range of 10 and above. Object with Sound - Distance: 1 5 10 15 20 - Loudness: 1,0 0,5 0,0 0,0 0,0 You see the option "max distance at which you can hear the sound" and set it to 10. Unfortunately this doesnt work correct. - > You can still hear it, no matter how far it goes. So whats the problem, what does the setting instead: Pictorially, the sound of the object can not pass the distance of 10 (referring to the camera). Object with Sound - Distance: 1 5 10 15 20 25 30 - Loudness: 1,0 0,75 0,5 0,5 0,5 0,5 and so on Its just an example, the fadeout isnt linear and will never reach zero. Its more like 1,0 - 0,76 - 0,57 - 0,29 ... (curve) Have tryed a lot. Even With high rolloff its impossible to get a good/smooth fadeout when it always fades to infinity. Attached file: - Play around with the maximum distance to see. Most noticable: =1 it wont get lower, =20 sound becomes more quiet, but stops at this distance - Load a Soundfile - Start Game Engine%%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%Moved from Blender 2.6 Bug Tracker to Game Engine%%%

%%%Moved from Blender 2.6 Bug Tracker to Game Engine%%%
Member

%%%I made some experiments with the sound actuator today, here is some tricks I found :

for the fade issue :
in the scene properties, setup the Listener dropdown to linear clamped

max distance value is not in blender units.
max distance in BU is actually a function using the rolloff and the maxDist values.

the greater the rolloff value, the better the granularity of the volume falloff
rolloff = 200 (enter the value by hand since soft limit is 5) gives good result I think.

if you want volume = 0 at a +- 10BU distance with a good granularity you can setup like this :
ref distance 0.5
max distance 2000
rolloff 200

here's a function Im working on that returns an acceptable value for maxdistance (would need more tuning for very short distances), given the distance you don't want to hear the sound anymore.
constant : ref distance = 0.5 and rolloff = 200

from math import tanh

def soundMaxDistance(m) :

  m = max(1,m)
  f = tanh(m-1)**5
  return  m * (100 + ( 100 * f))

distances = [1.0,2.5,4.5,9,45.5,100.5,10.0]
print()
for d in distances :

  print(' %s : %s'%(d,soundMaxDistance(d)))%%%
%%%I made some experiments with the sound actuator today, here is some tricks I found : for the fade issue : in the scene properties, setup the Listener dropdown to linear clamped max distance value is not in blender units. max distance in BU is actually a function using the rolloff and the maxDist values. the greater the rolloff value, the better the granularity of the volume falloff rolloff = 200 (enter the value by hand since soft limit is 5) gives good result I think. if you want volume = 0 at a +- 10BU distance with a good granularity you can setup like this : ref distance 0.5 max distance 2000 rolloff 200 here's a function Im working on that returns an acceptable value for maxdistance (would need more tuning for very short distances), given the distance you don't want to hear the sound anymore. constant : ref distance = 0.5 and rolloff = 200 from math import tanh def soundMaxDistance(m) : ``` m = max(1,m) f = tanh(m-1)**5 return m * (100 + ( 100 * f)) ``` distances = [1.0,2.5,4.5,9,45.5,100.5,10.0] print() for d in distances : ``` print(' %s : %s'%(d,soundMaxDistance(d)))%%%
Member
%%%http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835817 %%%

%%%Hi Joerg, do you think you could take a look at this? thanks%%%

%%%Hi Joerg, do you think you could take a look at this? thanks%%%
Member

%%%Hi!

Jerome actually posted the solution himself, this is how the distance models work: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864

Is there any bug? If yes please explain only the bug and reopen the report, I'm closing meanwhile.

Regards%%%

%%%Hi! Jerome actually posted the solution himself, this is how the distance models work: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864 Is there any bug? If yes please explain only the bug and reopen the report, I'm closing meanwhile. Regards%%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#32449
No description provided.