Page 1 of 1

LuaFs - Lua Scripting for Freestyler DMX

Posted: July 25th, 2011, 1:00 pm
by jumanibi
I programmed this application that uses Lua scripting language to control Freestyler, you can control sequences, buttons, cues, create sequences, send output values, automatize tasks, ....

Visit my website for help and downloads...

http://www.juanjolopez.net/index.php/pr ... styler-dmx

by Juanjo Lopez
;)


More info about Lua...

http://www.lua.org/about.html

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: October 12th, 2011, 3:16 pm
by Mattotone
Print("CREATE PAN / TILT SEQUENCE");

fsNewSequence();

numSteps=10;

c=0;
freq=1/numSteps;
delta_tilt=255/numSteps;

while (c<numSteps) do

--step values
v=128.0+(128.0*(math.sin(2.0*3.14*freq*c)));

fsPanChannel(v);
fsTiltChannel(c*delta_tilt);

--next step
if c<(numSteps-1) then
fsAddScence();
end

c=c+1;
Sleep(50);

end

--end
Print("END");

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: October 12th, 2011, 3:17 pm
by Mattotone
--start
Print("BLACKOUT HOUR PROGRAMMED...");

--programming hour and minute
h=12;
m=26;

while (StopButton()==0) do

--get current date time
d=os.date("*t");

--check hour and minute
if (d.hour == h) and (d.min==m) then

Print("Blackout event!");
fsToggleBlackout();

--wait 1 minute to next check
SleepS(1);
end

--wait 1 second
Sleep(1000);
end

--end
Print("END");

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: October 12th, 2011, 3:18 pm
by Mattotone
--In Freestyler: Output -> Show Output
Print("ALL CHANNELS INCREMENT");

delta=255/512;
v=0;

for c=1,512,1 do

fsSetOutput(c,v);
v=v+delta;

end

Print("END");

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: December 13th, 2012, 7:54 pm
by Ron Mc.
Hi Juanjo,

Thanks for developing and posting the LuaFS program. I have been having fun learning to control a strip of WS2811 led lights with LuaFs. The strip has 150 IC chips which means 450 DMX channels.

The LuaFs console works well on one of my Windows 7 computers but the Windows 7 computer where LuaFs is to be implemented, the whole console is not shown. There are no sliders, no console output window, and no RUN and STOP buttons. Only the main window and menu appear. The problem computer uses very large fonts so I believe that may be causing the problem. Is there any chance of a fix for this?

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: December 13th, 2012, 8:12 pm
by Spirit
Uhhmm this can take a While as the Devolper only posted LuaFS and isnt much online..

/spirit

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: December 13th, 2012, 10:04 pm
by Ron Mc.
OK Thanks. Figured it was a long shot.

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: January 10th, 2013, 11:13 pm
by Ron Mc.
This script was written for RGB LED Strip Lights that have a number of IC chips, like the WS2811that i have. It should work on most strip lights that with utilize IC chips, but could also be used on a series of 3 channel RGB Lights.

Code: Select all

--[[ rainbow_motion.lua: cycles through the colors of the rainbow 
This script written for RGB LED Strip Lights that have a number of IC chips,
but should also work with a series of 3 channel RGB Lights]]--

