QSC Audio Products - Passionate About SoundQSC Audio Home Page  

Q-Sys Tips & Tricks

It’s been a while since our last post! This one is a little on the ‘lighter’ side, some simple tricks to use when building a design that save time. Most of these are in the help file, but with the thousands of features in Q-Sys, pointing them out here shouldn’t hurt.

1. ALT key to make copies of components: A – Select a component. B – Hold down the ALT key and drag a copy to where you need it.

2. Auto-naming of signal names: A – Select the desired series of pins on a component. B – Type the desired signal name. C – Press enter and watch Designer create and number you signals for you.

3.Use drag-left and drag-right selection to your advantage: By clicking the left mouse button and dragging the mouse left or right, one gets a different type of selection ‘rubberband’. The left drag produces a dotted line selection box and will select any object it touches. The right drag produces a solid selection box and only selects objects entirely within its bounds. This is a useful distinction when trying to select certain objects from big designs. NEW ENHANCEMENT IN VER. 2.1: Pressing the ALT key while dragging reverses the selection mode.


4. Cut and paste signal names: A – Select desired signal names and press CTRL-C. B – Select desired target pins. C – Paste using CTRL-V


5.Cut and paste label names from Microsoft Excel to Designer: Signal names, button labels and similar names can be created in Excel and pasted onto signal pins in Designer to name signals. (note: this also works with Word, Google Docs, Text editors etc.)

6.Use the right-click menu to tidy up: Selecting multiple components, right clicking and selecting one of the Align, Distribute or Pack options is a very fast way to make a design look sharp.

7. Faster way to create controls for UCIs: User control interfaces are created by dragging or copying controls out of their original locations within components’ control panels. It’s common for designs to use multiple components of the same type and also to need the same controls from each copy for use in a UCI. In our example below, we’ve got three audio players and we want the play and stop buttons from each. The slow way to do this would be to add three audio players to our design and then to copy the controls out of each audio player. We can save a little time by copying the audio player and its play and stop buttons at the same time. The process looks like: A – Add audio player to design. B – Drag play and stop buttons out of audio player and select all 3 objects. C – Copy and Paste (or ALT-drag) the audio player and buttons to create our two copies.

8. Transfer a control’s style to a different control:Normally during UCI creation, buttons, LEDs and other controls are stylized for the particular applications. In our example below, we’ve taken a standard grey chiclet button, added a label, change the color, the size and the corner radius. The style of this button can be transferred to other buttons by dragging the stylized button over a target button and holding the CTRL key. A 2nd context menu then pops up asking whether we want to transfer the control ID or style. In this case we’ve transferred the style. Transferring the control ID would allow us to “re-map” our button to any component’s button, useful when for re-using User Control Interfaces in new designs. (NOTE: this feature is new in ver. 2.1)

Any sound system designer worth his or her salt should understand gain structure. With that in mind, in this post I will ‘walk you’ from input to output in a Q-Sys system, explaining the gain structure as we move along.

Mic-Line Input Cards

The mic-line input cards have a software adjustable maximum input level setting(input sensitivity). This is the maximum sine-wave input level that the analog to digital converters can accept without clipping. The max level is specified in dBu, which is the level in decibels relative to 0.775 Volts (1.1 V peak).  A signal equal in magnitude to the Max Input Level will read 0 dBFS once we are in the digital domain within Q-Sys. It should be noted that gain changes inversely with the max input level setting, in other words: low max input numbers equals high gain, and high max input represent low gain. I mention this because typing a value like -50 into the max input level will produce very high gain which can lead to one of those special moments where everyone around wonders why the office is suddenly at 120 dB. For those curious about the hardware implementation, the max level setting adjusts the gain of a programmable gain amplifier (PGA) within the analog input circuitry of the Mic/Line input card.

The following screen capture shows the Mic/Line component’s control panel with a 0.7 V RMS sine wave input.  We can see that both input meters are reading close to 0 dBFS (dB relative to full scale).

0.7 Vrms Sine Wave Into a Mic-Line Card

Digital Domain

Things get relatively simple once our signal has made it into the Q-Sys IO frames and cores. Q-Sys uses a floating point representation of the audio signal, which basically means that it is impossible to clip a signal inside the DSP. It’s a fairly complex concept to explain, but essentially ‘floating-point’ means that the signal is internally represented with scientific notation instead of integer values (i.e. 1 x 10^6 instead of 1,000,000). It would take a signal over 500 dBFS to internally clip Q-Sys!! (think of it as 500 dB of headroom). This floating point representation is maintained across the Q-Sys platform, which means that signals passing from IO Frames to cores and back are easy to manage.

Dataport Cards and Amplifiers

The Dataport/Dataport amplifier interface is slightly more complex to explain, but quite simple to use. The dataport output cards recognize the model of QSC amplifiers that they are connected to and internally adjust their gain such that dataport card and amplifier look like a combined 50 dBV of gain over the digital signal (52 dBu). This means that regardless of the model of amplifier, a digital signal of -50 dBFS into a dataport card will produce 1 volt from the amplifier’s output. This even holds true for an amplifier in bridge mode. This scheme may seem unconventional, but it is helpful in many situations. Speaker voicings can be created using available amplifiers and are portable to systems using different amplifier models without having to adjust for differences in gain. It also means that managing spare amplifiers in large systems is much easier, amplifiers can be swapped in and out of a design without changes in level. The following screen capture shows a -20 dBFS sine generator and the resulting voltage at the amplifier outputs:

