Introduction to Programming

Q-SYS Control 101 Training : Introduction

3 ) Simple Communication

15m 13s

4 ) Feature License Activation

4m 12s

5 ) Block Controller

19m 7s

7 ) Flow Control

34m 20s

8 ) Control 101 Conclusion

1m 42s

Lesson Description

Introduction to Programming 8m 37s

Begin by (re)meeting your instructor for this series and discover the variety of ways you can program your Q-SYS design to perform custom tasks.

Video Transcript

Introduction to Programming 8m 37s
0:08
Welcome to the Q-SYS Control Training course. My name is Nate Makaryk and I will be your
0:12
instructor for this series, in which we'll dive down the rabbit hole of using Q-SYS as a robust
0:18
control platform. If you’re watching this, I expect that you are already very familiar
0:23
with the Q-SYS Designer software, because I’m not going to bother explaining any basic
0:27
navigation concepts as we go along. I also expect that you’re comfortable with building audio
0:33
system architecture and processing, but now we’re going to leave the audio
0:37
side of things behind and focus on control.
0:41
This course is intended to be an online prerequisite for an in-class Q-SYS Control training session.
0:46
However, you can absolutely learn a lot from this series even if you aren’t planning
0:51
on attending one of our classroom sessions at the end of it.
0:54
The goal of this series is to get you fluent in the various ways Q-SYS can be used for
0:58
programming, so that you can hit the ground running in class and can start connecting
1:02
to real third-party devices. But with these online videos, you probably don’t have any hardware,
1:08
so we can only go as far as Emulation Mode will allow us. (Fortunately, that’s still pretty far.)
1:14
To help you out, we’ve created an accompanying worksheet that includes exercises for you to follow
1:19
after certain lessons. You’ll download this worksheet in the section that immediately follows this
1:24
video, or you can visit the “Download and Links” tab from any of the videos in this course.
1:31
The first half of this worksheet we’ll use in this online Control 101 class to test your programming
1:37
skills as we go, and then the second half will be used if you attend a live Control 201 class.
1:45
Control is a wide subject that covers a lot of things. By now you should be familiar
1:51
with building a User Control Interface, and adding elements from your design onto a
1:55
touch screen to give your user control of the system. On the great big spectrum of
1:59
control within Q-SYS, this is easy-peasy! Using the controls inside a component’s control
2:05
panel to make it do what it’s designed to do is simple – and it actually gets you pretty far!
2:10
But what if you want your buttons to interact with each other, or to potentially do
2:14
different things depending on the settings of other controls? To accomplish this,
2:19
you’ll need to explore the world of programming. There are actually several routes
2:23
you can follow in Q-SYS Designer in regard to programming, and we’ll walk through
2:27
each of these, discussing the pros and cons of each.
2:31
More complicated topics on the Control spectrum include using Q-SYS to control
2:35
other devices outside of the Q-SYS architecture. There are endless types of devices
2:40
that can either send or receive control data. This might be simple connections to analog
2:44
buttons or potentiometers, uni-directional commands sent to a third-party lighting controller,
2:49
or bi-directional communications between video matrices, televisions, security systems…
2:54
you name it. If it’s controllable, Q-SYS can control it.
2:58
At an extremely high level, all programming has some universal commonalities – and
3:03
once you learn them, you’ll start to see them playing out in your everyday life as well.
3:07
Programming is the process that happens in between a thought and an action.
3:12
For instance, here’s an experiment I’d like you to do with me. Would you kindly … clap
3:17
your hands. Did you do it? Let’s take a look at what just happened.
3:23
I delivered a request to your brain – “Clap your Hands.” Your brain made a series of
3:28
split second decisions, and the end result was that you either clapped your hands, or
3:32
you didn’t. My command was the input – something that has entered the system,
3:37
which requires a reaction. The output is a command to your hands. In between, the
3:43
decision-making process is full of conditional statements, functions, and references
3:47
to external parameters, which you may have not even been aware of.
3:50
For instance, do you want to follow the instructions, or not? Are you in an environment
3:57
in which it would be acceptable to suddenly clap your hands, or not? Let’s reference
4:01
an external variable that states whether or not there is currently something in your hands
4:06
that would prevent you from clapping. Then a comparative function would decide
4:10
whether your desire to comply with the command is greater than the inconvenience
4:13
of putting the thing in your hand down. The desire to do it may be overridden by a
4:18
global variable of how many hands you actually have.
4:23
The desire to not do it may be overridden by my subliminal reference to the video
4:28
game Bioshock, which could force you to perform any command that contains the
4:31
words “Would you kindly.” All of these types of conditional statements happen in the
4:36
blink of an eye, and the end result is an output – in this case, either a function is
4:41
launched that tells your hands to clap, or if the conditions of satisfaction have not
4:45
been met then the system remains unchanged. Understanding the flow of all these
4:50
conditional statements, references to variables, parameters and functions, what we
4:54
mean by input and output – this is the skeleton of programming.
4:59
Our brains do it automatically, so it might seem like common sense to spell it out like
5:03
this, but in order to program a computer you have to consider every possibility, and
5:08
logically plan for it. The good news is that no matter which method you use to program,
5:13
these fundamental concepts are going to be true for every task you want to accompish.
5:17
You just need to be able to break it down into small identifiable pieces,
5:21
and we’re going to teach you what each piece looks like.
5:24
In this course, we’re going to show three different methods that you could use for programming:
5:28
Control Components, Lua Scripting, and the Block Controller. Each have their own
5:34
advantages and disadvantages, and we’re going to constantly jump back and forth
5:38
between all three of these methods throughout this course so that you can
5:41
compare their methods to each other.
5:43
Control Components allow you to manipulate simple ways
5:45
for controls within Q-SYS to interact with each other,
5:48
and apply some basic functions that compare the states of multiple controls,
5:52
effect different options based on a particular input,
5:55
and gate logic paths on or off. Control Components are great for simple interactions,
6:00
or for deciding between two choices. You can certainly get clever with them to make more
6:05
complicated scenarios, but eventually you’re going to hit a wall where you need a
6:08
more robust tool.
6:10
Scripting is the other end of the spectrum. With scripting, you can accomplish almost anything,
6:15
but you have to know how to write script in that particular language to make it happen.
6:20
The Control Script editor in Q-SYS will take you to an empty black workspace where you can type
6:24
code, specifically the coding language Lua. You’ll need to understand the syntax rules of Lua,
6:30
as well as the Q-SYS-specific additions we’ve made to the Lua database in order to
6:34
properly accomplish anything.
6:36
There’s no way this course could teach you all of Lua from scratch, but we will show
6:41
you some basics. If you learn how to write in Lua, you can program complicated interactions
6:46
with third party devices that are connected via the network or serial ports, you can make arrays
6:51
and timers, you have the ability to parse complex strings, you’re really limited
6:56
only by your expertise in coding.
6:58
Now that may seem like a big jump between Control Components and the Control Script component,
7:04
which is where our third option comes into play – the Block Controller.
7:08
The Block Controller is a visual coding tool that is designed to let you use interlocking blocks,
7:14
which will transform the end result into usable script. This means you can accomplish
7:18
a lot of things Lua can do without knowing its exact language protocols, and without
7:23
making any syntax errors. You do need to understand some of the basic principles of how
7:28
coding languages work in order to build in the Block Controller, and we’ll show you how
7:32
to apply that knowledge.
7:34
Once again, there’s no way we can make you an expert on all three of these methods
7:37
just by watching the videos. Our goal is to get you comfortable with each method,
7:42
we’ll show how common actions can be accomplished across all three of them, and
7:46
hopefully inspire you to start exploring on your own. After many of the videos we’ll
7:51
ask you to go to your Control Training Worksheet and complete an exercise, but feel
7:55
free to spend even more time than that pushing the limits of each process that we talked about.
8:00
One bit of housekeeping before we get started - some of the tools we’ll be using
8:04
such as the Block Controller and the scripting components are found here in the Schematic Library.
8:09
Deploying a design that has either of these components will require you to obtain
8:13
a Q-SYS feature license from your friendly QSC sales partner. You can build and test in
8:18
Emulation Mode as much as you like, but once it’s time to connect to a real Core processor,
8:23
be sure that you’ve installed the Scripting Engine feature license.
8:27
Alright, we’ll start off by exploring the first method, the Control Components. Scripting
8:32
and Block Controller obviously have a lot in common so we’ll look at those together a little later on,
8:36
but first we can spend some time on Control Components all by themselves. So take a quick break,
8:43
take a deep breath, and get ready to dive into this Q-SYS Control Training course.
8:48
Move on to the next video whenever you're ready.