Intro into Variable - Using Vision Net and triggering looks

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
JohnGrimshaw
Posts: 1233
Joined: Tue Oct 16, 2007 12:51 pm
Primary Venue / Use: Other
Where I Am: International Man of Mystery
Location: Sydney, Australia
Contact:

Intro into Variable - Using Vision Net and triggering looks

Post by JohnGrimshaw » Fri Dec 12, 2008 3:49 pm

I used the following macro on an installation where an 8 button Vision Net panel was used to simply trigger a macro on the console.

The below code "looks" at the level of a particular submaster, and if it is greater then 0, fades it out over time. Else, if it is already zero, fades it up over time. The time is "set" by the eighth fader. The eighth fader is always a value between 0 and 100, so I divided this by 10, and added 3. That made the slowest fade 3 secs.

Code: Select all

PageName = "Sub Page 1"
SubNum = 1
SubTime = HC.LookGetValue(PageName,8) /10 +3

if
HC.LookGetValue(PageName,SubNum) > 0 

then
HC.LookFade(PageName, SubNum,0,SubTime)

else
HC.LookFade(PageName, SubNum,100,SubTime)

end
The vision net panels were setup with "Smart" buttons, so that there would be an LED indication of whether the Button was on or off.

Because I could see at the console if the button was "ON" (the button value was 1), or "OFF" (the button Value was zero) I later changed the code to be a little more specific about the action, putting two separate scripts in for each Variable button...

On Value 1

Code: Select all

PageName = "Sub Page 1"
SubNum = 1
SubTime = HC.LookGetValue(PageName,8) /10+3

HC.LookFade(PageName, SubNum,100,SubTime)


On Value 0

Code: Select all

PageName = "Sub Page 1"
SubNum = 1
SubTime = HC.LookGetValue(PageName,8) /10+3

HC.LookFade(PageName, SubNum,0,SubTime)
...and for more entertainment industry trivia and useless facts, just ask:
John Grimshaw
Managing Director
Stage Fast Pty Ltd

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Intro into Variable - Using Vision Net and triggering looks

Post by RobertBell » Fri Dec 12, 2008 5:30 pm

Don't forget:

Code: Select all

(HC.GetScriptSource('number')
Can be used in place of SubNum = 1 like this:

Code: Select all

SubNum = HC.GetScriptSource('number')
That way you can copy and paste macros on variables and you don't need to edit the code.
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply