These adverts are supporting the forum's costs and the products/services are not endorsed by the forum owners.
First have you tried?
Log in to Search the Forum for help!
Learn more about using FreeStyler at the FreeStyler WIKI HERE
Learn more about DMX in General at The DMX Wiki HERE

if all else fails and you need a fixture consider the fixture building service HERE

Which option for writing scripts to control FS from events

Discuss the latest developments or get support for them HERE.
Post Reply
User avatar
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

Which option for writing scripts to control FS from events

Post by lindsayward »

Hi there!
I've asked a couple of questions recently about things I want to do that FS can't do on its own (see below).

I see things like LuaFS (last modified 2 years ago), SendMessage, C# communication classes and things...

Which of these would be the best technology to use to modify/extend FreeStyler.
I need scripts to run in response to events in FreeStyler, or automatically (Windows).

Two things I want to be able to do are:

- Set 5 submasters to full intensity WHEN FreeStyler starts up. I've written a simple LuaFS script that does this, but I have to click the RUN button in LuaFS console. I want to be able to execute the script automatically - either in Windows or in FreeStyler.

- I want to be able to have a fader in FS that controls colour. I could write a script that takes a number (the fader value) and sets the colour of the selected fixture(s), but I don't know if it's possible to have a fader and if I could, how to get the value of it into LuaFS.

Can you let me know if these things are possible, and which programming option is the way to go?
I am fine with any programming language.

Thank you!

Lindsay


User avatar
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: Which option for writing scripts to control FS from even

Post by Mattotone »

Depends what you can do.
c#
vb.net
python
luaFS

c# or vb.net is probably the best bet, as you can create a gui very easily.
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
User avatar
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: Which option for writing scripts to control FS from even

Post by lindsayward »

Hi Mattotone, thanks for the answer. As I said at the end of my post, I'm fine with any language. In order, the languages I know best are Python (what option is available for Python?), C#, Lua, VB. So that isn't what matters - it's what will let me do what I want.
E.g. How do I respond to events like startup and moving a fader in FreeStyler. I do not want to create a separate GUI, I just want to respond to the existing one.
I looked at the API for LuaFS and they are all one-directional commands - sending data TO FS. I want to see events and get input FROM FS as well.
User avatar
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: Which option for writing scripts to control FS from even

Post by Mattotone »

all the languages have the same set of cammands, Freestyler can only be communicated to via send-message or tcp/ip.
Theres no real api to interact with events etc at present.

Matt
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
User avatar
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: Which option for writing scripts to control FS from even

Post by lindsayward »

Thanks - that's probably mostly what I needed to know - that you can't respond to events IN FreeStyler.
So I need something I can get Windows to run at the right time (perhaps with a delay until FreeStyler should be funning).

I asked the LuaFS developer about his 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"

Can you please let me know what is available for Python, and how I would go about starting?
I've seen the SendMessage PDF and it's a reference of SendMessage commands, but doesn't say anything about how to start (basic tutorial). (I can't just call FindWindow(...) from a Python/C# script...) Once I'm started, I could use the commands.

Thanks!
User avatar
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: Which option for writing scripts to control FS from even

Post by lindsayward »

OK... I downloaded Mattotone's Visual Studio project (viewtopic.php?f=38&t=2184#p22186) and wrote a simple C# console application that does what I want (set submasters to full on startup). I thought I'd post it in the thread where I first asked about this particular task: viewtopic.php?f=6&t=5350&p=22273#p22273

I'm still interested more in the development options including Python (if I search for "Python" on this forum, there is no mention of talking to FS with it) and Java (also no mention)?
Can you tell me more about the dll? Where did that come from? Is it just the Communicator class from that thread compiled?
User avatar
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: Which option for writing scripts to control FS from even

Post by Mattotone »

The python example is near the top of this topic, and communicates via tcp/ip.
The Dll is just a compiled version of my class for other languages to use i.e VB.net.

You could make your application launch fs and keep checking until FS is started then apply your startup values.
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
User avatar
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: Which option for writing scripts to control FS from even

Post by lindsayward »

It worked fine on my test machine, which has Visual Studio, but when I copy the release .exe file to my Windows XP machine where I use FS, it said it was not a valid Win32 app. I tried it also on a Windows 7 (64-bit) laptop and it said it needed .NET 4.5.

Is there a way to make this work on the XP machine? Do I need to recompile the dll for such a machine?
Thanks.
User avatar
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: Which option for writing scripts to control FS from even

Post by Mattotone »

check what minimum framework you have selected. .net4.5 is windows 7 plus. the dll if I remember rightly has been tested on xp. if not the class file is available on her to compile for xp
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
ikki_123
Knows how to turn Lights ON
Posts: 1
Joined: September 7th, 2013, 7:53 am

Re: Which option for writing scripts to control FS from even

Post by ikki_123 »

I also want to know??
User avatar
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: Which option for writing scripts to control FS from even

Post by Mattotone »

I trust all the necessary answers are in this thread as it stands.

dll xp. yes compile from source in 32bit ensure you have correct .net framework.

best language. I prefer c#

events api. no
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
Post Reply

Return to “FreeStyler 3rd Party Addons and utilities”