Localised sound effects

Put simply an event that plays a sound, with a loudness variable option so the further you are away from the source event the quieter the sound effect is. Ideally with a variable that can be defined to show how far from the source the sound effect can be heard.

I am not sure if something like this can be done but it could add a lot of immersion to larger maps!

EDIT: Bonus points if the sound can be panned to the left or right speaker relative to the player.

Original thread: https://forums.rpgmakerweb.com/threads/localised-sound-effects.49442/