FOV-Lighting Based sound visualizer

FOV-LIGHTING BASED SOUND VISUALIZER

by the way, sorry for my broken english

Link to the model: https://www.roblox.com/library/8406990730/Lighting-FOV-Sound-Visualizer

SHOWCASE

sorry for low fps, my laptop is really bad, and that blue color if from the settings, you can change it to any other color with any value and saturation using the HSV

sorry for low fps, i am running on a potato :(

FEATURES

  • You can control the intensity of each effect using variables
  • Fully customizable
  • Has a built-in smooth mode that uses twin-service with variables that control the smoothness
  • Simple to use
  • Uses FOV and some Lighting features like Color Correction, Blur, Contrast

HOW TO USE

Once you put this model into workspace, you will find folders
Put every child of each folder into the place where it belong according to the folder name

Example:

Folder called Workspace, put its children inside the workspace

By the way, this model has an auto installer, a script that will take care of setting it up
If you wish to use it just leave the model inside the workspace, and the script will take care of the rest

If you have questions about using it, feel free to ask me

THE CODE

This is a local code

-- FOV-Based song visualizer by Amine360YT

-- variables

local sound = game.Workspace.Sound -- ur sound (average camellia song)
local camera = game.Workspace.CurrentCamera -- le camera
local blurEffect = game.Lighting.Blur -- le blur
local cce = game.Lighting.ColorCorrection -- da color correction effect
local run = game:GetService("RunService") -- running in the 90's, i mean run service

-- FOV settings

local defaultFov = 70 -- default Roblox FOV (dont change)
local maxFov = 120 -- max Roblox FOV  (dont change, too)
local sensitivity = 90 -- user sensitivity
local limitFov = maxFov - defaultFov -- m e t h
local fov = 0 -- FOV variable (DONT TOUCH THE CHILD)
local smoothing = .1 -- determins how smooth is it
local smoothFov = true -- toggle le smoothing (keep it on lol)

-- same for all bellow except HUE (its HSV but ye)

-- blur settings

local defaultBlur = 0
local maxBlur = 12
local blurSensitivity = 24
local limitBlur = maxBlur - defaultBlur
local blur = 0
local smoothingBlur = .1
local smoothBlur = true

-- HUE settings

local defaultHUE = 0
local maxHUE = 255
local HUESensitivity = 1
local limitHUE = maxHUE - defaultHUE
local HUE = 0
local smoothingHUE = .1
local smoothHUE = true
local H = 0.671889 -- le color u want (between 0 to 1, u know)

-- contrast settings

local defaultContrast = 0
local maxContrast = 1
local contrastSensitivity = 2
local limitContrast = maxContrast - defaultContrast
local contrast = 0
local smoothingContrast = .1
local smoothContrast = true

-- the functions that updates the effects every frame (if run the game on a toaster it will be ebik)
-- DO NOT TOUCH UNLESS U KNOW WUT TO DO M8

function updateFov()
	fov = sound.PlaybackLoudness * (sensitivity / 1000)
	blur = sound.PlaybackLoudness * (blurSensitivity / 1000)
	HUE = sound.PlaybackLoudness * (HUESensitivity / 1000)
	contrast = sound.PlaybackLoudness * (contrastSensitivity / 1000)
	
	if fov > limitFov then
		fov = limitFov
	end
	
	if blur > limitBlur then
		blur = limitBlur
	end
	
	if HUE > limitHUE then
		HUE = limitHUE
	end

	if contrast > limitContrast then
		contrast = limitContrast
	end
	
	if smoothFov then
		game.TweenService:Create(camera, TweenInfo.new(smoothing), {FieldOfView = fov + defaultFov}):Play()
	else
		camera.FieldOfView = fov + defaultFov
	end
	
	if smoothBlur then
		game.TweenService:Create(blurEffect, TweenInfo.new(smoothingBlur), {Size = blur + defaultBlur}):Play()
	else
		blurEffect.Size = blur + defaultBlur
	end
	
	if smoothHUE then
		game.TweenService:Create(cce, TweenInfo.new(smoothingHUE), {TintColor = Color3.fromHSV(0.671889, HUE + defaultHUE, 1)}):Play()
	else
		cce.TintColor = Color3.fromHSV(H, HUE + defaultHUE, 1)
	end

	if smoothContrast then
		game.TweenService:Create(cce, TweenInfo.new(smoothingContrast), {Contrast = contrast + defaultContrast}):Play()
	else
		cce.Contrast = contrast + defaultContrast
	end
	
	--print(fov, blur, HUE, contrast) debugging (get stick bugged lol)
end

-- simply run it every frame

run.RenderStepped:Connect(function()
	updateFov()
end)

-- sorry for my broken english

HOW DOES IT WORK

This scripts calculates the PlaybackLoudness of a sound from the client, then it changes the FOV of camera depending on the Loudness of the Sound, also does the same for the rest of effects

more detailed explaination inside the code’s comments

CONCLUSION

Feel free to use this model in your games
And by the way, if you find a bug or want to request something you can ask me

8 Likes