## Distance-attenuation Extension

Version 5
*(Nils Peters, 07/05/2011 01:18 am)*

1 | 1 | Nils Peters | h1. Distance-attenuation Extension |
---|---|---|---|

2 | 1 | Nils Peters | |

3 | 1 | Nils Peters | Review of concepts for simulating distance attenuation of sound sources. |

4 | 1 | Nils Peters | |

5 | 1 | Nils Peters | h2. MIDI Manufacturers Association, Interactive Audio Special Interest Group 3D Level 1 Guideline |

6 | 1 | Nils Peters | |

7 | 1 | Nils Peters | source: http://www.midi.org/techspecs/rp49public.pdf |

8 | 1 | Nils Peters | |

9 | 4 | Nils Peters | 4 parameter defining the distance attenuation model: |

10 | 1 | Nils Peters | |

11 | 5 | Nils Peters | * Maximum Distance |

12 | 3 | Nils Peters | ** the distance at which no additional distance based attenuation is applied when the sound moves further away |

13 | 5 | Nils Peters | * Gain at Maximum Distance |

14 | 3 | Nils Peters | ** the maximum distance based attenuation applied to the sound. It is applied when the sound is at Maximum Distance |

15 | 5 | Nils Peters | * Reference Distance Ratio |

16 | 3 | Nils Peters | ** the distance beyond which distance based attenuation is applied, and below which no distance based attenuation is applied |

17 | 5 | Nils Peters | * Distance Ratio |

18 | 3 | Nils Peters | ** the normalized distance (0..1). the actual distance is computed by @distanceRatio@ * @maximumDistance@ |

19 | 2 | Nils Peters | |

20 | 1 | Nils Peters | !spatial-midi.png! |

21 | 2 | Nils Peters | |

22 | 5 | Nils Peters | The actual attenuation due to distance is computed according to the following model and is the same than the IA-SIG has chosen for the 3D Audio Rendering and Evaluation guidelines Level 2 (I3DL2) and is also used in OpenAL and Microsoftâ€™s DirectSound3D. |

23 | 1 | Nils Peters | |

24 | 2 | Nils Peters | @attenuation@ = 20*log10(@referenceDistance@ / (@referenceDistance@ + @ROF@ (@distance@ - @referenceDistance@))) |

25 | 2 | Nils Peters | |

26 | 2 | Nils Peters | @ROF@, the roll-off factor is defined as: |

27 | 2 | Nils Peters | |

28 | 2 | Nils Peters | @ROF@ = (@referenceDistance@ * 10^(- @maxAttenuation@ * 0.05) - @referenceDistance@) / (@maxDistance@ - @referenceDistance@) |

29 | 2 | Nils Peters | |

30 | 4 | Nils Peters | Another model is proposed as an alternative at the end of the specs: |

31 | 4 | Nils Peters | |

32 | 4 | Nils Peters | |

33 | 4 | Nils Peters | @attenuation@ = 20*log10(@referenceDistance@ / @distance@)^@a@ |

34 | 4 | Nils Peters | |

35 | 4 | Nils Peters | @a@ can be found with: |

36 | 4 | Nils Peters | |

37 | 4 | Nils Peters | @a@ = @maxAttenuation@ / 20*log10(@referenceDistance@ / @maxDistance@) |