Self compression for gunshots

Hey, have a good day.

I am trying to design automatic rifle gunshots. My problem is that if I use the gunshot sounds at their normal volume, the sounds are getting louder and disturbing.

Self-compression might be a solution for this.

Let’s say there is Gunshot 1, 2, and 3.
Gunshot 1 is compression-free at start → Gunshot 2 is compressing Gunshot 1 → Gunshot 3 is compressing 2 and 1. And it goes on.

I am a newbie in Fmod Studio. Please let me know if there is something like this or any other way to solve this problem.

Hi,
How long is your gunshot sound?
What’s the shooting rate?
How do you implement the repetition? (Scatterer instrument? One-shot event triggered repeatedly by the game code?..)

Hi, Alcibiade

I have a lot of gunshots for different rifles actually.
For example, AK-47 gunshot sounds’ durations are between 6-7 seconds. The shooting rate is around 0.1 seconds. I am triggering one-shot events repeatedly by the game code. Should I use scatterer instruments instead of multi instruments?

Since you trigger one-shot instances, no. The scatterer is a good choice if you choose to implement the repetition inside an event rather than inside the game code (it allows, for instance, to modulate the shooting rate, which the multi do not).

Ok, so your sounds have quite a long tail. And at a shooting rate of 0.1s, those tails do build up and become overwhelming, isn’t it? I don’t think there’s a way to sidechain compress one instance from another instance, the way you want to. A general compression on the weapon bus may be a viable solution, but only if the player is the only one shooting, with no spatializer involved (since spatializer would change the volume, hence the compressor response).

In fact, I think FMOD lacks an option, which I already asked for: steal release time, at the event level, and at the instrument polyphony level. It would allow you to set the polyphony of the event to 1 and have the previous sound faded out smoothly after a certain amount of time (rather than abruptly cut, as it actually is), which is probably near from what you want.
In that thread, @joseph gave a hint for a workaround:

If you want to achieve a smooth fade-out of a sound when playing a new instance of a sound, there are already ways to achieve that behavior in FMOD Studio, using combinations of AHDSR modulators, event instruments, trigger conditions, and command instruments.

I have to admit I find this quite cryptic at the moment :smiley: And since I’m not working on a shooting game, I didn’t bother to think about it. But I will…

Also, maybe a simple way to manage this would be to cut your sounds in 2 parts, and trigger the tail only once, after the last shot. That way, it would avoid the buildup. That could be a bit tricky to implement but you get the general idea.

1 Like

Thank you Alcibiade. That was so helpful! When I find a simple solution to my problem, I will write it on this topic.

1 Like