LuaFs - Lua Scripting for Freestyler DMX
-
- Knows how to turn Lights ON
- Posts: 4
- Joined: April 7th, 2010, 9:52 pm
- FreeStyler Version: 3.5.4
- I Use FreeStyler for: Nightclub Lighting
LuaFs - Lua Scripting for Freestyler DMX
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
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
You do not have the required permissions to view the files attached to this post.
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: LuaFs - Lua Scripting for Freestyler DMX
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");
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");
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: LuaFs - Lua Scripting for Freestyler DMX
--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");
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");
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
- Mattotone
- Android Dev (Moderator)
- Posts: 1238
- Joined: July 10th, 2007, 5:30 pm
- FreeStyler Version: BETA
- I Use FreeStyler for: Just for the Fun of it.
Re: LuaFs - Lua Scripting for Freestyler DMX
--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");
Print("ALL CHANNELS INCREMENT");
delta=255/512;
v=0;
for c=1,512,1 do
fsSetOutput(c,v);
v=v+delta;
end
Print("END");
Freestyler Addons www.120db.uk
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
Free Dropbox. 2GB account http://db.tt/J4c5G8C
$100 free credit @DigitalOcean Private Server: https://m.do.co/c/5c4a7c7d6693
Freestyler Android App: https://play.google.com/store/apps/deta ... rts.fs1024
-
- Knows how to turn Lights ON
- Posts: 3
- Joined: November 10th, 2011, 6:48 pm
- FreeStyler Version: 3.4.4
Re: LuaFs - Lua Scripting for Freestyler DMX
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?
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?
- Spirit
- Pro Supporter! (Moderator)
- Posts: 1421
- Joined: July 10th, 2010, 8:55 pm
- FreeStyler Version: 3.5.9
- I Use FreeStyler for: Nightclub Lighting
Re: LuaFs - Lua Scripting for Freestyler DMX
Uhhmm this can take a While as the Devolper only posted LuaFS and isnt much online..
/spirit
/spirit
AMD FX-6100 (3.6ghz)x6, Nvidia 770GTX 4GB, 8GB Ram,ROG MB, enttec Pro, Open enttec, Velleman, T2250MTS-B1 22"touchscreen, Ilyama 23" screen, scans, dimm, rgbled, laser, soundsystem Just a drive-in show. Live and Dance
-
- Knows how to turn Lights ON
- Posts: 3
- Joined: November 10th, 2011, 6:48 pm
- FreeStyler Version: 3.4.4
Re: LuaFs - Lua Scripting for Freestyler DMX
OK Thanks. Figured it was a long shot.
-
- Knows how to turn Lights ON
- Posts: 3
- Joined: November 10th, 2011, 6:48 pm
- FreeStyler Version: 3.4.4
Re: LuaFs - Lua Scripting for Freestyler DMX
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
- djSupport
- Hosts the Freestyler Forum and is an Admin!
- Posts: 1902
- Joined: July 9th, 2007, 6:57 pm
- FreeStyler Version: Forum la
- I Use FreeStyler for: Just for the Fun of it.
- Contact:
Re: LuaFs - Lua Scripting for Freestyler DMX
I have updated the web link to LuaFs perhaps if you still need assistance you can contact him from there
Heather Trott, You Babe! I Drive a Dacia Duster and Explore! Check it out
- lindsayward
- Can now teach FS to others (Hopefully!)
- Posts: 89
- Joined: April 5th, 2013, 12:54 am
- FreeStyler Version: 3.5.5
- I Use FreeStyler for: Church
Re: LuaFs - Lua Scripting for Freestyler DMX
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"
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"
-
- Knows how to turn Lights ON
- Posts: 4
- Joined: April 7th, 2010, 9:52 pm
- FreeStyler Version: 3.5.4
- I Use FreeStyler for: Nightclub Lighting
Re: LuaFs - Lua Scripting for Freestyler DMX
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
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
- lindsayward
- Can now teach FS to others (Hopefully!)
- Posts: 89
- Joined: April 5th, 2013, 12:54 am
- FreeStyler Version: 3.5.5
- I Use FreeStyler for: Church
Re: LuaFs - Lua Scripting for Freestyler DMX
Thank you. This is a useful update.
- lindsayward
- Can now teach FS to others (Hopefully!)
- Posts: 89
- Joined: April 5th, 2013, 12:54 am
- FreeStyler Version: 3.5.5
- I Use FreeStyler for: Church
Re: LuaFs - Lua Scripting for Freestyler DMX
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...)
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...)