How do I set a Property to a specific value from a button

Here’s how to use a button to set a device property to a specific value. In this example we’ll use a button to reduce the audio level on channel1 of a Ross Xpression by -6dB.

Our example panel

media_1354017118474.png

So we’ve got our Ross Xpression device and we’ve added a button named Dim_A1. Now let’s see how we put it to use.

Select the button to display it’s properties

media_1354020094576.png

clicking on the button in the work area selects it and the Property Editor shows the various properties of the button.

Set the buttons Group Index to -1

media_1354019970396.png

This makes it a latching button i.e. click-on, click off

Open the OnClickOn script

media_1354017447499.png

When you double-click on the OnClick event script in the Property Editor it opens the Script Editor window.

Choose Xpression_1 from the Device dropdown menu

media_1354017729025.png

Each script command targets a device. So first we have to select the device.

Select the Action to perform

media_1354017823832.png

In this case we want to set a property, so we choose Set from the Action dropdown. There’s a brief explanation of each action next to it’s name to help you decide what action to choose. In this case it says “Set property to value” which is what we want.

Choose the Property to set

media_1354017998665.png

When you chose the Set action some new dropdown lists appeared below. These let you choose the Property you want to set and the value to set it to. In this case we’l pick AudioAIn:Gain1.

Set the value

media_1354018220685.png

Here we’ve set a value of -6 to dim the audio level by -6dB. You can set the value either by typing it directly into the box, or by using up and down arrows to change the value.

Press the Update button to add the command to the script

media_1354018340597.png

Now you press OK to exit the Script Editor and run the panel, the button will set the audio gain on A In ch 1 to -6db when the button is clicked On. This is fine, but obviously you’ll want to restore it to zero when the button is click Off. You can do this in exactly the same way editing the OnClickOff script.

Edit the OnClickOff script

media_1354019710447.png

Double click the OnClickOff event script in the Property Editor.

Create a script for OnClickOff

media_1354019120742.png

The script to reset the level to zero is almost exactly like the script to dim the audio level except this time we set the value of the property to 0.

Another way to set a property using lua script

media_1354021339318.png

Here’s exactly the same command expressed in lua, the programming language embedded within Helm. You set properties using the helm.set command and the parameters go in quotes because they are strings.

Run the panel and see how it works !

media_1354020220376.png