Use the Text Controller component to easily declare one or more custom controls and then build the Lua script associated with those controls using a Lua text editor.
Note: This component uses the Q-SYS Scripting Engine, which is a licensed feature on certain Cores manufactured with Q-SYS 7.0 and later. For more information, see Licensing.
To see an example configuration, see Example.
Double-click the Text controller component to open the elements editor, which is where you define controls for your Lua script. After defining controls, click Edit to open the Lua text editor.
Control |
Function |
---|---|
Controls |
|
Serial Port Inputs |
Specify how many serial port input pins to expose, from 0 to 128. |
Virtual Serial Port Outputs |
Specify how many virtual serial port output pins to expose, from 0 to 128. Use these pins with the SerialServerPorts Lua library. |
Property |
Function |
Choices |
---|---|---|
General |
||
Name |
Specify a name for the input. |
Text input |
Count |
Specify the number of controls of the specified type to create. |
1 to 256 |
Control Type |
||
Category |
Button
Select a Push Action:
Knob
Specify a Max Value and Min Value for the specified Units:dB, Hz, Float, Integer, Pan, Percent, Position, Seconds. Indicator
Specify a Type: LED, Meter, Text, Status. Text
Specify a Type: Text Box, Combo Box, List Box |
Button, Knob, Indicator, Text |
Control Pin |
Expose pins for these controls: None, Input (pins on the left), Output (pins on the right), or Both. |
None, Input, Output, Both |
Tip: While in the Script area, press F1 for help on the Lua scripting language.
The script editor contains these areas:
'Controls.MyKnob.Value'
'Controls.MyKnobs[1].Value', 'Controls.MyKnobs[2].Value', 'Controls.MyKnob[3].Value'
'Controls["My Knobs"][1].Value', 'Controls["My Knobs"][2].Value'
In the script, if you reference an input or output that has nothing connected to it, the following error message appears: [string "cin_speaker = Controls.Inputs[1]..."]:43: attempt to index global 'cin_ramptime' (a nil value). In most cases, the error messages are more understandable than this one.
The available Control Pins depend on settings in Properties.
Pin Name |
Value |
String |
Position |
Pins Available |
---|---|---|---|---|
Code |
(text) |
Input / Output |
||
Script Start |
(trigger) |
Input / Output |
||
Script Status |
(text) |
Output |
||
Script Stop |
(trigger) |
Input / Output |
In this simple example, Text Controller is configured with a control button that can be used to retrieve a list of control names from any named component in the design.
This example contains two audio components - Gain and Delay. Rename each with a custom name ("MyGain", "MyDelay"). Renaming the components with custom names allows the Named Components function to retrieve a table of control names for those components. For more information about named components in Lua, see Named Components.
Drag Text Controller onto the canvas and double-click it to open the elements editor. Add three controls with these names and properties:
Click Edit to open the Lua text editor. Add the following script, and then click Save changes.
Controls["Component Name"].EventHandler = function(ctl) comp = Component.New(ctl.String) end -- Returns all controls of the component in "Component Name" Controls["Get Controls"].EventHandler = function() local str = " Get Controls for "..Controls["Component Name"].String.."\r" for k,v in pairs(comp) do str = str..k.."\r" end Controls.Output.String = str end comp = Component.New(Controls["Component Name"].String)
Learn the basic Q-SYS third party control principles, including Lua scripting basics.
Software and Firmware | Resources | QSC Self Help Portal | Q-SYS Help Feedback
Copyright © 2019 QSC, LLC. Click here for trademark and other legal notices. | Q-SYS 8.1.1