Jump to content

[1.0.x (partial)] Atmospheric Sound Enhancement v2.2 (2015-05-05)


pizzaoverhead

Recommended Posts

HotRockets requires using the new "EFFECTS" cfg parameter as seen in the RAPIER engines. It redefines audio in a way that is incompatible with ASE. I'm working on a way around this, but the RAPIER wasn't designed with this kind of audio modification in mind. No success so far.

Looks like it might be a bug in Unity :c

Apparently filters don't work properly if there is more than one AudioSource on an object.

After many hours of trying, I just can't figure out why it doesn't work. I can't quite figure out how the new ModuleEnginesFX actually plays its audio, it always starts with a single (active) AudioSource without a clip set, so that's why ASE can't add its effects. However, forcing the effects to be added doesn't work either, Unity gives a warning saying that the filters can't be added. The proper AudioSource objects do appear later, but I'm not sure of the mechanism behind it.

Edited by microsoftenator
Link to comment
Share on other sites

Here's what I've got so far:

Plugin dll

Source code

Confirmed working: Low-pass, distortion and reverb filters. RAPIER engines and anything else that uses the new FX system.

Bugs: The volume effect doesn't get applied all the time, although it usually seems to work after the first launch/flight. The filters may get applied to the non-Ship sound channels for some reason.

Link to comment
Share on other sites

Here's what I've got so far:

Plugin dll

Source code

Confirmed working: Low-pass, distortion and reverb filters. RAPIER engines and anything else that uses the new FX system.

Bugs: The volume effect doesn't get applied all the time, although it usually seems to work after the first launch/flight. The filters may get applied to the non-Ship sound channels for some reason.

Using OnAudioFilterRead is a nice way of solving the multiple accesses needed to ModuleEnginesFX's AudioSources' volume parameters. The filters being applied to music and non-ship sounds is due to applying the filters to the AudioListeners rather than the AudioSources. One of the main motivations for ASE is to avoiding editing AudioListeners for this reason. This makes applying filters to the RAPIER's ~4 audio sources per GameObject more difficult.

After many hours of trying, I just can't figure out why it doesn't work. I can't quite figure out how the new ModuleEnginesFX actually plays its audio, it always starts with a single (active) AudioSource without a clip set, so that's why ASE can't add its effects. However, forcing the effects to be added doesn't work either, Unity gives a warning saying that the filters can't be added. The proper AudioSource objects do appear later, but I'm not sure of the mechanism behind it.

ModuleEnginesFX appears not to load the clip until it is used, so the AudioSources don't appear until they are activated or their mode is switched. I'm working around this by detecting when these changes occur.

I appreciate the effort you're making. It's nice to have a second set of eyes on the problem.

Edited by pizzaoverhead
Link to comment
Share on other sites

I gave your mod a go and I must say it's lovely. However, there is a bug which annoys the hell out of me and I'm unsure if you're aware of this; sounds such as music tend to stutter quite wildly. This is particularly noticeable when framerate drops occur (for me this occurs quite a lot). More specifically, a chunk of music plays (perhaps half a second) and then replays instantly. It's hard to describe, and I'm not sure if it's conflicting with any other mods or what. The only other sound based mod I have installed is chatterer.

On a side note, I encountered another but less annoying bug. If the ship is throttled up and you hit the escape key, then again to get back in game, the muffling suddenly stops and the engines sound like stock. I was able to replicate this with a couple of LV-Ns strapped to the ship, so I'm not sure if this applies to any other engines.

Anyway, apologies if you're already aware of these. I think this mod is brilliant, and if you manage to fix that looping bug then I'll definitely be using this again!

Link to comment
Share on other sites

I gave your mod a go and I must say it's lovely. However, there is a bug which annoys the hell out of me and I'm unsure if you're aware of this; sounds such as music tend to stutter quite wildly. This is particularly noticeable when framerate drops occur (for me this occurs quite a lot). More specifically, a chunk of music plays (perhaps half a second) and then replays instantly. It's hard to describe, and I'm not sure if it's conflicting with any other mods or what. The only other sound based mod I have installed is chatterer.

On a side note, I encountered another but less annoying bug. If the ship is throttled up and you hit the escape key, then again to get back in game, the muffling suddenly stops and the engines sound like stock. I was able to replicate this with a couple of LV-Ns strapped to the ship, so I'm not sure if this applies to any other engines.

Anyway, apologies if you're already aware of these. I think this mod is brilliant, and if you manage to fix that looping bug then I'll definitely be using this again!

