Jump to content

[1.4.0 - 1.5.x] Audio Muffler Redux [v2.6.1] (2018 May, 7)


Ser

Recommended Posts

11 hours ago, yorshee said:

Is there a version of this mod for 1.1.3? There's versions for 1.0 and 1.2, but not 1.1.

There's no KSP 1.1.x compatible version because as we all know KSP 1.1 update included Unity engine update. In that Unity version among other troubles the audio filter that provides the core functionality of the mod just stopped working and @NovaSilisko had declared that " it would seem KSP 1.1 is the version that finally killed Muffler" attaching a beautiful "Amazing grace" song played with scottish bagpipes. I've tried to write my own filter as it was also used in my G-Effects mod but it sounded like crap, so it became possible to revive the mod only with KSP 1.2 that uses a once again updated Unity version where the audio filter has been fixed.

That's the story.

Link to comment
Share on other sites

@Ser Overall what a great mod for immersion this is, but there is still work that needs to be done. It changes sounds that originate from the cockpit like BDA lock-on tones etc. These should definitely be all exempt from alteration because they are utlilitarian in nature, but I still really like this!

Link to comment
Share on other sites

1 hour ago, Flashblade said:

@Ser Overall what a great mod for immersion this is, but there is still work that needs to be done. It changes sounds that originate from the cockpit like BDA lock-on tones etc. These should definitely be all exempt from alteration because they are utlilitarian in nature, but I still really like this!

Please describe the simplest way to reproduce that (+ used mods etc.)

Link to comment
Share on other sites

@Ser This is my mod list:

gHGVLeZ.jpg

Recreating is pretty simple. I just grabbed a plane slapped some racks with sidewinders on it and of course all the parts that BDA requires to work like a radom and the weapon manager. Switch on the Sidewinders through the weapon manager and you will hear the idle tone of the infrared seeker. I noticed that the tone was not muffled immediately, on the runway I could switch between third person and iva view and the sound remained the same. After I took off flew around and pressed the c key a few times more it became muffled in iva and stayed normal outside. If you want I can do a minimal run with only BDA, Audio Muffler and stock.

Edited by Flashblade
Link to comment
Share on other sites

  • 1 month later...

The OP in this mod indicates that this is keyed to KSP v1.2, with no reference to sub-versions (such as v1.2.2, which I run.)

There is also no .version file in the download, which I think might be a source of CKAN metadata, as well as AVC.

Can you confirm that this mod is ok for v1.2.2, and in any event, would you please consider updating the zipfile packaging to include a .version?

Link to comment
Share on other sites

On 03.01.2017 at 3:54 PM, MisterFister said:

The OP in this mod indicates that this is keyed to KSP v1.2, with no reference to sub-versions (such as v1.2.2, which I run.)

There is also no .version file in the download, which I think might be a source of CKAN metadata, as well as AVC.

Can you confirm that this mod is ok for v1.2.2, and in any event, would you please consider updating the zipfile packaging to include a .version?

It is fully compatible with KSP 1.2.2, but I saw some weirdness last time I've used it. Guess that was caused by some dev changes, so after I check that CKAN metadata will be updated.

Link to comment
Share on other sites

  • 1 month later...
10 hours ago, Azimech said:

Just had an idea ... what if it could work in the atmosphere based on camera distance?

Do you mean the effect when thunder from a very close lightning sounds more like "Crrack!" and the remote one sounds like "boom", because of high frequencies lose their energy faster than lower ones (noticeable mostly at large distances)? I'll check but hope that guys from Unity took care of this because that's the basics of sound positioning. If we are talking about changing sounds when a camera is moved from 1 to 10 meters distance, don't think that would be realistic. Could you explain how do you want that to work?

Link to comment
Share on other sites

@Ser Exactly like in your first example, realistic :-)

I hope the current maintainer of Camera Tools can fix the doppler effect as well. Shouldn't be too hard because Unity has doppler built-in. Now imagine these two working together ... big smile.

Edited by Azimech
Link to comment
Share on other sites

4 hours ago, Azimech said:

@Ser Exactly like in your first example, realistic :-)

I hope the current maintainer of Camera Tools can fix the doppler effect as well. Shouldn't be too hard because Unity has doppler built-in. Now imagine these two working together ... big smile.

Well, I've done some research . It is called "Atmospheric sound absorption" and is calculated like that:

Spoiler

ISO 9613-1:1993 − Acoustics − Noise Absorption by Air − Attenuation of sound during propagation outdoors − Calculation of the absorption of sound by the atmosphere.
Attenuation due to atmospheric absorption is specified as a function of the frequency of the sound from 50 Hz to 10 kHz and that is really no ultrasound.
 
There are 4 parameters for calculating air damping:
1) Frequency f in Hz.
2) Temperature T in K (Kelvin). Can be fixed to a standard room temperature of 293.15 K
= 20°C = 68°F.
3) Relative Humidity h in %. Can be fixed to a standard of 50 to 60% or whatever represents a standard RH for one's circumstances.
4) Atmospheric pressure p in kPa (kilopascal). Can be fixed to a standard of 101.325 kPa (standard pressure at sea level).
 
