function IsBlack(y)if y%12==2 or y%12==4 or y%12==7 or y%12==9 or y%12==11 then return true end end function HighlightPianoKey(y)if not Settings.KeyAesthetics then return end local Z=math.ceil(y/12)local s=(y-1)%12+1 local A=Keys[Z][s]if IsBlack(y)then A.Mesh.Offset=Vector3.new(.02,-0.15,0)else A.Mesh.Offset=Vector3.new(0,-0.05,0)end delay(.5,function()RestorePianoKey(y)end)end function RestorePianoKey(y)local Z=math.ceil(y/12)local s=(y-1)%12+1 local A=Keys[Z][s]if IsBlack(y)then A.Mesh.Offset=Vector3.new(.02,-0.1,0)else A.Mesh.Offset=Vector3.new(0,0,0)end end
----------------------------------
------------FUNCTIONS-------------
----------------------------------

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
function HighlightPianoKey(note1)
	if not Settings.KeyAesthetics then
		return
	end
	--print("highlight!")
	local octave = math.ceil(note1 / 12)
	local note2 = (note1 - 1) % 12 + 1
	local key = Keys[octave][note2]
	if IsBlack(note1) then
		key.Mesh.Offset = Vector3.new(0.02, -0.15, 0)
	else
		key.Mesh.Offset = Vector3.new(0, -0.05, 0)
	end
	delay(0.5, function()
		RestorePianoKey(note1)
	end)
end
function RestorePianoKey(note1)
	local octave = math.ceil(note1 / 12)
	local note2 = (note1 - 1) % 12 + 1
	local key = Keys[octave][note2]
	if IsBlack(note1) then
		key.Mesh.Offset = Vector3.new(0.02, -0.1, 0)
	else
		key.Mesh.Offset = Vector3.new(0, 0, 0)
	end
end
