function ShowPiano()PianoGui:TweenPosition(UDim2.new(.5,-355,1,-230),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.5,true)end function HidePiano()PianoGui:TweenPosition(UDim2.new(.5,-380,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.5,true)end function ShowSheets()SheetsGui:TweenPosition(UDim2.new(.5,-200,1,-520),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.5,true)end function HideSheets()SheetsGui:TweenPosition(UDim2.new(.5,-200,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.5,true)end function ToggleSheets()SheetsVisible=not SheetsVisible if SheetsVisible then ShowSheets()else HideSheets()end end function IsBlack(q)if q%12==2 or q%12==4 or q%12==7 or q%12==9 or q%12==11 then return true end end function HighlightPianoKey(q)if q<62 and q>0 then local w=PianoGui.Keys[q]if IsBlack(q)then w.BackgroundColor3=Color3.new(.19607843137255,.19607843137255,.19607843137255)else w.BackgroundColor3=Color3.new(.7843137254902,.7843137254902,.7843137254902)end delay(.5,function()RestorePianoKey(q)end)else delay(.5,function()RestorePianoKey(q)end)end end function RestorePianoKey(q)if q<62 and q>0 then local w=PianoGui.Keys[q]if IsBlack(q)then w.BackgroundColor3=Color3.new(0,0,0)else w.BackgroundColor3=Color3.new(1,1,1)end end end function PianoKeyPressed(q,w)local D=q.UserInputType.Name if D=="\077\111\117\115\101\066\117\116\116\111\110\049"or D=="\084\111\117\099\104"then PlayNoteClient(w)end end function ExitButtonPressed(q)local w=q.UserInputType.Name if w=="\077\111\117\115\101\066\117\116\116\111\110\049"or w=="\084\111\117\099\104"then Deactivate()end end function SheetsButtonPressed(q)local w=q.UserInputType.Name if w=="\077\111\117\115\101\066\117\116\116\111\110\049"or w=="\084\111\117\099\104"then ToggleSheets()end end function ToggleCaps()ShiftLock=not ShiftLock if ShiftLock then PianoGui.CapsButton.BackgroundColor3=Color3.new(1,.66666666666667,0)PianoGui.CapsButton.BorderColor3=Color3.new(.60392156862745,.40392156862745,0)PianoGui.CapsButton.TextColor3=Color3.new(1,1,1)else PianoGui.CapsButton.BackgroundColor3=Color3.new(.54901960784314,.54901960784314,.54901960784314)PianoGui.CapsButton.BorderColor3=Color3.new(.26666666666667,.26666666666667,.26666666666667)PianoGui.CapsButton.TextColor3=Color3.new(.70588235294118,.70588235294118,.70588235294118)end end function CapsButtonPressed(q)local w=q.UserInputType.Name if w=="\077\111\117\115\101\066\117\116\116\111\110\049"or w=="\084\111\117\099\104"then ToggleCaps()end end


function ShowPiano()
	PianoGui:TweenPosition(
		UDim2.new(0.5, -355, 1, -230),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Sine,
		.5,
		true
	)
end
function HidePiano()
	PianoGui:TweenPosition(
		UDim2.new(0.5, -380, 1, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Sine,
		.5,
		true
	)
end
function ShowSheets()
	SheetsGui:TweenPosition(
		UDim2.new(0.5, -200, 1, -520),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Sine,
		.5,
		true
	)
end
function HideSheets()
	SheetsGui:TweenPosition(
		UDim2.new(0.5, -200, 1, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Sine,
		.5,
		true
	)
end

function ToggleSheets()
	SheetsVisible = not SheetsVisible
	if SheetsVisible then
		ShowSheets()
	else
		HideSheets()
	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

function HighlightPianoKey(note)
	if note < 62 and note > 0 then
		local keyGui = PianoGui.Keys[note]
		if IsBlack(note) then
			keyGui.BackgroundColor3 = Color3.new(50/255, 50/255, 50/255)
		else
			keyGui.BackgroundColor3 = Color3.new(200/255, 200/255, 200/255)
		end
		delay(.5, function() RestorePianoKey(note) end)
	else
		delay(.5, function() RestorePianoKey(note) end)
	end
end
function RestorePianoKey(note)
	if note < 62 and note > 0 then
		local keyGui = PianoGui.Keys[note]
		if IsBlack(note) then
			keyGui.BackgroundColor3 = Color3.new(0, 0, 0)
		else
			keyGui.BackgroundColor3 = Color3.new(1, 1, 1)
		end
	end
end

function PianoKeyPressed(Object, note)
		local type = Object.UserInputType.Name
		if type == "MouseButton1" or type == "Touch" then
			PlayNoteClient(note)
		end
end

function ExitButtonPressed(Object)
	local type = Object.UserInputType.Name
	if type == "MouseButton1" or type == "Touch" then
		Deactivate()
	end
end

function SheetsButtonPressed(Object)
	local type = Object.UserInputType.Name
	if type == "MouseButton1" or type == "Touch" then
		ToggleSheets()
	end
end

function ToggleCaps()
	ShiftLock = not ShiftLock
	if ShiftLock then
		PianoGui.CapsButton.BackgroundColor3 = Color3.new(1, 170/255, 0)
		PianoGui.CapsButton.BorderColor3 = Color3.new(154/255, 103/255, 0)
		PianoGui.CapsButton.TextColor3 = Color3.new(1, 1, 1)
	else
		PianoGui.CapsButton.BackgroundColor3 = Color3.new(140/255, 140/255, 140/255)
		PianoGui.CapsButton.BorderColor3 = Color3.new(68/255, 68/255, 68/255)
		PianoGui.CapsButton.TextColor3 = Color3.new(180/255, 180/255, 180/255)
	end
end

function CapsButtonPressed(Object)
	local type = Object.UserInputType.Name
	if type == "MouseButton1" or type == "Touch" then
		ToggleCaps()
	end
end
