How do gun noises work?

More specifically what determines that an ar-15 firing 223 is louder than the pneumatic assault rifle? I can see that the pneumatic assault rifle has a loudness stat of 5 and pebble has a loudness stat of 0 but those don’t exist in the example I provided so what determines the example I have given?

Muzzel Velocity + barrel length + propellant in a really vague nutshell. You’d have to look at bullet grain to reall get an idea of volume, but generally, the bigger the barrel diameter the louder the noise. Pneumatic weapons just have a slight hiss from the momentary release of stored compressed air. A bow should technically have a noise of 5 as well.

Edit: an exception to that rule: a 40mm grenade launcher is actually pretty quiet. The resulting explosion on the other hand…

bang bang
i shot you down . . .
bangbang
all your friends
came around . . .

seriously you use guns you prepare for wanderer hordes. shotties and revolvers (my favorite guns) especially.

I guess I should have been more specific.
What stats in game for both guns and ammo determine how much noise they make and in what formula?

To be honest, i think its hard coded somewhere. I could find “loudness” entries for only a fraction of weapons, an most guns don’t appear to make noise based on a lack of that tag in the json. This is definitly a question for @kevin.granade.

Method that calculates gun noise:

Here’s the code that handles ammo types (The primary source of loudness) when loudness isn’t specified:

Tl;Dr damage + pierce + range * 2

Thank you sir. It looks like I will be forced to use the loudness stat for my purpose of making an as val or vinotrez.