How do you make the screen blur from audio?

If you’re confused at what I mean, I’m talking about how certain games, (usually the ones with you dancing to a song) the screen gets blurrier on certain deeper notes. I’m assuming it requires a very complex script. I simply can not figure out how to perform this. Help is much appreciated :happy3:!

4 Likes

Hello! I found a blog post that maybe could solve your problem.

Read this: Roblox Blog - All the latest news direct from Roblox employees.

No scripting required

I’m sorry I should have been more clear, I’m talking about the screen getting blurrier, I’ll edit my post.

Are you looking for an audio visualizer?

Oh. For that you could insert a blur effect into Lighting in the explorer window. Scripting is required for the blurriness to change, though.

Sadly frequency analysis is not available on Roblox, you might be able to pull it off using a neural network but that would be a lot of effort. I guess the best you could do is check the Playbackloudness and adjust the blur if it surpasses a certain threshold.

2 Likes

Aww… :sad: I was just wondering, how does this game do it then? Did they have to perfectly time the blur effect to happen?
https://www.roblox.com/games/3437931225/smug-dancing-early-christmas?refPageId=caaf2bdb-7580-4306-9e2d-28a212d780bd

2 Likes

My guess is that you could use PlaybackLoudness and somehow map that to the blur effect.

Perhaps a possible, yet over-simplified, version could look like this:

sound:GetPropertyChangedSignal("PlaybackLoudness"):Connect(function()
   blur.Size = sound.PlaybackLoudness / 10 -- Adjust the divisor as needed
end)
4 Likes

Unless you know how Fourier Transforms work (and I’m probably guessing no because if you did, you would have been taught how to use it to separate frequencies in sound), there probably isn’t a good way to do this.

I’m in second year university and I still don’t know how it works. I’m not sure what your math skill level is, but it’s not really something you can pick up easily. There are existing APIs in other programming languages you can look up, and I’m pretty sure I’ve played a game that could analyze the sound characteristics here on Roblox (but I will probably never find it, sorry).

Hope this helps

Hey Johnny!

I made something very similar recently, but instead of making the screen blurry I change the field of view to make the camera “bounce” to the beat of the song.

I open-sourced the place for anyone who’s interested, it’s a super simple script but hopefully it helps out!

[I believe this is more of what you’re talking about, correct me if I’m wrong.]

8 Likes

I honestly cant figure out how to make the screen blur, but this is so helpful!!! thank you :happy1:

No problem!

3 Likes

I just did an update to the place to make it a little smoother and user friendly. Feel free to use it in your own game(s)!

1 Like