return Def.ActorFrame{
  Name= "actor_Ad",
  Def.Quad{
    Name= "actor_Bd",
    InitCommand= function(self)
	
		function perframe( beat, endBeat )
			if not endBeat then endBeat = beat+1 end
			local cur = GAMESTATE:GetSongBeat();
			if cur>=beat and cur<endBeat then return true end
			return false
		end
		
		--how can I make simple m0d?
		--this will instantly turn a mod on to max and then quickly turn it off with the specified parameters
		--it's a simple mod
		
		function simple_m0d(beat,strength,mult,mod)
			if not strength then strength = 400 end
			if not mult then mult = 1 end
			if not mod then mod = 'drunk' end
			
			local alive = math.max(2*mult*math.abs(strength)/100,0.25)
			
			table.insert(mods,{beat,0.1,'*100000 '..strength..' '..mod,'len'});
			table.insert(mods,{beat+.1,alive,'*'..((1/mult)*math.abs(strength)/100)..' no '..mod,'len'});
		end
		
		function simple_m0d2(beat,strength,mult,mod,pn)
			if not strength then strength = 400 end
			if not mult then mult = 1 end
			if not mod then mod = 'drunk' end
			
			local alive = math.max(2*mult*math.abs(strength)/100,0.25)
			
			table.insert(mods,{beat,0.3,'*'..math.abs(strength/10)..' '..strength..' '..mod,'len',pn});
			table.insert(mods,{beat+.3,alive,'*'..((1/mult)*math.abs(strength)/100)..' no '..mod,'len',pn});
		end
		
		function simple_m0d3(beat,strength,duration,bpm,mod)
			if not strength then strength = 400 end
			if not duration then duration = 1 end
			if not bpm then bpm = 120 end
			if not mod then mod = 'drunk' end
			
			local alive = duration * (60/bpm)
			local str = (1/(duration * 60/bpm)) * (math.abs(strength)/100)
			
			table.insert(mods,{beat-duration,duration,'*'..str..' '..strength..' '..mod,'len'});
			table.insert(mods,{beat,duration*1.1,'*'..str..' no '..mod,'len'});
		end
		
		--alternates a mod back and forth before resetting to 0
		--beat,num,div,amt,mod,pn
		function mod_wiggle(beat,num,div,amt,mod,pn,first)
			local fluct = 1
			for i=0,(num-1) do
				b = beat+(i/div)
				local m = 1
				if i==0 and not first then m = 0.5 end
				table.insert(mods,{b,1,'*'..math.abs(m*amt/10)..' '..(amt)..' '..mod..'','len',pn});
				fluct = fluct*-1;
			end
			table.insert(mods,{beat+(num/div),1,'*'..math.abs(amt/20)..' no '..mod..'','len',pn});
		end
		
		--like wiggle, but springier
		--beat,strength,num,mod,pn
		function mod_spring(beat,strength,num,mod,pn)
			local fluct = 1;
			for i=0,num do
				if i==0 then mult = 0.5 else mult = 1 end
				local amt = (num-i)/num
				local b = beat+(0.05*i)
				
				table.insert(mods,{b,0.3,'*'..math.max(math.abs(1000*strength*mult*amt),1)..' '..(strength*amt)..' '..mod,'len',pn});
				
				fluct = fluct*-1;
			end
		end
		
		--beat,strength,num,period,mod,pn
		function mod_spring_adjustable(beat,strength,num,period,mod,pn, first)
			local fluct = 1;
			for i=0,num do
				if i==0 then mult = 0.5 else mult = 1 end
				local amt = (num-i)/num
				local b = beat+(period*0.5*i)
				
				local m = 1
				if i==0 and not first then m = 0.5 end
				
				table.insert(mods,{b,0.3,'*'..math.max(m*math.abs((0.2/period)*strength*mult*amt),1)..' '..(strength*amt)..' '..mod,'len',pn});
				
				fluct = fluct*-1;
			end
		end
		
		--turns on beat for the beat specified, at the desired strength	
		
		function mod_Kiokubeat(beat,strength)
			if not strength then strength = 1000 end;
			table.insert(mods,{beat-.5,1,'*10000 '..strength..' beat','len'});
			table.insert(mods,{beat+.5,0.25,'*10000 no beat','len'});
		end
		
		switcheroo_flip = 0;
		switcheroo_invert = 0;
		switcheroos = {{0,0},{100,0},{0,100},{25,-75},{75,75},{25,125},{75,-125},{100,-100}}
		function switcheroo_add(beat,which,speed,len,pn)

			if not speed then speed = 1000000 end

			if switcheroos[which] then

				local targf = switcheroos[which][1]
				local targi = switcheroos[which][2]
				local sw_modlist = ''
				if switcheroo_flip ~= targf then
					sw_modlist = sw_modlist..'*'..(0.01*speed*math.abs(targf-switcheroo_flip))..' '..(targf)..' flip,'
				end
				if switcheroo_invert ~= targi then
					sw_modlist = sw_modlist..'*'..(0.01*speed*math.abs(targi-switcheroo_invert))..' '..(targi)..' invert'
				end
				table.insert(mods,{beat,len,sw_modlist,'len',pn});
				
				Trace(sw_modlist);
				
				switcheroo_flip = targf;
				switcheroo_invert = targi;
			
			end
			
		end
	end,
    OnCommand= cmd(visible,false),
  },
}
