--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time

local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]

local parts = Piano.Case:GetChildren()
local PartAmt = 0
function HighlightPianoKey(note1,transpose)
	if not Settings.KeyAesthetics then return end
	local octave = math.ceil(note1/12)
	local note2 = (note1 - 1)%12 + 1
	if PartAmt < 20 then
		PartAmt = PartAmt + 1
		local part = parts[math.random(1,#parts)]:clone()
		part.Parent = Piano.Keys.Parts
		part.Name = note1
		part.Color = Color3.fromRGB(math.random(70,255),math.random(70,255),math.random(70,255))
		part.Material = Materials[math.random(1,#Materials)]
		part.Position = Vector3.new(part.Position.x + math.random(-5,5),part.Position.y,part.Position.z + math.random(-5,5))
		part.Transparency = 0
		local lifelen = math.random(0.6,2.0)
		local t = 0
		
		while t <= lifelen do
			wait(.05)
			t = t + .05
			if math.random(1,4) ~= 1 then
				for i = 1,5 do
					if math.random(1,2) == 1 then
						if i == 1 then
							part.Color = Color3.fromRGB(math.random(70,255),math.random(70,255),math.random(70,255))
						elseif i == 2 then
							part.Material = Materials[math.random(1,#Materials)]
						elseif i == 3 then
							part.Position = Vector3.new(part.Position.x + math.random(-8.0,8.0),part.Position.y,part.Position.z + math.random(-8.0,8.0))
						elseif i == 4 then
							part.Orientation = Vector3.new(part.Orientation.x + math.random(-80,80),part.Orientation.y + math.random(-80,80),part.Orientation.z + math.random(-80,80))
						elseif i == 5 then
							part.Size = Vector3.new(part.Size.x + math.random(-2.0,2.0),part.Size.y + math.random(-2.0,2.0),part.Size.z + math.random(-2.0,2.0))
						end
					end
				end
			end
		end
		PartAmt = PartAmt - 1
		part:destroy()
	end
	return
end
