Sound Reactive Beams

Hello! I am Domderp999. And I am currently creating a concert In roblox. And I question, can you make sound reactive beams? like when a low frequency reaches a certain frequency, it would activate a beam, and once it exit’s the frequency range, it turns off?image
I want that beam to enable/disable reacting to the sound. Anybody got any way I could possibly make this happen?

You want to change it based on the PlaybackLoudness. I think you’ll have to check for its property when it changes and multiply the maximum length with the beam(or meter, it’s a loudness meter).

1 Like

Does the Playback Loudness change during when the audio is playing?
So I could do something like…

while wait() do
	if game.Workspace.Desert.PlaybackLoudness >= 0.5 then
		script.Parent.Beam.Enabled = true
	else
		script.Parent.Beam.Enabled = false
	end
end

Maybe, but I wouldn’t write while wait() do loops. I would not rely on it. Also you need to change the beam’s size, by changing its Vector3. Try something else like:

while sound.Playing do
    beam.Size = originalVector3 * Vector3.new(x, y, z) -- either x,y or z is PlaybackLoudness
    wait() -- I don't usually recommend this, but use RunService.Heartbeat:Wait() instead
end

I want the beam to enable / disable depending on how the music is. So lets say a kick plays, the beam would activate then de activate.

Then you’re going to use the if statements you just wrote earlier. Then since it’s in two states, just use a boolean… or change the value directly whenever conditions are met.

I tried the while loop, and it just turned off. Didnt react at all. Keep in mind this is the code :

wait(5)
while wait() do
	if game.Workspace.Desert.PlaybackLoudness >= 0.5 then
		script.Parent.Beam.Enabled = true
	else
		script.Parent.Beam.Enabled = false
	end
end

Well, it looks like that is a limitation for now: We can’t really read any loudness on each frequency as of now, that’s why we lack any true sound visualiser that actually have true values of each frequency in range.

All we have now is the generic loudness.