Links (Local, MIDI, OSC...)
A Compo in Smode can be a lot more than just visual, especially through the use of links. Links offer the possibility of inserting logic in your compos, to create dynamic, interactive, and customizable content. Coupled with animation, parameters and external inputs (OSC, MIDI, video input, audio input, etc.), you can turn a composition into an interactive object.
Links are stored in a Link bank :
CREATE A LINK
In order to keep visual consistency, it can be interesting to propagate the change of a parameter to another parameter (eg. link the opacity of two layers, or the intensity of two modifiers on different layers).
It can be done by creating a Link between the two variables.
Let's take the example of two layers opacity bound together. To do this, you need to right click on the source Layer's opacity and select the command Create Link From.
This will create a new Link in a Link bank with a disconnected Target. Expend the Link in the element tree to see its targets.
When a target is visible, you can drag the second layer into its value and select the opacity in the contextual menu.
You just created your first variables link: when you modify the White opacity, the Blue opacity follows.
Note that parameters binding are unidirectional: modify the Blue opacity and it will not change the White's.
Target parameters are only updated when source parameter is modified.
An alternate way to create that link would be to create a new Link from the target opacity, by using the Create Rule To menu entry when right clicking on the target opacity.
That would create a disconnected source Link with a correct target. To set the source of the Link, you just have to drag the White Layer in the Link value.
Note that the source and target parameters of a Link can be replaced at anytime by that simple drag and drop.
NAVIGATE TO TARGET
You can navigate from a Link to its target parameter in the element tree by right clicking on the value and selecting the Goto menu entry :
Links can have multiple targets.
To add a new target to an existing Link, right click on the new target parameter and use the Connect to menu.
You can also know visually which parameters of an Element are automated by selecting it.
In the parameters editor, you will see a button listing the objects that target that parameter :
In this chapter you will learn how to make your document react with Control devices (OSC / MIDI keyboard or control surfaces, ect).
First of all, we need to define which input control device will interact with Smode.
To do this, open the Preferences in the Edit > Preferences menu in the main toolbar.
In the Engine tab, select the Control Inputs row, and press Add.
This will create a new Control Input device. You should select Device Identifier with the corresponding combo box. This Combo Box is filled with Identifier of Control Devices actually plugged physically with your computer.
This Combo Box also contains Identifier creation menu for network based protocol device, such as ArtNet or Osc.
You can rename the device for convenience. The name of the device is recorded in the Smode document. This allows for different users to use a same document with the same device alias, connected to a different underlying hardware.
For this sample we will use the Keyboard Control Device. Once the setting is done, you should click on the Apply Change button and close the Preferences panel.
At the bottom of the main window, the Devices tab allows you to observe their activity. Devices are available next to the file button, like shown below. We use this to ensure that the connected devices are functional. You can read the last received messages, and their count and rate.
Now that your Control Input Device setting is created, you can create a Link with the Device with the Learn command.
You can find the Learn menu by right clicking on any parameter. You can also right click on an Element and use the Learn menu, to select one of its learnable parameters.
let's learn the activation of an Uniform layer
That topic is in the process of being updated. Everything might not match the latest version of Smode.
The Learn dialog box is split in two part:
The top part is the control events list received during the dialog box life time.
The optional bottom part is the Action to be performed depending on the learned parameter type.
The control event list is updated each time a message is received. You should type on the keyboard to see the message list updated.
The control event identifier is displayed in newer to older order. Each control event identifier is followed by its current value with the "=" sign in between.
For Keyboard device, each key has its controller identifier with an associated Boolean value. True means key is down, False means key is up.
First, we select the wanted Controller identifier: "Keyboard key A" for instance, then we will try to use a "Convert To" Boolean Action to inspect the generated Rule.
Then press OK to close the Learn dialog Box.
We can now see that a Single Precision Device Rule Source has been created with a Target on the Layer activation.
The "Convert To" Action is the default Action done by Rule. In this case Smode tries to convert the Boolean Control Event Value to the Layer Activation State.
In result, when the A key is down the Layer is active, when the A key is up the Layer becomes inactive.
Let's now try to Toggle the Layer activation by learning the activation again :
Here click on "Replace all" (remember that multiple Target can automate the same parameter):
Here click on the "Keyboad key A" Control Event, let the Toggle Boolean Action and press OK.
Here click on "Replace all" (remember that a Rule can have multiple Target).
You can now see that the Lead dialog replaces the previous Rule by a more complex one:
When the A Keyboard key is up, the Layer Activation State is now Toggled.
The main difference from the previous Rule is that we do not need to let the key pressed to see the Layer activated.
This is performed by new Actions Element in the Rule: the "Toggle" Action and the "If Equals" Condition.
The "If Equals" is a Condition. Condition is a kind of Action which allows to filter the value to be able to reach target parameters.
The "If Equals" allows the Rule to send output if the Control Event Value is equal to its Value parameter.
Here the Value is False, so the Rule matches only if the A key is Up. The Value is set to the Value of the Control Event at the Rule creation.
We can switch the "If Equals" Value to True just to make the Layer activation toggling to be performed when the A key is Down.
The Toggle Action is a special Action usable on Target of Boolean or Activation State type. The ouput value depends on the output one and toogle it.