Strake

[1.3.1] Sonic Realism

Recommended Posts

Modifies the in-flight sound to be more realistic:

  • Makes the amplitude what an actual comoving listener would hear at the position of the camera — if the craft is supersonic, you will not hear any sound outside the shock cone, and will hear louder close to the shock
  • Mutes the sound by atmospheric density — the thinner the air, the quieter the sound
  • Has no effect in IVA mode

I was using Atmospheric Sound Enhancement, but it not works with latest KSP, ergo Sonic Realism.

Code

Download

MIT License

To use, copy SonicRealism.dll somewhere into your GameData directory (for example: GameData/SonicRealism).

Cheers!

 

Edited by Strake
Added link to license.

Share this post


Link to post
Share on other sites

FYI: The usual way of packaging mods is in a directory inside GameData, alongside the Squad directory. GameData/SonicRealism or something similar. While putting DLLs in the old legacy structure might work, it's deprecated and has been for some time.

Share this post


Link to post
Share on other sites

Thanks, modified instructions/installer script. (I was following a mod tutorial which said to put it into Plugins.)

Share this post


Link to post
Share on other sites

Excellent.  I was hoping someone would do a mod like this.  Does it also give you the sonic boom sound when you reach the speed of sound?

Share this post


Link to post
Share on other sites
15 hours ago, Probus said:

Does it also give you the sonic boom sound when you reach the speed of sound?

Not as such — the sonic boom, to my knowledge, is essentially due to the Doppler effect, so all the sound emitted since going supersonic (in theory) hits the listener simultaneously; a comoving listener hears no such effect. However, the motion of the medium affects the relation between the angle at which sound is emitted and the angle at which it propagates, which makes the sound essentially bunch up at the shock front, which amplifies the sound close to the shock front, which this mod simulates.

 

Share this post


Link to post
Share on other sites

Does this mod mute all frequencies equally as atmospheric density decreases? I'm currently using Audio Muffler Redux, which mutes higher frequencies first and mutes progressively lower frequencies as the air grows thinner. I'd like to install this for the sonic boom effect, but installing two mods that both take care of muffling due to atmospheric density sounds like a recipe for trouble.

Share this post


Link to post
Share on other sites

@awang

Yes, this mod has a flat gain across all frequencies. Audio Muffler Redux has some neat features — it may be possible to combine the mods (i.e. as one mod). Alternatively, Sonic Realism could have a flag of whether to mute sound by atmospheric density, which shouldn't be difficult (but may be difficult nonetheless in C#, cuz it's C#).

The latter is likely easier but the former seems preferable. This is now on my agenda — no guaranty it will happen soon, but will try to make time. Meanwhile, if you care to build the mod yourself, you can use the branch "no-mute-by-density" from my GitHub repo, which has only the shock effect.

 

Share this post


Link to post
Share on other sites

Thanks for the quick response! I cloned your repo and built the no-mute-by-density branch, but unfortunately it seems that there might be some weird interaction between this and Audio Muffler Redux, since I hear no engine sounds at all, even when directly behind the rocket. I think Sonic Realism is partially working, since I can hear what sounds like white noise (wind noise from Chatterer, maybe?), and that sound appears to change with the angle I'm looking at the rocket.

 

Combining with Audio Muffler Redux sounds like an interesting idea, but at that rate it sounds like you're more or less recreating Atmospheric Sound Enhancement. Wonder what it would take to revive the latter...

 

Edit: After taking a closer listen, I don't think I can hear any difference when changing camera angle :(

Edited by awang
Update with new observations

Share this post


Link to post
Share on other sites

I have to second @awang on the not hearing engine sounds thing. However I got this problem with the default branch and without AMR. I need to check to make sure it's not other mods, determine the precise conditions to recreate, get logs, etc., but what's going on right now is that I have an aircraft going subsonic in the Kerbin atmosphere, and I don't hear the engines (rapiers). When I start going supersonic and use flyby camera, in front I hear nothing (as is proper), and as it passes, I hear this rumble a split second before hearing a suprisingly faint crack of what I think is the sonic boom, then the rumble continues on for a long time. I believe the rumble is supposed to be the sound of the aircraft engines, but it sounds a little odd. It would seem that for some reason the sound of the aircraft is arriving a smidge before the actual shock. 

As I get to hypersonic speeds, I can hear the sound of air rushing over the aircraft even when my camera is well ahead of the craft.

Again, I need to do testing to determine that the problem isn't with any of the other mods I have (I doubt it but you never know), and then post reproduction steps and logs. Like the mod though! :) 

 

Edited by EpicSpaceTroll139

Share this post


Link to post
Share on other sites

Hi, sorry for the slow response — i had to extend my vacation for personal reasons and left my KSP-playing machine back home. I'm back now.

@EpicSpaceTroll139

I just confirmed this mod seems to behave queerly with aircraft, not sure why. I have not tried fly-by — this is a mod, yes? I will need to investigate further. I do hear the engines in subsonic flight however.

Would you make a video of what you described? It might help me know whether i'm reproducing what happened to you.

@awang

I believe ASE uses a simply lowpass filter for atmospheric attenuation. I was hoping to use a proper Stokes filter, but my sole attempt so far failed...

 

Share this post


Link to post
Share on other sites
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.