# Logarithmic falloff formula

**URL:** <https://qa.fmod.com/t/logarithmic-falloff-formula/11590>\
**Category:** FMOD Engine\
**Created:** [August 3, 2014, 6:31am UTC](https://qa.fmod.com/t/logarithmic-falloff-formula/11590 "2014-08-03T06:31:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonwil](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jonwil](https://qa.fmod.com/u/jonwil)\
**Post date:** [August 3, 2014, 6:31am UTC](https://qa.fmod.com/t/logarithmic-falloff-formula/11590/1 "2014-08-03T06:31:49Z")

</div>

Is there any documentation of the math used for calculating logarithmic falloff in FMOD (i.e. given distance, min distance and max distance, this is how it will arrive at the actual volume number)?

I found this one for linear falloff which is great  
[http://52.88.2.202/questions/question/forum-40378](http://52.88.2.202/questions/question/forum-40378)  
but I need logarithmic falloff. I am trying to port code from an old audio system that works like this:  
from 0 to mindistance sound is at 100%  
For each doubling of distance after mindistance volume is halved  
When it hits maxdistance, sound cuts off.

I know the recommended way to go is to simply have a massive maxdistance and let fmod taper off until its inaudible but that wont work for what I am doing. Nor will linear falloff (or linear squared falloff).  
Seems like the best way to do what I want (and what others in the past seem to have asked for) is a custom FMOD\_3D\_ROLLOFF\_CALLBACK that replicates what FMOD\_3D\_LINEARROLLOFF would normally do until it hits maxdistance then cut off completly, hence the question about the algorithm.

---

<div class="post-metadata">

**Author:** ![jonwil](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jonwil](https://qa.fmod.com/u/jonwil)\
**Post date:** [August 3, 2014, 11:32am UTC](https://qa.fmod.com/t/logarithmic-falloff-formula/11590/2 "2014-08-03T11:32:29Z")

</div>

Found some code from the old audio library that shows how they did it so I dont need this question answered anymore.
