
G P - 8 P / G P - 1 6 P S O F T W A R E
page 2 – 5
GPC-3 / Jan 2006
What does it mean? First, there is an action involved – someone is
going to press button 1 on the panel (as signified by BTN_1_PRESS), and
when they do, we want to know it. And we’re going to light the button for
them (as signified by btn_led (1, ON), where the ‘1’ refers to button 1 ) so
they know that we know they pressed it. Now, after the line that lights the
button, and before the closing bracket (‘}’) that marks the end of the action,
add this code:
Your action should now look like this:
The action now does what it did before, plus it turns on fader 4 on surface
1 (as signified by surf_set_input_on (1, 4, ON), where the ‘1’ is the number
of the surface – remember we specified an IP address for Surface 1 – and 4
is the channel number on the surface we are affecting).
We’re almost done. Let’s see if we might have made any errors. First, if
you haven’t already done so, save changes by selecting File | Save. Now we
are going to compile our script and see if anything bad happens. Select Build
| Compile. If you did exactly as instructed, and if I instructed you properly,
you will be pleased to see that everything succeeded. But my computer tells
me that I have an undefined symbol “ON” at line 17. Where’s line 17?
Double-click on the word “ERROR” in the main GUI window, and notice
that the line “btn_led (1, ON)” gets highlighted in the Script Editor window.
The compiler is telling us it doesn’t know the meaning of “ON”.
Here’s what’s happening. The panel, when it runs a script, knows that if
we say “1” it wants us to turn something on; it just doesn’t know that “ON”
and “1” are the same. So we have to tell it by adding this line:
which makes the whole script look like this:
Now try Build | Compile again (don’t forget to Save your work first).
Now it says Okay...
So there’s our simple sample script. Go ahead and try to add some other
features, like turn the fader off from button 2 (hint, when we say “OFF” the
panel needs to hear “0”), for example.