Look macros

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
amoyer
Posts: 380
Joined: Tue Mar 11, 2008 5:28 pm
Location: Oakville, ON

Look macros

Post by amoyer » Thu Mar 17, 2011 12:45 am

Since we finally got 10.8.2 installed this week I'm now trying to setup macros in all of the playback buttons. One of the sets of macros that I'm trying to setup is for gobo rotation (CW fast, CW slow, stop, CCW slow, CCW fast). We added time to these as we noticed that were changing too abruptly but this of course didn't fix changing from CW to CCW.

What I was hoping to do was add a script that checked to see what direction the gobo was spinning and if spinning in the opposite direction, take it to a stop first then change direction and go back up to speed.

Using HC.AttributeGetValue I can get the direction of the selected fixture but that is really as far as I can get. I know I need to use "if then else end" functions but I seem to be missing something.

Code: Select all

a=HC.AttributeGetValue('live', '1', 'gb Mode')
b='Rot CW'

if (a==b) then
    HC.ButtonWingButtonPress (1, 1)
else
    HC.ButtonWingButtonPress (1, 2)
end
Regardless of whether the fixture is set to 'Rot CW' or 'Rot CCW' it still is doing the 'else' option.

Suggestions?

Andrew
Andrew Moyer - Oakville Centre for the Performing Arts
Light Palette Live (v10.8.6)
Rack Palette (v10.8.6)
Classic Palette ii(v10.8.5)

User avatar
MickCrozier
Posts: 288
Joined: Tue Mar 31, 2009 3:10 am
Primary Venue / Use: Professional Theatre
Where I Am: Melbourne, Australia
Location: Melbourne, Australia

Re: Look macros

Post by MickCrozier » Thu Mar 17, 2011 3:25 am

This is something I've been to meaning to chat to the good folk at horizon about.

Some atrributes appear not accesable. Colo(u)r and Gobo 2 come to mind.
Others are a bit funny - Strobe can not return a value ('Strobe+V'), but will return the display text (such as 'Open') with 'Strobe'.
Colour A (as written in the ML window) can only be set using 'Color A', but can be read with 'Colour A' or 'Color A'
Any of the phantom attributes I've tried such as 'gb mode' can not be set and appear to return an empty string when read.
In your case:
a =
b = 'Rot CW'

a never = b

A nice trick is to use print(a) - it will appear in the debug pane just below the script.
Formerly Durisian (who died peacefully of digital old age)

User avatar
amoyer
Posts: 380
Joined: Tue Mar 11, 2008 5:28 pm
Location: Oakville, ON

Re: Look macros

Post by amoyer » Fri Mar 18, 2011 11:00 am

If I put the script

Code: Select all

print(HC.AttributeGetValue('live','181','gb Mode'))
I get a response of 'Rot CCW'

It appears that I can't get it to either equal or not equal another value to get it to do the 'if... then... else... end' function. :(
Andrew Moyer - Oakville Centre for the Performing Arts
Light Palette Live (v10.8.6)
Rack Palette (v10.8.6)
Classic Palette ii(v10.8.5)

User avatar
MickCrozier
Posts: 288
Joined: Tue Mar 31, 2009 3:10 am
Primary Venue / Use: Professional Theatre
Where I Am: Melbourne, Australia
Location: Melbourne, Australia

Re: Look macros

Post by MickCrozier » Fri Mar 18, 2011 7:08 pm

Awesome!
I had a play here and it wouldn't go
There will be a separator after the word

Robert wrote some better code for this, but I can't find it - here's what I use

Code: Select all

a = HC.AttributeGetValue('live', '1', 'gb Mode')
n = #a
while n > 0 and a:find("^%s", n) do n = n - 1 end

a = a:sub(1, n)
Formerly Durisian (who died peacefully of digital old age)

Post Reply