Q-Sys Dataport Out

Line Out Cards

The line out card has an adjustable output range in a similar fashion to the line-in card. The Max RMS Output Level sets the output voltage that the card will output when it sees 0 dBFS digital signal. Unlike the line-in card, the Max RMS voltage moves in the same direction as the gain, so a high value of max RMS Level corresponds with high gain. This voltage should be set appropriately to drive whatever device is connected to the output. For an amplifier or powered speaker this would need to be enough voltage to drive the device to the desired maximum level (usually slightly above the point of clipping). The screen capture below shows the Line Out component with a sine generator directly connected to it. In this case, I’ve used a Max RMS Output Level of -3 dBu, which corresponds to 0 dBFS digital signal equaling 0 dBu output voltage.

A Few Comments

This is fairly dry reading material, but hopefully this blog post helps clarify how Q-Sys handles input and output signals. I intentionally only covered cases without speaker processing in the dataport card. Be aware that wiring a Generic Speaker component to an amplifier in Q-Sys will enable a limiter by default, so ensure that these components are properly configured if you use them. I will cover Q-Sys’ speaker processing capabilities in a future post. Until then, stay classy.

A little known trick in Q-Sys designer:  you can label multiple buttons with one fell swoop by copying and pasting the labels from a text editor.

1.  Copy and paste, or drag buttons out of a dialog box.  For our case we’ll use 4 toggle buttons in a Custom Control component.

2.  Open your favorite text editor, WordPad in my case, and type each label name, one label per line (hit the ‘enter’ key) between each.

3.  Select and copy (CTRL-C) the label text.

4.  Select the group of buttons, using either the shift, ctrl or rubberbanding with the mouse.

5.  Paste the label text into the buttons (CTRL-V)

Here at “Q-Sys headquarters”, we often get calls from people asking if Q-Sys can handle very specific esoteric requirements. It’s the nature of integrated systems work that almost no two systems are alike. While Q-Sys has an extensive library of signal processing and control components, the answer to their question is often “Yes, you can do that, but you’ll need to write some LUA script to do it.” The reaction to that response is often “I’m not a programmer!” and while It’s certainly true that having a programming background is a big advantage when writing control scripts, it’s not absolutely essential. Programming requires attention to detail and good problem solving  skills, qualities coincidentally also needed to design and install big sound systems; with this in mind, today’s blog post serves as an introduction to Lua in Q-Sys for the non-programmer (or perhaps someone who’s last programming class was in the 70s or 80s.)

You can save some typing by downloading this sample Q-Sys file (includes some additional examples not shown in this post):
Download the examples Designer file

Continue reading ‘Hello World and Beyond’ »

A first stab at a video blog post (dialogue audio will be better next time!). This video shows how the style of control buttons, LEDs etc. can be modified. Useful for making flashy looking custom user interfaces. Want a square LED? How about a triangular button? This video shows you what can be done by changing the style of controls after they’ve been dragged out of their parent components into the schematic or custom UCI.





Download this video (20MB Quicktime, h.264)

Our Q-Sys Control iOS app is now available in the Apple App Store! The app allows for a user to view and control any UCI defined in the design on their iPhone, iPad or iPod Touch. You can download it from here.

“They always forget to turn the volume back down!”

Good audio systems are judged not only on their sound quality and features, but also on how well they can be operated by non-expert users (the ‘real’ users).  I recently helped a customer who wanted his users to be able to push a button that would ramp a system gain from level A to level B and then automatically return to gain A after 45 minutes.  This is useful when a system is maintained at a certain gain, but needs to allow the users to temporarily increase or decrease the volume in an area.  Thankfully, Q-Sys’ Gain Ramp component and a little Lua script can handle this job quite easily.

The Components

Our first step is to add the Gain Ramp and Control Script components from our Schematic Library.  Our Control Script will need one input and one output, which are set under its properties.  The script will be using the Gain Ramp’s  ‘Ramp to A’ and ‘Ramp to B’ control pins, so those will need to be checked in the Ramp Gain’s properties.  For convenience, I’ve dragged out the A and B buttons from the Ramp Gain component and added text labels.



To setup our gain ramp, we hit F6 to emulate the design and then set both Ramp Times to 3 seconds and gain A and B to -6 dB and +6dB.  This gives us a healthy 12 dB difference in level when the Gain Ramp goes from A to B.

The Code
Now for the fun part! Double clicking the Control Script component will open a Lua script editing window.  I will step you through the code part by part, with the full code provided at the bottom of this post.  Our first section of code contains our header comments. The –[[ and --]] tells the Lua interpreter that everything between are comments. A double dash — is used when we want to comment out a single line.

--[[
USING THE TIMER IN LUA
Example Script by John Brodie, Version 1.0, 18 Jan 2011
Automatically ramps from B to A when B is selected.
--]]

