# Variables

<p class="callout warning">This documentation might be outdated. Please consult the Reactor manual at [https://docs.skaarhoj.com/3\_configuration/variables-conditions.html](https://docs.skaarhoj.com/3_configuration/variables-conditions.html)</p>

For increased flexibility in a configuration Variables are often applied. A variable works as an adjustable value which can be numerical or text based that can be used in place of a set value.

Variables live on the layers of the tree but are used in lots of different places and in different ways. It is on the layers that you can see what Variables are available, their names, and their current value. In the example below you can see how:

![Screenshot 2023-12-06 at 12.51.17 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2023-12/scaled-1680-/screenshot-2023-12-06-at-12-51-17-pm.png)

<p class="callout info">Please note, Variables in the tree are only accessible to the same layer they are created on or higher in the tree, unless defined otherwise in the variable set up. Additionally, layers limited by Active If conditions also set limits on the variable. </p>

There are two types of variables; range or options.

<details id="bkmrk-range-variables-name"><summary>Range Variables</summary>

  
![Screenshot 2024-01-17 at 12.40.48.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-17-at-12-40-48.png)

<table border="1" style="border-collapse: collapse; width: 83.5802%; height: 195.578px;"><colgroup><col style="width: 17.7998%;"></col><col style="width: 82.2002%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Name</td><td style="height: 29.7969px;">Variable's name</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Description</td><td class="align-center" style="height: 29.7969px;">Easy to understand description to help identify the variable's purpose</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Type</td><td style="height: 29.7969px;">Range or Options </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Min</td><td style="height: 29.7969px;">Minimum value for the variable (must be lower than the max). Can be set to 0</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Max</td><td style="height: 29.7969px;">Maximum value for the variable (must be higher than the max)</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">Center (or Default)</td><td style="height: 46.5938px;">Default value for the variable if not saved on panel reboot. </td></tr></tbody></table>

![Screenshot 2024-01-17 at 12.40.59.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-17-at-12-40-59.png)

<table border="1" style="border-collapse: collapse; width: 90.8642%;"><colgroup><col style="width: 21.4966%;"></col><col style="width: 78.5034%;"></col></colgroup><tbody><tr><td>Default to first</td><td>Sets default value to the first.</td></tr><tr><td>Default Value</td><td>Define the default value if not first.</td></tr><tr><td>Always define</td><td>Separates this instance of the variable from ones of the same name lower in the tree (overridden by Expand Scope).</td></tr><tr><td>Accept Any Value</td><td>Allows any value to be accepted during conformity check. </td></tr><tr><td>Expand Scope</td><td>Allows the variable to be used lower in the tree towards the root.</td></tr><tr><td>Capture</td><td>Allows a variable to capture any expanded-scope variable from a branch.</td></tr><tr><td>Persistent</td><td>Saves value between panel reboots.</td></tr><tr><td>Zero set Allow</td><td>Allows for the variable to be blank </td></tr><tr><td>Force value (test)</td><td>Force set a value for the variable, use for testing</td></tr></tbody></table>

**Variable Use Case**

Range variables are great for creating dynamic device parameters. In the example below, the variable is set within a parameter.

<p class="callout info">This is only a single example of the use of Options Variables. </p>

First looking at a breakdown of the parameter the variable is going to be added into: Atem Program Input Video Source

DC:bmd-atem/1/ProgramInputVideoSource/1/1

  
**DC** (DEVICE CORE) **:bmd-atem** (BMD-ATEM) **/1** (DEVICE ID 1) **/ProgramInputVideoSource** (Specified parameter)   
**/1** (M/E number) **/1** (Input Number)

A range variable would most naturally be put in place of numerical values, making Device ID, M/E Number, or Input Number great places use a variable. Using the variable in place of the Device ID will allow for switching instances of the Atem.   
It is possible to find the specific Device ID number of the Atems in the Device Details on the Home Page of Reactor.

![Screenshot 2024-02-06 at 10.33.51 AM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-02/scaled-1680-/screenshot-2024-02-06-at-10-33-51-am.png)

  
When creating the variable it is best to name is something easy to identify the place it should be used. ![Screenshot 2024-02-06 at 10.34.51 AM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-02/scaled-1680-/screenshot-2024-02-06-at-10-34-51-am.png)

Insetting that variable in the command would look like this:

 DC:bmd-atem/**Var:DeviceIndex**/ProgramInputVideoSource/1/1

<p class="callout info">Please note: Formatting is important for the variable name. </p>

 After setting the variable into a parameter it is important to set up a way to control the variable.

![Screenshot 2024-02-06 at 10.59.14 AM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-02/scaled-1680-/screenshot-2024-02-06-at-10-59-14-am.png)

The feedback will look like:

![Screenshot 2024-02-06 at 10.56.22 AM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-02/scaled-1680-/screenshot-2024-02-06-at-10-56-22-am.png)

Confirm the variable is changing properly in the tree:

![Screenshot 2024-02-06 at 10.56.41 AM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-02/scaled-1680-/screenshot-2024-02-06-at-10-56-41-am.png)

</details><details id="bkmrk-options-variable-nam"><summary>Options Variable</summary>

**Variable Set Up**![Screenshot 2024-01-17 at 12.41.28.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-17-at-12-41-28.png)

<table border="1" style="border-collapse: collapse; width: 83.5802%; height: 314.766px;"><colgroup><col style="width: 17.7517%;"></col><col style="width: 82.2495%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Name</td><td style="height: 29.7969px;">Variable's name</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Description</td><td class="align-left" style="height: 29.7969px;">Easy to understand description to help identify the variable's purpose</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Type</td><td style="height: 29.7969px;">Range or Options </td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Value</td><td style="height: 29.7969px;">Value string for the variable</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Label</td><td style="height: 29.7969px;">Easy to understand label used for feedback</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Flag</td><td style="height: 29.7969px;">Sets the option as the default value</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Trash</td><td style="height: 29.7969px;">Deletes the Option</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Duplicate</td><td style="height: 29.7969px;">Duplicates the line</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">+1</td><td style="height: 29.7969px;">Increments the line by +1</td></tr><tr style="height: 46.5938px;"><td style="height: 46.5938px;">Add option</td><td style="height: 46.5938px;">Default value for the variable if not saved on panel reboot. </td></tr></tbody></table>

![Screenshot 2024-01-17 at 12.42.01.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-17-at-12-42-01.png)

<table border="1" style="border-collapse: collapse; width: 90.8642%;"><colgroup><col style="width: 21.4966%;"></col><col style="width: 78.5034%;"></col></colgroup><tbody><tr><td>Default to first</td><td>Sets default value to the first.</td></tr><tr><td>Default Value</td><td>Define the default value if not first.</td></tr><tr><td>Always define</td><td>Separates this instance of the variable from ones of the same name lower in the tree (overridden by Expand Scope).</td></tr><tr><td>Accept Any Value</td><td>Allows any value to be accepted during conformity check. </td></tr><tr><td>Expand Scope</td><td>Allows the variable to be used lower in the tree towards the root.</td></tr><tr><td>Capture</td><td>Allows a variable to capture any expanded-scope variable from a branch.</td></tr><tr><td>Persistent</td><td>Saves value between panel reboots.</td></tr><tr><td>Zero set Allow</td><td>Allows for the variable to be blank </td></tr><tr><td>Force value (test)</td><td>Force set a value for the variable, use for testing</td></tr></tbody></table>

**Variable Use Case**

Options variables are great for Active If conditions on layers of the tree. In the example below, the variable is set up to make active different page layers in the tree.

<p class="callout info">This is only a single example of the use of Options Variables. </p>

![Screenshot 2024-01-22 at 2.33.34 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-33-34-pm.png)

In the tree it would look like this. The blue line next to a layer indicates it is the active layer. In the layer where the variable lives, the variable also shows what its current value is.

![Screenshot 2024-01-22 at 2.33.54 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-33-54-pm.png)

On the page layer, the variable is set as the Active If conditions, meaning that need to be true for the layer to be the active layer.

![Screenshot 2024-01-22 at 2.36.04 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-36-04-pm.png)

 There are two main way to select the value of the parameter.

To set a specific value, mainly on key press or by trigger, select the variable as a parameter with the Settings Template as Set a Value Directly.

![Screenshot 2024-01-22 at 2.44.19 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-44-19-pm.png)

The feedback will look like this:

![Screenshot 2024-01-22 at 2.34.02 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-34-02-pm.png)

To cycle through the values, mainly on the pulse of an encoder, select the variable as a parameter with the Settings Template as Change Variable.

![Screenshot 2024-01-22 at 2.44.05 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-44-05-pm.png)

The feedback will look like this:

![Screenshot 2024-01-22 at 2.47.41 PM.png](https://wiki.skaarhoj.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-at-2-47-41-pm.png)

</details>