Thanks! The sound stuttering is a bug in KSP itself. It happens any time the game runs slowly. I'm guessing that ASE slows your game down just enough for this to happen. The next version of ASE should slow down your computer less, so it should help somewhat. The effects not being enabled after pausing is a bug that's fixed in the next version.

Greetings, love this idea and before I even add it onto my game, thanks for the work. My question: Can I add the new atmospheric sounds while retaining sounds in space?

Yes, it's fully customisable. There are two pre-made configurations included, one with for realism with no sound in space, and the other with sounds in space which are muffled. For normal sounds in space, you can edit settings.cfg and change maxVacuumFreq to 22000. Instructions for the settings are in the first post, and also included in the readme. Enjoy!

Link to comment
Share on other sites

Using OnAudioFilterRead is a nice way of solving the multiple accesses needed to ModuleEnginesFX's AudioSources' volume parameters. The filters being applied to music and non-ship sounds is due to applying the filters to the AudioListeners rather than the AudioSources. One of the main motivations for ASE is to avoiding editing AudioListeners for this reason. This makes applying filters to the RAPIER's ~4 audio sources per GameObject more difficult.

ModuleEnginesFX appears not to load the clip until it is used, so the AudioSources don't appear until they are activated or their mode is switched. I'm working around this by detecting when these changes occur.

Just trying to figure out if we're on the same page with this:

I was hoping that enabling bypasseffects on the non-ship AudioSources would avoid this issue, but apparently it doesn't work the way I expected.

The issue, I think, with applying effects to the RAPIERs is that the GameObject has 4-5 AudioSources associated with it, but it seems that the effects only get applied to the AudioSource that matches the GameObject's (readonly) audio property, which for the RAPIER appears to have its clip set to null. Not very useful.

Alternatively, it could be that effects aren't applied to disabled AudioSources, in which case your solution might work; I have far too little experience with Unity - and KSP in particular - to know the minutiae of how its audio system works.

Link to comment
Share on other sites

  • 2 weeks later...

Is there a way to get certain sounds to ignore the muffling filter? I noticed that with the Chatterer mod, certain sounds it adds (such as breathing when in EVA, and the hatch airlock repressurizing when entering and exiting EVA) are completely muffled in space, while the background ambient noises such as the hum of the craft itself are not, even in IVA mode.I would love to be able to hear the breathing and airlock sounds, especially for when doing an all-IVA mission. I also have a first person view mod for when in EVA, so the breathing would be awesome in that situation.

Link to comment
Share on other sites

Just trying to figure out if we're on the same page with this:

I was hoping that enabling bypasseffects on the non-ship AudioSources would avoid this issue, but apparently it doesn't work the way I expected.

The issue, I think, with applying effects to the RAPIERs is that the GameObject has 4-5 AudioSources associated with it, but it seems that the effects only get applied to the AudioSource that matches the GameObject's (readonly) audio property, which for the RAPIER appears to have its clip set to null. Not very useful.

Alternatively, it could be that effects aren't applied to disabled AudioSources, in which case your solution might work; I have far too little experience with Unity - and KSP in particular - to know the minutiae of how its audio system works.

The former appears to be the the case: The ModuleEnginesFX either stores multiple AudioClips, or only loads them when they are required. Some sounds are only found by ASE when the RAPIER changes modes for example.

Is there a way to get certain sounds to ignore the muffling filter? I noticed that with the Chatterer mod, certain sounds it adds (such as breathing when in EVA, and the hatch airlock repressurizing when entering and exiting EVA) are completely muffled in space, while the background ambient noises such as the hum of the craft itself are not, even in IVA mode.I would love to be able to hear the breathing and airlock sounds, especially for when doing an all-IVA mission. I also have a first person view mod for when in EVA, so the breathing would be awesome in that situation.

Not currently, but an interface to allow sounds to register to be affected in different ways is a very good idea. Better integration with Chatterer is a big part of the plan for the future.

Link to comment
Share on other sites

The former appears to be the the case: The ModuleEnginesFX either stores multiple AudioClips, or only loads them when they are required. Some sounds are only found by ASE when the RAPIER changes modes for example.

Not currently, but an interface to allow sounds to register to be affected in different ways is a very good idea. Better integration with Chatterer is a big part of the plan for the future.

That's good to hear. I've been a fan of the mod itself for a while since I've loaded it in, but sadly had to take it out when orbiting some large payloads for a challenge. The effects were happening inside the fairing (I use FAR) so it crawled my game to a halt. Of course this only happens once, but it was still somewhat jarring going from rather buttery launches of small craft to a stuttering few frames per second. Hopefully with the new patch the improvement in speed will come in handy, as I really do miss the silence of space.