This is followed by these statements:

delayTime = 45 * 60 --Set delay time in seconds (add * 60 if you want minutes)
 
--Give inputs and outputs some names
rampBButton = Controls.Inputs[1]
rampAButton = Controls.Outputs[1]

delayTime is used as a constant, it allows us to conveniently change the delay time at the top of our code instead of hard coding it in further down where it’s less easily edited.  For debugging purposes, I replaced 45 * 60 with 3, to make testing faster.  The next lines assign rampBButton and rampAButton to our control input and output pins.  It should be noted that Controls.Input and Controls.Outputs use Lua’s table type. Tables behave differently than other data types (refer to Lua documentation for more detail).   In this case rampBButton and rampAButton essentially become convenient names for our control pins. You could replace all occurences of rampBButton with Controls.Inputs[1] without changing the code’s behavior. This technique allows us to give each input and output a descriptive name–useful in cases with lots of ins and outs.

Next we define a couple of functions:

function StartTimer()
  if rampBButton.Boolean then  --Start Timer if 'B' is 'ON' (true)
    Timer.Start(delayTime) --Start timer
  end
end
 
function PressA()  --Set 'A' to 'ON'
  rampAButton.Value = true
  Timer.Stop()  --Stop the timer
end

When StartTimer is called it checks to see if button B is ON or OFF (true or false). If B is true, it starts the timer, setting the time to delayTime (which in our case is 45 minutes). We need to check the state of the B button because our Event Handler will call StartTimer any time Button B changes state. We are only concerned about the case where B goes from OFF to ON.

PressA is called when we want to set Button A to ON. The timer defaults to running continuously, so we use Timer.Stop() to stop the timer.

rampBButton.EventHandler = StartTimer
Timer.EventHandler = PressA
 
StartTimer() --Call StartTimer on deploy, in case B is depressed.

Our last few lines of code assigns out StartTime and PressA functions as event handlers for rampBButton and Timer. Remember that rampBButton represents our control script input, which is wired to the ‘Ramp to B’ button in our Gain Ramp component. Every time the ‘Ramp to B’ button changes state the function StartTimer will be called. Similarly, when our Timer has elapsed, the function PressA will be called.

Finally, our last line of code calls StartTimer() when the code is first read by the Lua interpreter. This occurs whenever a design is deployed or code is updated. This handles the case where button B is depressed when a design is deployed, it ensures that after 45 minutes the gain will change to our default A setting.

There you have it, a simple application of Lua script, and also a good illustration of how the Event Handler and Timer functions can be used. Please feel free to comment and ask questions in the comments section below.

The Q-Sys help documentation intentionally leaves out the basics of Lua.  To learn more about Lua, we recommend you checkout Programming in Lua for an overview of the language.

Happy scripting,

John Brodie
QSC Applications Engineer

For reference, here’s the Lua script in its entirety:

--[[
USING THE TIMER IN LUA
Example Script by John Brodie, Version 1.0, 18 Jan 2011
Automatically ramps from B to A when B is selected.
--]]
 
delayTime = 45 * 60 --Set delay time in seconds (add * 60 if you want minutes)
 
--Give inputs and outputs some names
rampBButton = Controls.Inputs[1]
rampAButton = Controls.Outputs[1]
 
function StartTimer()
  if rampBButton.Boolean then  --Start Timer if 'B' is 'ON' (true)
    Timer.Start(delayTime)
  end
end
 
function PressA()  --Set 'A' to 'ON'
  rampAButton.Value = true
  Timer.Stop()  --Stop the timer
end
 
rampBButton.EventHandler = StartTimer
Timer.EventHandler = PressA
 
StartTimer() --Call StartTimer on deploy, in case B is depressed.

It is often desirable to limit the available range of a control. The most common case is limiting a gain range – the full -100dB to 20dB range is usually not safe to expose to the end user. For this common case, Q-Sys has built in support for range limitation. The Gain component has 2 properties – Max Gain and Min Gain. By setting these to the appropriate values you can create a gain with a custom control range.

For example, it’s easy to create a gain with a maximum gain of +6dB and a minimum gain of -6dB.

Q-Sys doesn’t expose max and min properties for every control in the system. So what if you want to limit the range of a frequency or delay knob? Luckily we can use the Custom Control component to accomplish this. The Custom Control component allows you to create a variable number and type of controls which are ‘free-floating’ and not directly associated to any DSP processing. These controls can then be wired to another components control pin which then links the 2 controls.

First, drag in a Custom Controls component. You can then set the Group 1 Type property to Frequency Knob.

If you set Customize range to Yes, the Maximum and Minimum properties are exposed. In this case we’ll limit the frequency to between 200 and 300Hz.

The next step is to expose the Frequency control pin for the control on the component we wish to limit. Drag in a Parametric Equalizer and in the Control Pins Editor check  Band 1 Frequency to expose the pin.

Now it’s the simple process of wiring from the Frequency 1 pin on the Custom Controls component to the pin on the Parametric EQ.

At this point the the parametric frequency is linked to the custom control. You can now copy the custom control to a UCI and your end user will be allowed to adjust the frequency – but only within the range you defined.