function ShowPiano()PianoGui:TweenPosition(UDim2.new(.5,-380,1,-220),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(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)local F=PianoGui.Keys[Y]if IsBlack(Y)then F.BackgroundColor3=Color3.new(.19607843137255,.19607843137255,.19607843137255)else F.BackgroundColor3=Color3.new(.7843137254902,.7843137254902,.7843137254902)end delay(.5,function()RestorePianoKey(Y)end)end function RestorePianoKey(Y)local F=PianoGui.Keys[Y]if IsBlack(Y)then F.BackgroundColor3=Color3.new(0,0,0)else F.BackgroundColor3=Color3.new(1,1,1)end end function PianoKeyPressed(Y,F)local W=Y.UserInputType.Name if W=="\077\111\117\115\101\066\117\116\116\111\110\049"or W=="\084\111\117\099\104"then PlayNoteClient(F)end end function ExitButtonPressed(Y)local F=Y.UserInputType.Name if F=="\077\111\117\115\101\066\117\116\116\111\110\049"or F=="\084\111\117\099\104"then Deactivate()end end function SheetsButtonPressed(Y)local F=Y.UserInputType.Name if F=="\077\111\117\115\101\066\117\116\116\111\110\049"or F=="\084\111\117\099\104"then ToggleSheets()end end function SheetsEdited(Y)if Y=="\084\101\120\116"then local Y=SheetsGui.Sheet.ScrollingFrame.TextBox.TextBounds SheetsGui.Sheet.ScrollingFrame.CanvasSize=UDim2.new(0,0,0,math.max(14,Y.Y))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(Y)local F=Y.UserInputType.Name if F=="\077\111\117\115\101\066\117\116\116\111\110\049"or F=="\084\111\117\099\104"then ToggleCaps()end end
----------------------------------
------------FUNCTIONS-------------
----------------------------------

function ShowPiano()
	PianoGui:TweenPosition(UDim2.new(0.5, -380, 1, -220), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.5, true)
end
function HidePiano()
	PianoGui:TweenPosition(UDim2.new(0.5, -380, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.5, true)
end
function ShowSheets()
	SheetsGui:TweenPosition(UDim2.new(0.5, -200, 1, -520), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.5, true)
end
function HideSheets()
	SheetsGui:TweenPosition(UDim2.new(0.5, -200, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.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)
	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(0.5, function()
		RestorePianoKey(note)
	end)
end
function RestorePianoKey(note)
	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

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 SheetsEdited(property)
	if property == "Text" then
		local bounds = SheetsGui.Sheet.ScrollingFrame.TextBox.TextBounds
		SheetsGui.Sheet.ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, math.max(14, bounds.Y))
	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
