Simple Dynamic Sound Example

I made a simple system for dynamic sounds that adjust a sound blocks volume and panning based on a players position,

2 Likes

I like the artwork and the dynamic sound. only thing I would change would be to make the jump a-bit higher.

1 Like

I wouldn’t use sensors with a different size to determine the volume, this makes the volume feel less smooth and kinda choppy.

Instead use distance (use numbers: 0-100 as a pinpoint for the distance of the player and sound source)
using distance > Volume makes the volume more accurate.

1 Like

Lemme show you a visual to what I mean rq (gimme a sec)

1 Like

Heres some simple math equations that get the player X, y | and the Sound source X, y | to determine what the music volume should be:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":4,"outputCount":1,"name":"Position to Sound","behaviorType":"logic.NodeGroup","x":1080,"y":160,"group":"729c433e8b220d45","id":"729d92ba0b5f6d43","isMenuItem":false,"originBundleId":null,"ownBundleId":null,"originPk":null,"v":2,"version":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":-32,"group":"729d92ba0b5f6d43","id":"729dc1f39f36af43","portId":"729d92ba0b5f6d43i0","tag":"XMe","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":80,"group":"729d92ba0b5f6d43","id":"729dc278902c3348","portId":"729d92ba0b5f6d43i1","tag":"YMe","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":208,"group":"729d92ba0b5f6d43","id":"729ddf6227b5c64d","portId":"729d92ba0b5f6d43i2","tag":"XOther","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-90,"y":320,"group":"729d92ba0b5f6d43","id":"729df932ba708948","portId":"729d92ba0b5f6d43i3","tag":"Y Other","dataType":2},{"expression":"Math.pow(A-B, 2)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"v":1,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":90,"y":64,"group":"729d92ba0b5f6d43","id":"729ed40d68652f4d","notes":"Credit to Latif for the math equations... except she's like long gone so Idek. (The example is more than 10 years old lol, older than my younger brother)","n_o":0,"version":1},{"expression":"Math.pow(A-B, 2)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"v":1,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":90,"y":192,"group":"729d92ba0b5f6d43","id":"729ed40e6f017543","version":1},{"expression":"109 - Math.sqrt(A+B)/320*100","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"v":1,"tag":"","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":360,"y":128,"group":"729d92ba0b5f6d43","id":"729ed40e06a74b44","version":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":720,"y":160,"group":"729d92ba0b5f6d43","id":"729f674c42effa41","startVal":0,"roundMode":1},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":160,"group":"729d92ba0b5f6d43","id":"729fbcbc22f26d42","portId":"729d92ba0b5f6d43o0","tag":"Vol","dataType":2},{"expression":"A/1","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"v":2,"tag":"","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":540,"y":128,"group":"729d92ba0b5f6d43","id":"72a148b66c85a643","version":2}],"links":[{"input_id":"729ed40d68652f4di0","output_id":"729dc1f39f36af43o0"},{"input_id":"729ed40e6f017543i0","output_id":"729dc278902c3348o0"},{"input_id":"729ed40d68652f4di1","output_id":"729ddf6227b5c64do0"},{"input_id":"729ed40d68652f4di2","output_id":"729ddf6227b5c64do0"},{"input_id":"729ed40e6f017543i1","output_id":"729df932ba708948o0"},{"input_id":"729ed40e6f017543i2","output_id":"729df932ba708948o0"},{"input_id":"729ed40e06a74b44i0","output_id":"729ed40d68652f4do0"},{"input_id":"729ed40e06a74b44i1","output_id":"729ed40e6f017543o0"},{"input_id":"729ed40e06a74b44i2","output_id":"729ed40e6f017543o0"},{"input_id":"72a148b66c85a643i0","output_id":"729ed40e06a74b44o0"},{"input_id":"72a148b66c85a643i1","output_id":"729ed40e06a74b44o0"},{"input_id":"729fbcbc22f26d42i0","output_id":"729f674c42effa41o0"},{"input_id":"729f674c42effa41i0","output_id":"72a148b66c85a643o0"},{"input_id":"729f674c42effa41i1","output_id":"72a148b66c85a643o0"}],"frames":[{"id":"729ed40f2232344d","color":-3696558,"label":"Distance","group":"729d92ba0b5f6d43","nodeIds":["729ed40d68652f4d","729ed40e6f017543","729ed40e06a74b44"],"x":40,"y":4,"w":490,"h":302}]}}}

1 Like

Yeah I know the sensors make the volume feel choppy, but I was aiming for making a simple system that would be more beginner friendly. Kinda like how the run and jump doesn’t work the best, but still does what’s intended while being simple for people to work off of.

But thanks for the tip, I’ll have to try it sometime!

dw I’m sure someone can understand 4 equations in a few seconds!