REAL Audio Visualizer
Key RequiredUniversal

REAL Audio Visualizer

Universal Scriptyoolzzyoolzz 387 views 390 executesUpdated Jul 15, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•410 lines (14091 chars)
-- Audio Visualizer

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local root = char:WaitForChild("HumanoidRootPart")

local LMG2L = {};

LMG2L["ScreenGui_1"] = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"));
LMG2L["ScreenGui_1"]["ZIndexBehavior"] = Enum.ZIndexBehavior.Sibling;

LMG2L["Frame_2"] = Instance.new("Frame", LMG2L["ScreenGui_1"]);
LMG2L["Frame_2"]["BorderSizePixel"] = 0;
LMG2L["Frame_2"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["Frame_2"]["Size"] = UDim2.new(0, 264, 0, 252);
LMG2L["Frame_2"]["Position"] = UDim2.new(0, 584, 0, 30);

LMG2L["UIGradient_3"] = Instance.new("UIGradient", LMG2L["Frame_2"]);
LMG2L["UIGradient_3"]["Color"] = ColorSequence.new{ColorSequenceKeypoint.new(0.000, Color3.fromRGB(83, 120, 127)),ColorSequenceKeypoint.new(0.425, Color3.fromRGB(82, 120, 127)),ColorSequenceKeypoint.new(1.000, Color3.fromRGB(255, 255, 255))};

LMG2L["TextBox_4"] = Instance.new("TextBox", LMG2L["Frame_2"]);
LMG2L["TextBox_4"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["TextBox_4"]["PlaceholderText"] = [[Sound Id]];
LMG2L["TextBox_4"]["Size"] = UDim2.new(0, 214, 0, 34);
LMG2L["TextBox_4"]["Position"] = UDim2.new(0, 18, 0, 34);
LMG2L["TextBox_4"]["Text"] = [[]];

LMG2L["lol_5"] = Instance.new("TextBox", LMG2L["Frame_2"]);
LMG2L["lol_5"]["Name"] = [[lol]];
LMG2L["lol_5"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["lol_5"]["PlaceholderText"] = [[Pitch]];
LMG2L["lol_5"]["Size"] = UDim2.new(0, 104, 0, 30);
LMG2L["lol_5"]["Position"] = UDim2.new(0, 8, 0, 74);
LMG2L["lol_5"]["Text"] = [[]];

LMG2L["TextBox_6"] = Instance.new("TextBox", LMG2L["Frame_2"]);
LMG2L["TextBox_6"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["TextBox_6"]["PlaceholderText"] = [[Distortion]];
LMG2L["TextBox_6"]["Size"] = UDim2.new(0, 118, 0, 30);
LMG2L["TextBox_6"]["Position"] = UDim2.new(0, 124, 0, 74);
LMG2L["TextBox_6"]["Text"] = [[]];

LMG2L["TextButton_7"] = Instance.new("TextButton", LMG2L["Frame_2"]);
LMG2L["TextButton_7"]["TextSize"] = 10;
LMG2L["TextButton_7"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["TextButton_7"]["Size"] = UDim2.new(0, 182, 0, 34);
LMG2L["TextButton_7"]["Text"] = [[Play]];
LMG2L["TextButton_7"]["Position"] = UDim2.new(0, 26, 0, 120);

LMG2L["TextLabel_8"] = Instance.new("TextLabel", LMG2L["Frame_2"]);
LMG2L["TextLabel_8"]["BorderSizePixel"] = 0;
LMG2L["TextLabel_8"]["TextSize"] = 12;
LMG2L["TextLabel_8"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["TextLabel_8"]["TextColor3"] = Color3.fromRGB(110, 187, 195);
LMG2L["TextLabel_8"]["BackgroundTransparency"] = 1;
LMG2L["TextLabel_8"]["Size"] = UDim2.new(0, 146, 0, 22);
LMG2L["TextLabel_8"]["Text"] = [[Music player]];
LMG2L["TextLabel_8"]["Position"] = UDim2.new(0, 48, 0, 6);

LMG2L["Frame_9"] = Instance.new("Frame", LMG2L["Frame_2"]);
LMG2L["Frame_9"]["BorderSizePixel"] = 0;
LMG2L["Frame_9"]["BackgroundColor3"] = Color3.fromRGB(78, 113, 119);
LMG2L["Frame_9"]["Size"] = UDim2.new(0, 18, 0, 252);
LMG2L["Frame_9"]["Position"] = UDim2.new(0, -16, 0, 0);

LMG2L["TextButton_a"] = Instance.new("TextButton", LMG2L["Frame_9"]);
LMG2L["TextButton_a"]["BorderSizePixel"] = 0;
LMG2L["TextButton_a"]["TextSize"] = 10;
LMG2L["TextButton_a"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
LMG2L["TextButton_a"]["BackgroundTransparency"] = 1;
LMG2L["TextButton_a"]["Size"] = UDim2.new(0, 14, 0, 30);
LMG2L["TextButton_a"]["Text"] = [[<<]];
LMG2L["TextButton_a"]["Position"] = UDim2.new(0, 2, 0, 102);

LMG2L["TextLabel_b"] = Instance.new("TextLabel", LMG2L["Frame_2"])
LMG2L["TextLabel_b"]["BorderSizePixel"] = 0
LMG2L["TextLabel_b"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255)
LMG2L["TextLabel_b"]["BackgroundTransparency"] = 1
LMG2L["TextLabel_b"]["Size"] = UDim2.new(0, 220, 0, 80)
LMG2L["TextLabel_b"]["Text"] = "i didn't have so much time so I made this ahh gui\nMade by: yoolzz._(on tiktok!)"
LMG2L["TextLabel_b"]["Position"] = UDim2.new(0, 14, 0, 170)
LMG2L["TextLabel_b"]["TextWrapped"] = true

local gui = LMG2L["ScreenGui_1"]
local frame = LMG2L["Frame_2"]

local TweenService = game:GetService("TweenService")
local toggleButton = LMG2L["TextButton_a"]

frame.AnchorPoint = Vector2.new(1, 0)
frame.Position = UDim2.new(1, 0, 0, 30)

local aberta = false
local larguraBarra = 4

local function getPosicaoFechada()
    local larguraReal = frame.AbsoluteSize.X
    local parteVisivel = larguraBarra
    local offset = larguraReal - parteVisivel
    return UDim2.new(1, offset, 0, 30)
end

frame.Position = getPosicaoFechada()

toggleButton.MouseButton1Click:Connect(function()
    local destino
    if aberta then
        destino = getPosicaoFechada()
    else
        destino = UDim2.new(1, 0, 0, 30)
    end
    local tween = TweenService:Create(frame, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = destino})
    tween:Play()
    aberta = not aberta
end)

local musicBox = LMG2L["TextBox_4"]
local pitchBox = LMG2L["lol_5"]
local button = LMG2L["TextButton_7"]
local distortionBox = LMG2L["TextBox_6"]

--// Sound
local sound = Instance.new("Sound", root)
sound.Volume = 5
sound.Looped = true

--// the settingszzz
local VisualizerSettings = {
    TweenInfo = TweenInfo.new(0.15),
    NumSurroundingBars = 5,
    PolynomialDegree = 2.5,
    OriginalSize = Vector3.new(0.4, 0.4, 0),
    MaxSize = Vector3.new(0.5, 6, 0),
    OriginalColor = Color3.fromRGB(164, 84, 255),
    MaxColor = Color3.fromRGB(255, 255, 255),
    Cooldown = 0.025,
    RGB = true,
    ScaleLoudnessMax = 800,
    BaseRadius = 6,
    Height = 0.4,
    Quantity = 49,
    RadiusMultiplier = 2.5,
    HeightMultiplier = 3,
}

local losangos = {}
local meshId = "rbxassetid://9756362"
local losangosAtivos = true

local VisualizeModel = Instance.new("Model")
VisualizeModel.Name = "VisualizerModel"
VisualizeModel.Parent = char

for i = 1, VisualizerSettings.Quantity do
    local meshPart = Instance.new("MeshPart")
    meshPart.Name = tostring(i)
    meshPart.MeshId = meshId
    meshPart.Size = VisualizerSettings.OriginalSize
    meshPart.Anchored = false
    meshPart.CanCollide = false
    meshPart.Material = Enum.Material.Neon
    meshPart.Color = VisualizerSettings.OriginalColor
    meshPart.Reflectance = 0
    meshPart.CastShadow = false
    meshPart.Parent = VisualizeModel

    local weld = Instance.new("Weld")
    weld.Part0 = root
    weld.Part1 = meshPart
    weld.Parent = meshPart

    losangos[i] = {
        part = meshPart,
        weld = weld,
        baseAngle = (i / VisualizerSettings.Quantity) * math.pi * 2,
    }
end

--// Services
local RunService = game:GetService("RunService")
local Debris = game:GetService("Debris")
local Clamp = math.clamp

local function ScaleTo(Current, Max, To)
    return math.round((Current * To) / Max)
end

local function PolynomialInterpolation(Alpha, Min, Max, Degree)
    return (Max - Min) * (Alpha ^ Degree) + Min
end

local Visualizer = {}
Visualizer.__index = Visualizer

function Visualizer.Create(VisualizeMain, Audio, Presets)
    local self = setmetatable({
        VisualizeInstances = {},
        VisualizeModel = VisualizeMain,
        Audio = Audio,
        Presets = Presets,
        NewScaleValue = Instance.new("NumberValue"),
        Main = nil,
        MaxLoudness = 10,
        AudioClock = 0,
        Hue = 0,
        CurrentScale = 1,
    }, Visualizer)

    for i = 1, Presets.Quantity do
        local part = VisualizeMain:FindFirstChild(tostring(i))
        if part then
            self.VisualizeInstances[i] = part
        end
    end

    self.NewScaleValue.Value = 1
    return self
end

function Visualizer:Start()
    local MaxLoudness = 10
    local OriginalSize, MaxSize = self.Presets.OriginalSize, self.Presets.MaxSize
    local OriginalColor, MaxColor = self.Presets.OriginalColor, self.Presets.MaxColor
    local IsRGB = self.Presets.RGB

    local Clock = 0
    self.Main = RunService.Heartbeat:Connect(function(DeltaTime)
        if not losangosAtivos then return end

        Clock += DeltaTime; if not (Clock >= self.Presets.Cooldown) then return end; Clock = 0

        if IsRGB then
            OriginalColor = Color3.fromHSV(tick() % 3 / 3, 0.6, 0.9)
        end

        local CurrentLoudness = self.Audio.PlaybackLoudness
        if CurrentLoudness > MaxLoudness then
            MaxLoudness = CurrentLoudness
        end

        local Scaled = ScaleTo(CurrentLoudness, self.Presets.ScaleLoudnessMax, 0.8)
        local NewScale = Clamp(0.8 + (Scaled * 1), 0.8, 3)
        TweenService:Create(self.NewScaleValue, self.Presets.TweenInfo, {Value = NewScale}):Play()
        local CurrentScale = self.NewScaleValue.Value

        task.spawn(function()
            local ToChange = {}

            local MainNumber = ScaleTo(CurrentLoudness, MaxLoudness, #self.VisualizeInstances) + 1
            MainNumber = Clamp(MainNumber, 1, #self.VisualizeInstances)
            ToChange[MainNumber] = 1

            local PolynomialDegree = self.Presets.PolynomialDegree
            for i = 1, self.Presets.NumSurroundingBars do
                local Below, Above = MainNumber - i, MainNumber + i
                if Below < 1 then
                    Below = (#self.VisualizeInstances - i) + 1
                end
                if Above > #self.VisualizeInstances then
                    Above = i
                end
                local Alpha = (self.Presets.NumSurroundingBars - i) / self.Presets.NumSurroundingBars
                local InterpolatedValue = PolynomialInterpolation(Alpha, 0, 1, PolynomialDegree)
                ToChange[Below], ToChange[Above] = InterpolatedValue, InterpolatedValue
            end

            for i = 1, #self.VisualizeInstances do
                local VisualizationBar = self.VisualizeInstances[i]
                if not VisualizationBar then continue end
                local Properties = {}
                local Alpha = 0
                if ToChange[i] then
                    Alpha = ToChange[i]
                end

                local baseSize = OriginalSize:Lerp(MaxSize, Alpha)
                local CurrentSize = Vector3.new(
                    baseSize.X * CurrentScale,
                    baseSize.Y * CurrentScale,
                    baseSize.Z * CurrentScale
                )
                local CurrentColor = OriginalColor:Lerp(MaxColor, Alpha)

                if VisualizationBar.Size ~= CurrentSize then
                    Properties.Size = CurrentSize
                end
                if VisualizationBar.Color ~= CurrentColor then
                    Properties.Color = CurrentColor

                    local h = VisualizationBar:FindFirstChildOfClass("Highlight")
                    if h then
                        h.FillColor = CurrentColor
                    end
                end

                if Properties.Size or Properties.Color then
                    local Tween = TweenService:Create(VisualizationBar, self.Presets.TweenInfo, Properties)
                    Tween:Play()
                    Debris:AddItem(Tween, self.Presets.TweenInfo.Time)
                end
            end
        end)

        local radius = self.Presets.BaseRadius * CurrentScale
        local height = self.Presets.Height * CurrentScale

        for i, part in ipairs(self.VisualizeInstances) do
            if not part then continue end
            local data = losangos[i]
            local angle = data.baseAngle

            local posX = math.cos(angle) * radius
            local posZ = math.sin(angle) * radius
            local targetPos = Vector3.new(posX, height, posZ)

            local lookCFrame = CFrame.lookAt(targetPos, Vector3.new(0, targetPos.Y, 0))
            data.weld.C0 = lookCFrame
        end
    end)
end

function Visualizer:PropertyChange(VisualizationBar, Properties)
    local Tween = TweenService:Create(VisualizationBar, self.Presets.TweenInfo, Properties)
    Tween:Play()
    Debris:AddItem(Tween, self.Presets.TweenInfo.Time)
end

function Visualizer:SetPreset(NewPreset)
    self.Presets = NewPreset
    self:Refresh()
end

function Visualizer:SetPresetSpecific(Property, Value)
    self.Presets[Property] = Value
    self:Refresh()
end

function Visualizer:Refresh()
    self.Main:Disconnect(); self.Main = nil
    self:Start()
end

function Visualizer:Stop()
    if self.Main then
        self.Main:Disconnect()
        self.Main = nil
    end
end

RunService.Heartbeat:Connect(function()
    if not losangosAtivos then return end
    for i, data in ipairs(losangos) do
        if data.part and data.part.Parent then
            if data.part.Material ~= Enum.Material.Neon then
                data.part.Material = Enum.Material.Neon
            end
        end
    end
end)

local function destruirLosangos()
    losangosAtivos = false
    if VisualizerInstance then
        VisualizerInstance:Stop()
    end
    for i, data in ipairs(losangos) do
        if data.part and data.part.Parent then
            data.part:Destroy()
        end
    end
    losangos = {}
    if VisualizeModel then
        VisualizeModel:Destroy()
    end
end
-- hi u found me, a random message :vvv

local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(destruirLosangos)

local VisualizerInstance = nil

button.MouseButton1Click:Connect(function()
    local id = musicBox.Text
    local pitch = tonumber(pitchBox.Text) or 1
    local distortionLevel = tonumber(distortionBox.Text) or 0

    for _, v in ipairs(sound:GetChildren()) do
        if v:IsA("SoundEffect") then
            v:Destroy()
        end
    end

    local distortion = Instance.new("DistortionSoundEffect")
    distortion.Level = math.clamp(distortionLevel, 0, 1000)
    distortion.Parent = sound

    sound.SoundId = "rbxassetid://"..id
    sound.PlaybackSpeed = pitch

    if VisualizerInstance then
        VisualizerInstance:Stop()
    end

    task.wait(0.1)
    sound:Play()

    VisualizerInstance = Visualizer.Create(VisualizeModel, sound, VisualizerSettings)
    VisualizerInstance:Start()
end)

Features & Information

idk an very accurate remakeeeszzzzzzzzzz

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts