Trigger programming guide, Introduction, The basics – ETC Unison Mosaic Designer v1.11.0 User Manual
Page 214: Trigger script programming guide

Unison Mosaic Designer User Manual
Trigger Programming Guide
Introduction
The Unison Mosaic Controllers offer many useful show control capabilities. Frequently it is the ability to cope
with the particular show control needs of a project that is the critical factor in selecting a control system.
Show control broadly consists of two tasks. First we need to be able to interface with other devices, which may
either be triggering us or be under our control. The Unison Mosaic Controller supports most of the core interfaces
typically used for show control, either directly on the unit (contact closures, RS232, MIDI, TCP/IP, time and date)
or via Expansion Modules (RS485, SMPTE) or Remote Devices. Within the Triggers screen of the Designer soft-
ware we can configure the Controller to detect particular triggers and how to respond to them.
Second we need to be able to make decisions. These could be simple choices between two alternatives - per-
haps a contact closure needs to trigger a different timeline depending on whether it is during the day or during the
night. Within the Triggers screen we support a range of conditions that can be used to quickly implement this sort
of logical decision making. We also provide a facility to treat values received on an input as a variable that can be
used to alter the behaviour of actions - such as using a number received via RS232 to select a particular timeline.
The standard capabilities offered in the Triggers screen are extensive, but a good show control system has the
ability to cope with situations that are anything but standard. Within the Unison Mosaic system when things get
non-standard then we can use scripting.
Script is a simple programming language that allows users to extend the functionality of the Unison Mosaic sys-
tem themselves. We use a freely available programming language called Lua. Anyone who has ever worked with
a programming language will find all the typical tools are available, and it should be straightforward to pick up for
those who have not. On top of the core Lua syntax we have added some dedicated Unison Mosaic functions that
allow scripts to work directly with the capabilities of a Controller.
Not every problem requires script, but there are few show control problems that can't be solved using script
where necessary. A few examples of situations where you might want to use script include:
l
Making a single contact closure start a different timeline each time
l
Make a timeline loop a set number of times and then release
l
Track motion sensor activity over a period of time
l
Inverting a DMX input before it is used with a Set Intensity action
l
Interpreting data from a wind direction sensor
l
Using a table of times for high and low tide to control bridge lighting
l
Implementing an interactive game for a science museum
We will use some of the situations as examples below.
The Basics
There are a few basic things you need to know straight away. If any of them are not immediately clear then don't
worry - there are lots of examples of how to apply them in the following section.
Lua scripts are written as simple text files using any text editor. It is standard practice to use a .lua filename exten-
sion though this is not required. These text files can be loaded directly into the script editor dialog within Designer.
- 214 -