function UnDigify(U)if U<1 or U>61 then return""elseif U==1 then return"\049"elseif U==2 then return"\033"elseif U==3 then return"\050"elseif U==4 then return"\064"elseif U==5 then return"\051"elseif U==6 then return"\052"elseif U==7 then return"\036"elseif U==8 then return"\053"elseif U==9 then return"\037"elseif U==10 then return"\054"elseif U==11 then return"\094"elseif U==12 then return"\055"elseif U==13 then return"\056"elseif U==14 then return"\042"elseif U==15 then return"\057"elseif U==16 then return"\040"elseif U==17 then return"\048"elseif U==18 then return"\113"elseif U==19 then return"\081"elseif U==20 then return"\119"elseif U==21 then return"\087"elseif U==22 then return"\101"elseif U==23 then return"\069"elseif U==24 then return"\114"elseif U==25 then return"\116"elseif U==26 then return"\084"elseif U==27 then return"\121"elseif U==28 then return"\089"elseif U==29 then return"\117"elseif U==30 then return"\105"elseif U==31 then return"\073"elseif U==32 then return"\111"elseif U==33 then return"\079"elseif U==34 then return"\112"elseif U==35 then return"\080"elseif U==36 then return"\097"elseif U==37 then return"\115"elseif U==38 then return"\083"elseif U==39 then return"\100"elseif U==40 then return"\068"elseif U==41 then return"\102"elseif U==42 then return"\103"elseif U==43 then return"\071"elseif U==44 then return"\104"elseif U==45 then return"\072"elseif U==46 then return"\106"elseif U==47 then return"\074"elseif U==48 then return"\107"elseif U==49 then return"\108"elseif U==50 then return"\076"elseif U==51 then return"\122"elseif U==52 then return"\090"elseif U==53 then return"\120"elseif U==54 then return"\099"elseif U==55 then return"\067"elseif U==56 then return"\118"elseif U==57 then return"\086"elseif U==58 then return"\098"elseif U==59 then return"\066"elseif U==60 then return"\110"elseif U==61 then return"\109"else return"\063"end end function IsBlack(U)if U%12==2 or U%12==4 or U%12==7 or U%12==9 or U%12==11 then return true end end local U=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")function fade(N,u)local M={}M.Transparency=1 local G=TweenInfo.new(u)local t=U:Create(N,G,M)t:Play()t.Completed:wait()return end function clone(N,u)if u then local u=N:Clone()u.Material="\078\101\111\110"u.Color=Color3.fromRGB(70,70,70)u.Anchored=true u.Parent=N u.Position=N.Position u.CanCollide=false for U,N in pairs(u:GetChildren())do if N and N:IsA("\077\101\115\104\080\097\114\116")then N:Destroy()end end local M=Instance.new("\080\111\105\110\116\076\105\103\104\116",u)M.Brightness=2 M.Range=5 M.Color=Color3.fromRGB(120,120,120)local G={}G.Position=Vector3.new(u.Position.x,u.Position.y+5,u.Position.z)local t=TweenInfo.new(1,Enum.EasingStyle.Linear)local L=U:Create(u,t,G)coroutine.resume(coroutine.create(fade),u,1)L:Play()L.Completed:wait()local z=u:FindFirstChildOfClass("\080\111\105\110\116\076\105\103\104\116")if z then z:Destroy()end if u.Transparency~=1 then u.Transparency=1 end u:Destroy()else local u=N:Clone()u.Material="\078\101\111\110"u.Color=Color3.fromRGB(255,255,255)u.Anchored=true u.Parent=N u.Position=N.Position u.CanCollide=false for U,N in pairs(u:GetChildren())do if N and N:IsA("\077\101\115\104\080\097\114\116")then N:Destroy()end end local M=Instance.new("\080\111\105\110\116\076\105\103\104\116",u)M.Brightness=2 M.Range=5 M.Color=Color3.fromRGB(120,120,120)local G={}G.Position=Vector3.new(u.Position.x,u.Position.y+5,u.Position.z)local t=TweenInfo.new(1,Enum.EasingStyle.Linear)local L=U:Create(u,t,G)coroutine.resume(coroutine.create(fade),u,1)L:Play()L.Completed:wait()local z=u:FindFirstChildOfClass("\080\111\105\110\116\076\105\103\104\116")if z then z:Destroy()end if u.Transparency~=1 then u.Transparency=1 end u:Destroy()end return end function HighlightPianoKey(U,N)if not Settings.KeyAesthetics then return end local u=math.ceil(U/12)local M=(U-1)%12+1 local G=Keys[u][M]G.Material="\078\101\111\110"if IsBlack(U)then G.Color=Color3.fromRGB(70,70,70)coroutine.resume(coroutine.create(clone),G,true)wait(.2)G.Color=Color3.fromRGB(10,10,10)G.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"else coroutine.resume(coroutine.create(clone),G,false)wait(.2)G.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"end return end


