function UnDigify(V)if V<1 or V>61 then return""elseif V==1 then return"\049"elseif V==2 then return"\033"elseif V==3 then return"\050"elseif V==4 then return"\064"elseif V==5 then return"\051"elseif V==6 then return"\052"elseif V==7 then return"\036"elseif V==8 then return"\053"elseif V==9 then return"\037"elseif V==10 then return"\054"elseif V==11 then return"\094"elseif V==12 then return"\055"elseif V==13 then return"\056"elseif V==14 then return"\042"elseif V==15 then return"\057"elseif V==16 then return"\040"elseif V==17 then return"\048"elseif V==18 then return"\113"elseif V==19 then return"\081"elseif V==20 then return"\119"elseif V==21 then return"\087"elseif V==22 then return"\101"elseif V==23 then return"\069"elseif V==24 then return"\114"elseif V==25 then return"\116"elseif V==26 then return"\084"elseif V==27 then return"\121"elseif V==28 then return"\089"elseif V==29 then return"\117"elseif V==30 then return"\105"elseif V==31 then return"\073"elseif V==32 then return"\111"elseif V==33 then return"\079"elseif V==34 then return"\112"elseif V==35 then return"\080"elseif V==36 then return"\097"elseif V==37 then return"\115"elseif V==38 then return"\083"elseif V==39 then return"\100"elseif V==40 then return"\068"elseif V==41 then return"\102"elseif V==42 then return"\103"elseif V==43 then return"\071"elseif V==44 then return"\104"elseif V==45 then return"\072"elseif V==46 then return"\106"elseif V==47 then return"\074"elseif V==48 then return"\107"elseif V==49 then return"\108"elseif V==50 then return"\076"elseif V==51 then return"\122"elseif V==52 then return"\090"elseif V==53 then return"\120"elseif V==54 then return"\099"elseif V==55 then return"\067"elseif V==56 then return"\118"elseif V==57 then return"\086"elseif V==58 then return"\098"elseif V==59 then return"\066"elseif V==60 then return"\110"elseif V==61 then return"\109"else return"\063"end end function IsBlack(V)if V%12==2 or V%12==4 or V%12==7 or V%12==9 or V%12==11 then return true end end local V=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")function Tween(S,W,A,...)local y=TweenInfo.new(A,...)local R=V:Create(S,y,W)R:Play()R.Completed:wait()return end function max(V)local S={}S.Size=Vector3.new(7,V.Size.Y,V.Size.Z)Tween(V,S,.1,Enum.EasingStyle.Linear)S={}S.Size=Vector3.new(.4,V.Size.Y,V.Size.Z)Tween(V,S,.1,Enum.EasingStyle.Linear)return end function notmax(V,S)local W={}W.Size=Vector3.new(V.Size.x+S,V.Size.Y,V.Size.Z)Tween(V,W,.1,Enum.EasingStyle.Linear)W={}W.Size=Vector3.new(.4,V.Size.Y,V.Size.Z)Tween(V,W,.1,Enum.EasingStyle.Linear)return end function hit(V,S)if V then if V.Size.x+S>=7 then max(V)else notmax(V,S)end end return end function HighlightPianoKey(V,S)if not Settings.KeyAesthetics then return end local W=Keys.Keys:FindFirstChild(V)local A=V+1 local y=V+2 local R=V-1 local m=V-2 if A==62 then A=Keys.Keys:FindFirstChild("\049")else A=Keys.Keys:FindFirstChild(A)end if y==62 then y=Keys.Keys:FindFirstChild("\049")elseif y==63 then y=Keys.Keys:FindFirstChild("\050")else y=Keys.Keys:FindFirstChild(y)end if R==0 then R=Keys.Keys:FindFirstChild("\054\049")else R=Keys.Keys:FindFirstChild(R)end if m==0 then m=Keys.Keys:FindFirstChild("\054\049")elseif m==-1 then m=Keys.Keys:FindFirstChild("\054\048")else m=Keys.Keys:FindFirstChild(m)end coroutine.resume(coroutine.create(hit),W,3)coroutine.resume(coroutine.create(hit),A,1.5)coroutine.resume(coroutine.create(hit),y,.6)coroutine.resume(coroutine.create(hit),R,1.5)coroutine.resume(coroutine.create(hit),m,.6)return end
----------------------------------
------------FUNCTIONS-------------
----------------------------------

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 Tween(obj, Goal, Time, ...)
	local TwInfo = TweenInfo.new(Time, ...)
	local twn = TweenService:Create(obj, TwInfo, Goal)
	twn:Play()
	twn.Completed:wait()
	return
end

function max(key)
	local Properties = {}
	Properties.Size = Vector3.new(7, key.Size.Y, key.Size.Z)
	Tween(key, Properties, 0.1, Enum.EasingStyle.Linear)
	Properties = {}
	Properties.Size = Vector3.new(0.4, key.Size.Y, key.Size.Z)
	Tween(key, Properties, 0.1, Enum.EasingStyle.Linear)
	return
end

function notmax(key, amt)
	local Properties = {}
	Properties.Size = Vector3.new(key.Size.x + amt, key.Size.Y, key.Size.Z)
	Tween(key, Properties, 0.1, Enum.EasingStyle.Linear)
	Properties = {}
	Properties.Size = Vector3.new(0.4, key.Size.Y, key.Size.Z)
	Tween(key, Properties, 0.1, Enum.EasingStyle.Linear)
	return
end

function hit(key, amt)
	if key then
		if key.Size.x + amt >= 7 then
			max(key)
		else
			notmax(key, amt)
		end
	end
	return
end

function HighlightPianoKey(note1, transpose)
	if not Settings.KeyAesthetics then
		return
	end
	local key = Keys.Keys:FindFirstChild(note1)
	local note2 = note1 + 1
	local note3 = note1 + 2
	local note0 = note1 - 1
	local note01 = note1 - 2
	if note2 == 62 then
		note2 = Keys.Keys:FindFirstChild("1")
	else
		note2 = Keys.Keys:FindFirstChild(note2)
	end
	if note3 == 62 then
		note3 = Keys.Keys:FindFirstChild("1")
	elseif note3 == 63 then
		note3 = Keys.Keys:FindFirstChild("2")
	else
		note3 = Keys.Keys:FindFirstChild(note3)
	end
	if note0 == 0 then
		note0 = Keys.Keys:FindFirstChild("61")
	else
		note0 = Keys.Keys:FindFirstChild(note0)
	end
	if note01 == 0 then
		note01 = Keys.Keys:FindFirstChild("61")
	elseif note01 == -1 then
		note01 = Keys.Keys:FindFirstChild("60")
	else
		note01 = Keys.Keys:FindFirstChild(note01)
	end
	coroutine.resume(coroutine.create(hit), key, 3)
	coroutine.resume(coroutine.create(hit), note2, 1.5)
	coroutine.resume(coroutine.create(hit), note3, 0.6)
	coroutine.resume(coroutine.create(hit), note0, 1.5)
	coroutine.resume(coroutine.create(hit), note01, 0.6)
	return
end