Edit #2: Perhaps some kind of toggle for the atmospheric condensation effect? Something we could use to turn it off while say, orbiting larger loads that would slow it down, while keeping the sound changes?

Edited by Quiana
I accidently an 'ing'
Link to comment
Share on other sites

That's good to hear. I've been a fan of the mod itself for a while since I've loaded it in, but sadly had to take it out when orbiting some large payloads for a challenge. The effects were happening inside the fairing (I use FAR) so it crawled my game to a halt. Of course this only happens once, but it was still somewhat jarring going from rather buttery launches of small craft to a stuttering few frames per second. Hopefully with the new patch the improvement in speed will come in handy, as I really do miss the silence of space.

Edit #2: Perhaps some kind of toggle for the atmospheric condensation effect? Something we could use to turn it off while say, orbiting larger loads that would slow it down, while keeping the sound changes?

There are some slowdown issues in the current release, but I hope to have them resolved for the next one. You can disable the condensation effect by setting condensationEffectStrength to 0 in the settings.cfg. I have a feeling that the issue might be unrelated to the effect itself, but try it and see if it helps.

Link to comment
Share on other sites

There are some slowdown issues in the current release, but I hope to have them resolved for the next one. You can disable the condensation effect by setting condensationEffectStrength to 0 in the settings.cfg. I have a feeling that the issue might be unrelated to the effect itself, but try it and see if it helps.

I'll take a look. There's a chance Procedural Fairings is at fault here as I've seen a bit of back-and-forth about it perhaps having 23.5 issues but nothing I can verify. Probably do a top-down check of all my mods. Appreciate the help with the condensation effect setting.

Link to comment
Share on other sites

  • 2 weeks later...
I think so, it sounds amazing with the RS-25D from RealEngines. When that thing gets up in the atmosphere, it sounds so good I could listen to it for hours.

I know there are still some bugs in the development version posted earlier, but is it normal for the RAPIER engines to be completely silent forward of the shock cone at supersonic speeds? I have the config set to have some sound but it cuts off everything.

Link to comment
Share on other sites

I know there are still some bugs in the development version posted earlier, but is it normal for the RAPIER engines to be completely silent forward of the shock cone at supersonic speeds? I have the config set to have some sound but it cuts off everything.

The RAPIER and anything else that uses the new engine effects module (all the ARM engines and the Hot Rockets/Cool Rockets mods) don't work correctly with ASE due to the audio clips being inaccessible as far as ASE is concerned. I've been investigating a way around this, but have had little success so far.

Link to comment
Share on other sites

Any headway on this? More and more mods are starting to convert to the FX engines module, including stock

I haven't had much time to work on this lately, but I have managed to add several new entries to the list "things I've attempted that don't fix this". I still have some ideas left though.

Link to comment
Share on other sites

In the config file, is it possible for me to entirely disable mach cone effects? It's neat, but popping in and out of the cone as I move the camera can get distracting.

Also, is anyone else experiencing a bug where they hear a loud pop noise when flipping to map view?

Link to comment
Share on other sites

I've been having a few problems with this mod too. One of them is, as mentioned before, the issue with the condensation effects dropping my FPS down to 1-2 (many craft stay around Mach 1 for a while too, meaning a lot of lag).

But here's the bigger problem. I don't know if other people had this before or not, but when I changed the condensation and the distortion both to 0 (the distortion effect seemed to make all of my sounds really distorted all the time), nothing changed. I still have condensation and distortion. So then I uninstalled the mod (completely removed the AtmosphericSoundEnhancement folder) and it STILL has condensation effects and distortion. I'm looking at maybe having to reinstall the whole game.

Another, less important, issue is that I noticed the shockwave cone when I moved my camera around in one of my spaceplanes once, but I haven't been seeing it with any of my rockets after going above Mach 1. I haven't tried it again recently with a spaceplane, so I'm not sure if other mods may be affecting it, or if my version is broken.

EDIT: It seems to have been related to the HotRockets mod. Uninstalling it has fixed the sound issues I was getting. The condensation, however, I guess was part of the stock game, I just never noticed it before I guess :P

I suppose there's nothing I can do about stock game condensation. It's only a bother on rockets with 100+ parts (i.e. only at launch), so it's not worth turning down the atmospheric effects settings.

Edited by CharonM72
Link to comment
Share on other sites

  • 2 weeks later...

Do explosion sfx still occur with this mod? I remember that when I used Orion (nuclear pulse rocket) I could still hear the explosions even when I was in vacuum. Has this been corrected or is it still present?

Link to comment
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.

×
×
  • Create New...