function UnDigify(digit)
	if digit < 1 or digit > 61 then
		return ""
	elseif digit == 1 then
		return "1"
	elseif digit == 2 then
		return "!"
	elseif digit == 3 then
		return "2"
	elseif digit == 4 then
		return "@"
	elseif digit == 5 then
		return "3"
	elseif digit == 6 then
		return "4"
	elseif digit == 7 then
		return "$"
	elseif digit == 8 then
		return "5"
	elseif digit == 9 then
		return "%"
	elseif digit == 10 then
		return "6"
	elseif digit == 11 then
		return "^"
	elseif digit == 12 then
		return "7"
	elseif digit == 13 then
		return "8"
	elseif digit == 14 then
		return "*"
	elseif digit == 15 then
		return "9"
	elseif digit == 16 then
		return "("
	elseif digit == 17 then
		return "0"
	elseif digit == 18 then
		return "q"
	elseif digit == 19 then
		return "Q"
	elseif digit == 20 then
		return "w"
	elseif digit == 21 then
		return "W"
	elseif digit == 22 then
		return "e"
	elseif digit == 23 then
		return "E"
	elseif digit == 24 then
		return "r"
	elseif digit == 25 then
		return "t"
	elseif digit == 26 then
		return "T"
	elseif digit == 27 then
		return "y"
	elseif digit == 28 then
		return "Y"
	elseif digit == 29 then
		return "u"
	elseif digit == 30 then
		return "i"
	elseif digit == 31 then
		return "I"
	elseif digit == 32 then
		return "o"
	elseif digit == 33 then
		return "O"
	elseif digit == 34 then
		return "p"
	elseif digit == 35 then
		return "P"
	elseif digit == 36 then
		return "a"
	elseif digit == 37 then
		return "s"
	elseif digit == 38 then
		return "S"
	elseif digit == 39 then
		return "d"
	elseif digit == 40 then
		return "D"
	elseif digit == 41 then
		return "f"
	elseif digit == 42 then
		return "g"
	elseif digit == 43 then
		return "G"
	elseif digit == 44 then
		return "h"
	elseif digit == 45 then
		return "H"
	elseif digit == 46 then
		return "j"
	elseif digit == 47 then
		return "J"
	elseif digit == 48 then
		return "k"
	elseif digit == 49 then
		return "l"
	elseif digit == 50 then
		return "L"
	elseif digit == 51 then
		return "z"
	elseif digit == 52 then
		return "Z"
	elseif digit == 53 then
		return "x"
	elseif digit == 54 then
		return "c"
	elseif digit == 55 then
		return "C"
	elseif digit == 56 then
		return "v"
	elseif digit == 57 then
		return "V"
	elseif digit == 58 then
		return "b"
	elseif digit == 59 then
		return "B"
	elseif digit == 60 then
		return "n"
	elseif digit == 61 then
		return "m"
  	else
    	return "?"
	end
end
function IsBlack(note)
	if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
		return true
	end
end
local TweenService = game:GetService("TweenService")

function fade(cln,t)
	local Goal = {}
	Goal.Transparency = 1
	local TwInfo = TweenInfo.new(t)
	local Tween = TweenService:Create(cln, TwInfo, Goal)
	Tween:Play()
	Tween.Completed:wait()
	return
end

function clone(key,sharp)
	if sharp then
		local cln = key:Clone()
		cln.Material = "Neon" --You can change / remove the neon if you want
		cln.Color = Color3.fromRGB(70,70,70) --along with the color
		cln.Anchored = true
		cln.Parent = key
		cln.Position = key.Position
		cln.CanCollide = false
		for i,v in pairs(cln:GetChildren()) do
			if v and v:IsA("MeshPart") then
				v:Destroy()
			end
		end
		local light = Instance.new("PointLight",cln) 
		light.Brightness = 2
		light.Range = 5
		light.Color = Color3.fromRGB(120, 120, 120)
		local Goal = {}
		Goal.Position = Vector3.new(cln.Position.x,cln.Position.y + 5,cln.Position.z)
		local TwInfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		local Tween = TweenService:Create(cln, TwInfo, Goal)
		coroutine.resume(coroutine.create(fade),cln,1)
		Tween:Play()
		Tween.Completed:wait()
		local l = cln:FindFirstChildOfClass("PointLight")
		if l then
			l:Destroy()
		end
		if cln.Transparency ~= 1 then cln.Transparency = 1 end
		cln:Destroy()
	else
		local cln = key:Clone() 
		cln.Material = "Neon" --You can change / remove the neon if you want
		cln.Color = Color3.fromRGB(255,255,255) --along with the color
		cln.Anchored = true
		cln.Parent = key
		cln.Position = key.Position
		cln.CanCollide = false
		for i,v in pairs(cln:GetChildren()) do
			if v and v:IsA("MeshPart") then
				v:Destroy()
			end
		end
		local light = Instance.new("PointLight",cln)
		light.Brightness = 2
		light.Range = 5
		light.Color = Color3.fromRGB(120, 120, 120)
		local Goal = {}
		Goal.Position = Vector3.new(cln.Position.x,cln.Position.y + 5,cln.Position.z)
		local TwInfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		local Tween = TweenService:Create(cln, TwInfo, Goal)
		coroutine.resume(coroutine.create(fade),cln,1)
		Tween:Play()
		Tween.Completed:wait()
		local l = cln:FindFirstChildOfClass("PointLight")
		if l then
			l:Destroy()
		end
		if cln.Transparency ~= 1 then cln.Transparency = 1 end
		cln:Destroy()
	end
	return
end

function HighlightPianoKey(note1,transpose)
	if not Settings.KeyAesthetics then return end
	local octave = math.ceil(note1/12)
	local note2 = (note1 - 1)%12 + 1
	local key = Keys[octave][note2]
	key.Material = "Neon"
	if IsBlack(note1) then
		key.Color = Color3.fromRGB(70,70,70)
		coroutine.resume(coroutine.create(clone),key,true)
		wait(.2)
		key.Color = Color3.fromRGB(10,10,10)
		key.Material = "SmoothPlastic"
	else
		
		coroutine.resume(coroutine.create(clone),key,false)
		wait(.2)
		key.Material = "SmoothPlastic"
	end
	return
end


