local sound = game.Workspace.Sound local beats = 0 local maxLoudness = 510 local count = game.Workspace.BPM.SurfaceGui.TextLabel
game:GetService("RunService").RenderStepped:Connect(function() local loudness = sound.PlaybackLoudness if loudness > maxLoudness then beats = beats+1 end end)
local function getAverageBpm() local minutesElapsed = sound.TimePosition/60 return beats/minutesElapsed end while wait(0.001) do count.Text = getAverageBpm()
end