as = a · s [dB] total absorption at distance s
 
pt = pi · exp(−x · as) [Pa]
x = 1 / (10 · log ((exp(1))2) = ca. 0.1151
Delta Lt = 20 · log (pi / pt) = as [dB]
a = 8.686 · f2· ((1.84 · 10−11· (pa / pr)−1· (T / To)1/2) + y) [dB/m]
y = (T / To)−5/2· (0.01275 · exp (−2239.1 / T) · (frO + f2 / frO)−1 + z)
z = 0.1068 · exp (−3352 / T) · (frN + f2 / frN)−1
frO = (pa / pr) · (24 + 4.04 · 104· h · ((0.02 + h) / (0.391 + h)))
frN = (pa / pr) · (T / To)−1/2· (9 + 280 · h · exp (−4.170 · ((T / To)−1/3−1)))
h = hr · ((psat / pr) / (pa / pr)) = hr · (psat / pa)
psat = pr · 10(−6.8346 · (To1 / T)^1.261 + 4.6151)
 
a ........ pure-tone sound attenuation coefficient, in dB/m, for atmospheric absorption
s ........ distance in m through which the sounds propagates
pi ....... initial sound pressure amplitude in Pa
pt ....... sound pressure amplitude in Pa
pa ...... ambient atmospheric pressure in kPa
pr ....... reference ambient atmospheric pressure: 101.325 kPa
psat ... saturation vapor pressure equals:
................ International Meteorological Tables WMO-No.188 TP94
................ World Meteorological Organization - Geneva Switzerland
T ........ ambient atmospheric temperature in K (Kelvin).
........... K = 273.15 + Temperature in °C (Celsius)
To ...... reference temperature in K: 293.15 K (20°C)
To1..... triple-point isotherm temp: 273.16 K = 273.15 + 0.01 K (0.01°C)
h ........ molar concentration of water vapor, as a percentage
hr........ relative humidity as a percentage
f ......... frequency
frO ..... oxygen relaxation frequency
frN ..... nitrogen relaxation frequency
x ........ a help factor to shorten formula − improvement by E. Desart
y ........ a help factor to shorten formula
z ........ a help factor to shorten formula

Pretty simple as you can see :D Need only to understand where to get the values for some of the variables. Unity has some means to specify cutoff as a function of distance, so at least it seems to be doable. The trouble is that it would be inevitably done by adding an audio filter to every audio source, which I tried to avoid in the current implementation because that would introduce some additional overhead that would potentially hurt FPS depending on the number of sounds that are not only playing but just exist on the scene at the moment.

Link to comment
Share on other sites

2 minutes ago, Ser said:

Well, I've done some research . It is called "Atmospheric sound absorption" and is calculated like that:

  Hide contents

ISO 9613-1:1993 − Acoustics − Noise Absorption by Air − Attenuation of sound during propagation outdoors − Calculation of the absorption of sound by the atmosphere.
Attenuation due to atmospheric absorption is specified as a function of the frequency of the sound from 50 Hz to 10 kHz and that is really no ultrasound.
 
There are 4 parameters for calculating air damping:
1) Frequency f in Hz.
2) Temperature T in K (Kelvin). Can be fixed to a standard room temperature of 293.15 K
= 20°C = 68°F.
3) Relative Humidity h in %. Can be fixed to a standard of 50 to 60% or whatever represents a standard RH for one's circumstances.
4) Atmospheric pressure p in kPa (kilopascal). Can be fixed to a standard of 101.325 kPa (standard pressure at sea level).
 
as = a · s [dB] total absorption at distance s
 
pt = pi · exp(−x · as) [Pa]
x = 1 / (10 · log ((exp(1))2) = ca. 0.1151
Delta Lt = 20 · log (pi / pt) = as [dB]
a = 8.686 · f2· ((1.84 · 10−11· (pa / pr)−1· (T / To)1/2) + y) [dB/m]
y = (T / To)−5/2· (0.01275 · exp (−2239.1 / T) · (frO + f2 / frO)−1 + z)
z = 0.1068 · exp (−3352 / T) · (frN + f2 / frN)−1
frO = (pa / pr) · (24 + 4.04 · 104· h · ((0.02 + h) / (0.391 + h)))
frN = (pa / pr) · (T / To)−1/2· (9 + 280 · h · exp (−4.170 · ((T / To)−1/3−1)))
h = hr · ((psat / pr) / (pa / pr)) = hr · (psat / pa)
psat = pr · 10(−6.8346 · (To1 / T)^1.261 + 4.6151)
 
a ........ pure-tone sound attenuation coefficient, in dB/m, for atmospheric absorption
s ........ distance in m through which the sounds propagates
pi ....... initial sound pressure amplitude in Pa
pt ....... sound pressure amplitude in Pa
pa ...... ambient atmospheric pressure in kPa
pr ....... reference ambient atmospheric pressure: 101.325 kPa
psat ... saturation vapor pressure equals:
................ International Meteorological Tables WMO-No.188 TP94
................ World Meteorological Organization - Geneva Switzerland
T ........ ambient atmospheric temperature in K (Kelvin).
........... K = 273.15 + Temperature in °C (Celsius)
To ...... reference temperature in K: 293.15 K (20°C)
To1..... triple-point isotherm temp: 273.16 K = 273.15 + 0.01 K (0.01°C)
h ........ molar concentration of water vapor, as a percentage
hr........ relative humidity as a percentage
f ......... frequency
frO ..... oxygen relaxation frequency
frN ..... nitrogen relaxation frequency
x ........ a help factor to shorten formula − improvement by E. Desart
y ........ a help factor to shorten formula
z ........ a help factor to shorten formula

Pretty simple as you can see :D Need only to understand where to get the values for some of the variables. Unity has some means to specify cutoff as a function of distance, so at least it seems to be doable. The trouble is that it would be inevitably done by adding an audio filter to every audio source, which I tried to avoid in the current implementation because that would introduce some additional overhead that would potentially hurt FPS depending on the number of sounds that are not only playing but just exist on the scene at the moment.

Yes, pretty simple. I think I'll find it easier to read Klingon ;-)

While I hated math as a teenager ... I'd like to learn more now that I'm more than twice that age.

Anyway ... how many audio sources would there be? Could it be possible to group certain sounds together? If you take the CoM as a reference and decide that all audio sources within 100 meter radius would receive just one filter, would that work? I think such a radius would be perfect because at large distances it becomes harder to accurately pinpoint the source of a sound ... no-one would complain.

Imagine ... My heavy stock helicopters use 50 blowers (Juno turbojets) in the main engine, 2 - 6 Wheesley's for forward propulsion and 4 jets on the tail. If all of them get a separate filter ... holy excrement!

Link to comment
Share on other sites

26 minutes ago, Azimech said:

Anyway ... how many audio sources would there be? Could it be possible to group certain sounds together? If you take the CoM as a reference and decide that all audio sources within 100 meter radius would receive just one filter, would that work? I think such a radius would be perfect because at large distances it becomes harder to accurately pinpoint the source of a sound ... no-one would complain.

There are some troubles with that. First, Unity has audio mixers for audio sources commutation into one channel, so common filter might be applied to that channel. But those mixers cannot be created dynamically, you create the needed number of them via Unity editor, export them as a bundle and load into the game. Second, what would happen when an audio source moves from one zone to another is a sudden jump in frequencies and that would sound unrealistic and would also lead to some effects like clicks etc. You may hear them when switching from 3rd person to IVA with Audio Muffler active.
And Are you sure you can hear anything that is more than 100m away in KSP?

Anyway I'll check how it works in stock with a great hope it already does. If I go for implementing this myself I'll probably use the individual filters approach.

Link to comment
Share on other sites

18 hours ago, smokytehbear said:

This is still not showing as compatible with 1.2.2 on CKAN. Latest version says for 1.2.1. Were any problems discovered when testing it with 1.2.2? Would love to give this a go.

Updated. Thanks for the reminder. Actually there's no much difference between KSP 1.2, 1.2.1 and 1.2.2 so majority of mods should be compatible between those versions.

Link to comment
Share on other sites

  • 2 months later...
1 hour ago, maculator said:

How well does this work with chatterer? I read that those are compatible but I have no Idea how good they work together. Anyone out there tested it? Is there a video maybe? Thanks.

Since version 2.1 it works pretty well with Chatterer. So using the current version you should have no trouble.

Link to comment
Share on other sites

Thanks for the confirmation @Ser I gave it a try and it's amazing those small two mods together are all you need to get some warm feel into the cold empty world of ksp.

I don't need part mods or graphic mods as long as I got some telemtry and audio going :)

Link to comment
Share on other sites

When flying one of my SSTOs, I had a thought that would go well with this mod: would it be technologically possible to, if a craft is going faster than sound, make it project a sound cone behind it and, if the camera is outside of this cone, no engine sounds could be heard?

Link to comment
Share on other sites

On 17.04.2017 at 5:37 PM, voicey99 said:

When flying one of my SSTOs, I had a thought that would go well with this mod: would it be technologically possible to, if a craft is going faster than sound, make it project a sound cone behind it and, if the camera is outside of this cone, no engine sounds could be heard?

That shouldn't be too hard to implement, another question is how to do that realistically. What you are asking for is implemented in @pizzaoverhead's mod and he promised to update it soonTM:

 

On 17.04.2017 at 5:39 PM, maculator said:

I too had a request: Can you add a setting to the fading mulitplyer in the config? I'd like the muffler to kick in a bit later.

What you mean "later"? Need an example how it should work.

Link to comment
Share on other sites

3 minutes ago, Ser said:

That shouldn't be too hard to implement, another question is how to do that realistically. What you are asking for is implemented in @pizzaoverhead's mod and he promised to update it soonTM:

Pizza updated CollisionFX last month, so hopefully he is going to get round to this one soonish. I didn't even know it existed :).

Link to comment
Share on other sites

3 minutes ago, maculator said:

Well altitude wise. To be able to hear more at higher altitudes but stil absolute silence in space.

I see. Configurable non-linear dependency on air pressure.

Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...