local base_param = ...
local sw,sh,scx,scy,songdir,rr,am,bt,hs,pe,hr,ease,wratio,hratio,paraph = base_param.sw,base_param.sh,base_param.scx,base_param.scy,base_param.songdir,base_param.rr,base_param.am,base_param.bt,base_param.hs,base_param.pe,base_param.hr,base_param.ease,base_param.wratio,base_param.hratio,base_param.paraph

local af = Def.ActorFrame{}

local res = 8
for i = 0, sh/res do
	af[#af+1] = paraph.AMVQuad({Height=res,uv1={0,i/(sh/res)*hratio},uv2={wratio,(i+1)/(sh/res)*hratio}})..{
		OnCommand=function(self)
			self:SetTexture(self:GetParent():GetParent():GetParent():GetChild('elements'):GetTexture())
			self:y(-scy+sh*i/(sh/res))
		end,
		GlitchCommand=function(self)
			local div = math.cos(math.rad(i*16))*32+math.random(-32,32)
			self:x(div):vibrate():effectmagnitude(0,2,0):effectperiod(bt/16)
		end,
		NormalCommand=function(self)
			self:x(0)
		end,
	}
end

return af