Adding Controls

Q-SYS Control 101 Training : Scripting Basics

1 ) Introduction

8m 37s

3 ) Simple Communication

12m 49s

4 ) Feature License Activation

4m 12s

5 ) Block Controller

19m 7s

7 ) Flow Control

34m 20s

8 ) Control 101 Conclusion

1m 42s

Lesson Description

Adding Controls 8m 23s

Add customized controls in a variety of ways, and use your Lua script or Block Controller to control them.

Video Transcript

Adding Controls 8m 23s
0:08
Whether you’re programming with Lua script, the Block Controller, or simple Control Components,
0:13
the end result is often to put some sort of button on a UCI for the user to activate. Perhaps your
0:19
button is going to launch your custom script, or maybe be controlled by a script – whatever it is,
0:25
you’ll need to link those controls somehow to your programming. This will often mean you need to
0:31
add blank controls to your design, so let’s look at how to do that in each of the three methods.
0:37
As a reminder, there are only a few fundamental types of controls: Buttons and Knobs are interactive,
0:45
while Meters and LEDs simply display information. Text fields could potentially be either – you could
0:52
input information into a text field, or you could use it to display another control’s string.
0:59
To add a blank button directly into your design, you could grab the Custom Controls component. By
1:05
default it has nothing in its control panel, until you define which control you’d like here in the
1:11
Properties.
1:13
You can add multiple copies of the same type of button in Groups, so let’s select a type for our first
1:19
Group. Here it looks like there are about 20 different types of controls, but they’re all variations of
1:26
the same five we mentioned earlier.
1:28
These are all different types of knobs, and these are all buttons, see? They just have different
1:34
predetermined ranges and denominations, which you may also be able to customize.
1:40
Once you’ve selected one type of control for one group, you can add more identical controls by
1:47
increasing the Count number, from 1 up to 256. You now also have an option to add a second Group
1:54
for a new type of control.
1:56
Be aware that you can’t select the same type of control for your second group. If you need more than
2:02
256 controls of the same type, you’ll need to add another Custom Controls component.
2:08
Thinking back to our earlier video on the Q-SYS Control Tree, the differences between these controls
2:14
might make more sense now. A Mute button and a Toggle button, for instance, have the exact same
2:21
Values and Positions, but a Toggle button has strings of true/false while a Mute button has strings of
2:29
muted/unmuted.
2:32
If you added a Generic Float knob with the same range as a Level Knob, then they would have the
2:38
exact same numerical Value and Positions, but the String of the Level Knob will include “dB” at the
2:45
end.
2:46
Visit the Help file for a full list of the Values, Positions and Strings of these controls, as well as their
2:52
default and customizable ranges.
2:55
If you’re using Control Components, then you can start wiring these custom controls directly to
3:00
whichever control pins you like. If you’re using the Control Script component, then you could wire
3:05
these to your script.
3:07
You can then reference that control within the script by using the keyword Controls, which is the
3:13
main object of the control tree.
3:15
In this case, Controls.Inputs or Controls.Outputs, depending on where it’s wired. You’ll also need to
3:23
note which pin it’s connected to in a bracket, which is known as its index.
3:28
You could then extend this control tree to reference a specific property of the control. Using the
3:34
print command we learned about in the previous video, I could print this control’s value to the debug
3:40
window with the command “print (Controls.Inputs[1].Value)”.
3:46
However, if you’re creating custom controls just to wire them to a Control Script, you might want to
3:52
use the Text Controller component instead. This component allows you to add blank controls to your
3:58
design, but those controls are already embedded in your script which makes them easier to
4:03
reference. A reminder that older versions of Q-SYS have the “Scriptable Controls” component instead
4:09
of the Text Controller. Their functionality is mostly the same, but they have a slightly different
4:14
interface. We’ll focus on the Text Controller version.
4:18
The interface for adding controls in this component is different than the Custom Controls
4:23
component, but the concept is the same. Rather than defining the controls in the Properties, we can
4:28
add them directly here in the control panel.
4:32
Start by clicking the plus button to Add a Control, and you can then specify what type of control it is
4:38
by category. All buttons are grouped together, and then you can define if it’s a momentary, toggle, or
4:45
trigger button. If we select Indicators, we’ll find our LEDs, Meters, and Text displays.
4:52
Personally I find this organization a little more intuitive than the Custom Controls we just looked at,
4:58
because that was arranged alphabetically, whereas these are grouped by function.
5:03
For controls with a customizable range, you can specify the Min and Max values. And if you’d like to
5:10
expose this control to be wired to something else within Q-SYS, you can choose to include an Input or
5:17
Output pin, or both, which you’ll notice are added to your component in the Schematic.
5:23
You also have the ability to name this control, which I highly recommend you do. “Control 1” isn’t a
5:30
great name. You could name it after yourself – Kevin.
5:34
What? How did I know your name was Kevin? I’m just that good. All the Kevins out there right now
5:41
are freaking out, and everyone else is like, “My name’s not Kevin.” Anyways, the benefit of naming
5:45
your control is that you can address that control by its name within the script.
5:50
Rather than Controls.Inputs[1] which we saw in the previous example, I can now reference this
5:57
control with Controls.Kevin in the script. If you add multiple counts to the same Control, you’ll have
6:05
to reference that index in the Lua Control tree like this: Controls.Kevin[1], much like the inputs of the
6:12
Control Script.
6:14
Be careful about using spaces in the names of your controls. If your control name includes a space,
6:20
you’ll need to reference it in brackets and quotes like this: Controls.[“Kevin Jones”]. PS – If there’s a
6:31
Kevin Jones watching this, he just lost his mind.
6:35
Also, do yourself a favor and use a consistent naming convention, so that if another programmer
6:40
needs to work on this design some day, they can easily understand your labels.
6:45
Finally, let’s look at the Block Controller. Double-click this control panel, and you’ll see the same
6:51
interface that we saw in the Text Controller. You can add buttons, define their type, etc.
6:57
Once again you have the option to add Control Pins to the component, and give your control a name.
7:03
This time, if you include a space in the name of a control, don’t worry about it. The Block Controller
7:10
knows how to compensate for that possible syntax error by building in the brackets and quotes
7:15
appropriately when it compiles, so go crazy, Kevin. Name them whatever you want.
7:19
“This guy is obsessed with Kevins.”
7:21
“Hey Kevin, what are you watching?”
7:23
“Get out of my cube, Kevin!”
7:26
One big benefit to the Block Controller is that you can also add Connections in this same style. Similar
7:33
to the Command Buttons, you can specify if this is a TCP, UDP, or Serial connection, and provide a
7:40
name.
7:41
The IP address and Port number can be adjusted once you’re in Emulation or Run mode, or if you
7:48
want to control these dynamically you can expose Control Pins for them.
7:53
Inside the Block Controller, you’ll see these connections listed beneath your Controls, with new
7:58
blocks associated with all the possible actions you might perform over a connection like this. We’ll
8:03
look at these connections in a later video.
8:07
That’s it for adding controls. There’s a quick exercise in your Control Worksheet to complete now.
8:12
Once you’re done, move on to the next section, in which we’ll look at some of the other Control Tree
8:16
branches associated with these controls.