DMXstart = 25 	--> DMX start address
Channels = 3	--  number of channel per LED
IChips = 131	--> number of IChips on your strip, look good on shorter strips too
DMXend = DMXstart + (Channels* IChips) - 1
delay = 20		--> User Input, milliseconds, used for timing speed
step = 12 		--> User Input, number of steps between primary and secondary colors
-- steps that work: 4, 6, 7, 9, 12, 14, 18, 21, 28, 36 -- 
--[[ if anybody can rework this script so that STEP variable can be
any integer between 1 and 36 or more, please post, 
as I'm a bit stumped]]--
bump = math.floor(255 / step)
top = step * bump 

--**Length must as long or longer then the strip
	if (step * 6) / IChips < 1 then Length = IChips / (step * 6);
	Length = math.ceil(Length) * (step * 6) * Channels;
	else Length =(step * 6)/ IChips * IChips;
	Length = math.ceil(Length) * Channels;
	end 
Length = math.ceil(Length) -- of rainbow pattern
t = {}
z = nil
color = {g = 0, r = top, b = 0} --colors on my strip are arranged GREEN RED BLUE
count = 1

Print(Length)
--start
Print("START")	
while (StopButton()==0) do 

	for c=1,Length,3 do --this loop writes all GRB values to a Table Array
	if color.g ~= top and color.r == top and color.b == 0 then --Red first
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.g = color.g + bump

		else if  color.g == top and color.r ~= 0 and color.b == 0 then
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.r = color.r - bump

		else if color.g == top and color.r == 0 and color.b ~= top then --Green
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.b = color.b + bump

		else if  color.g ~= 0 and color.r == 0 and color.b == top then
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.g = color.g - bump
	
		else if color.g == 0 and color.r ~= top and color.b == top then --Blue
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.r = color.r + bump
	
		else if color.g == 0 and color.r == top and color.b ~= 0 then
		t[count] = color.g 
		t[count + 1] = color.r 
		t[count + 2] = color.b 
		count = count + 3
		color.b = color.b - bump
		end
		end
		end
		end
		end
		end
	end
break
end

-----------FUNCTIONS--------------------------------------------------------------
Pixels = function(c) 
fsSetOutput(c,t[count]) fsSetOutput(c+1,t[count+1]) fsSetOutput(c+2, t[count+2])
end
-------------------
StripRefresh = function() 	--> moves all values in Table Array ahead one place,
for x=1,3,1 do				-- and pastes what's dropped off the end to the front	
z = ( t[Length] )
table.insert(t,1,z)
table.remove(t)
end
end
-----------------------------------------------------------------------------

count = 1
repeat
 for c=DMXstart,DMXend,3 do  --> This loop outputs the whole strip 
		Pixels(c)
		count = count + 3
	end
Sleep(delay)
count = 1
StripRefresh()
until (StopButton()~=0)
--end

Print("STOP")	
	--set all output channels to 0 --> turn off the lights
	for c=DMXstart,DMXend,1 do 
		fsSetOutput(c,0);
	end
	

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: January 16th, 2013, 7:17 am
by djSupport
I have updated the web link to LuaFs perhaps if you still need assistance you can contact him from there :)

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: August 13th, 2013, 12:48 am
by lindsayward
FYI...
I just asked the LuaFS developer about this project and he wrote:
"LuaFS is an old project and now i don't have enough time for continue with it. I'm sorry.
I hope continue with this project in the future.
thanks, Juanjo"

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: August 13th, 2013, 10:57 am
by jumanibi
I have updated LuaFs to version 0.2
i don't have enought time to this project but i added some minor, but important, features
you can download from here:

https://www.dropbox.com/s/hl6ah2n3lypbivt/LuaFs02.zip

New features:
luafs.ini file for load/save configuration

in this file you can setup:

script=template.lua <--- initial script to load
stayontop=0 <--- stay on top option (0 or 1)
runonstartup=1 <---- run script on startup (0 or 1)
minimized=0 <---- run minimized

thanks for suggestions and sorry for the poor updates
Juanjo

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: August 14th, 2013, 3:53 am
by lindsayward
Thank you. This is a useful update.

Re: LuaFs - Lua Scripting for Freestyler DMX

Posted: October 6th, 2013, 2:02 pm
by lindsayward
Hi. I just thought I'd add that I couldn't get this to work properly in hidden mode.
I wanted to have it just run a script essentially without me knowing about it, but it wouldn't actually run unless it had focus.
I got my solution by using AutoHotkey scripting to launch this LuaFS, run the script and then close the LuaFS window. An extra step, but it works. (and I'm loving what I can do with AutoHotkey now...)