How do you add Distance Attenuation on Individual Layers in MetaSounds?

I’m working on a looping weapon MetaSound, most of my current logic is copied from the Lyra Project Looping Fully Automatic Weapon.

It features multiple layers, a main layer, second layer, mechanical layer etc… in it’s current state it works fine for a first person weapon, but I want to apply unique distance based attenuation to individual voices/layers in the sound. This was really easy in Sound Cues because you could just add an “Attenuation” node and then overwrite the values per layer.

I’m struggling to figure out a similar way to do this in MetaSounds, I’m assuming it can be done and you need to utilize the UE.Attenuation Interface but I don’t know how to use that within the MetaSound. Is there a way for me to a create volume envelope that I can shape the volume falloff of a sound layer over distance within a MetaSound?

2 Likes

Here is a simple example of how I would have different layers with multiple attenuation nodes to have unique falloffs for 3P (in the world) sound events.


In this MetaSound I would ideally want all the gain controls to feed a volume envelope that I could attenuate individually over distance.

1 Like

Ok so I’m onto something thanks to one of Dan Reynold’s many fantastic online videos. I have distance based attenuation setup and editable per layer. But I got to say it leaves a lot to be desired.

On a sound cue you could edit Occlusion, Reverb Sends, Air Absorption, Spatialization etc… all over distance in an easy to setup Node.

Is there any way to replicate the per layer attenuation settings we could accomplish with a sound cue?

1 Like

Would love this as well. It’s needed indeed.

Please go here and suggest it as well (I already did)

:slight_smile:

Found this thread when I had a similar problem, have a metasound with two layers, one that wants to be heard from very far away, one that only wants to be heard when up close.

Am on 5.3 now, wonder if the situation has evolved and there is an easier way to achieve this now?

Meant to add, I guess something like this is acceptable?

In this example, the second ‘layer’ should effectively have half the range.

1 Like

Hi, I’m Emmanuel Katto from Uganda (Africa). Did you come up with a solution?
I need to do the same thing…

Yep.
In Range A - Inner Radius
In Range B - Falloff Distance

Still not solved the different attenuation settings to have per sound layer. What’ I’m most interested in is ability to have some sounds with Spatialization ON and some OFF cause I don’t want to hear a specific echo tail for a firing sound in 3D/positioned.

The only method I figured out to use take different audio streams from inside a metasound and output each of them at a different transform with different attenuation settings is to output the audio from the metasound to an audio bus and then place use a USourceBus to play this bus in the scene in the right location + applying attenuation settings on the source bus component itself.

This is a bit unwieldy and you might need to manage some pool of audio busses you move around which might kinda be awful for weapons, it’s also possible to spawn new busses in c++ and provide these as object inputs to the metasound applying them to the metasound bus audio writer.