Function

Function  -  Function that maps a number (percentage, time, etc.) to a value

FunctionV9 FunctionV9 FunctionV9 FunctionV9

A function relates an input and an output. Those can be anything (variation in position over time, variation in color relative to the depth of a 3D scene, etc.).

Here is an introduction to each function type you’ll find inside of Smode, go inside the specified topics of the documentation for further informations.


Introduction

One of the most common examples you’ll find is a function taking time as an input. This type of functions is used to animate content, as it takes time as input and specifies the look of the animated object at that time.

But, you can also use functions in masks, like in the following example:

Functions01 Functions01

Here, a vertical linear mask (going from point A to B along the Y axis) is used as input to a sinus function.

That sinus function allows to make the simple linear mask ‘wavy’. You can define the number of waves by changing the number of repetitions.

Functions02 Functions02

Functions always work the same and are part of a many layers / modifiers / tools of Smode. Each time you see a function inside an element parameters, you can be sure that any function can be plugged in.

For instance in FunctionCue Icon Function Cue :

Function03 Function03

If you want to change the function type, just click here (on the Function Type selector):

Function04 Function04


1- Keyframe Function

Once your function is set as keyframe, you’ll notice that you can’t create any point inside the parameters tab (on the contrary of custom functions in which it is possible). To create points, you must then go inside the FunctionWorkspaceComponent Icon Function Editor (circled in green), go in curve view:

FunctionKeyframe01 FunctionKeyframe01

Some useful keys :

  • Ctrl+click : new point
  • Alt+click on an existing point : change interpolation
  • U : Change view between Curves / Track
  • F : Center view on selection
  • Middle click : translate view
  • Mousewheel : Zoom in editor
  • Shift+mousewheel : Zoom horizontally in editor
  • Ctrl+mousewheel : Zoom vertically in editor

2- Parametric Function

A parametric function is controlled through its parameters only:

ParametricFunction01 ParametricFunction01

The most important parameter of a function is its Function Shape .

You can display the result of the function through the FunctionWorkspaceComponent Icon Function Editor :

FunctionParametric FunctionParametric

Here is the detail of the parameters of:

  • Minimum and maximum of your function, can be expressed in percentage / meters / time depending on where it is.

  • Option to invert the function.

  • Duration of the function can be expressed in percentage / meters / time depending on function output unit.

  • Shifts all the function. Animating a function offset with a linear loop is a very useful trick (particularly to animate spritesheets inside of a SpritePointsGeometryRenderer Icon Sprite Points ).

ParametricFunction03 ParametricFunction03

  • Changes the middle point of the function.

ParametricFunction04 ParametricFunction04

  • Repeat / Mirror repeat / Clamp. Must be put as Clamped in the case of DepthTextureMask Icon Depth mask .

Note that the noise function possesses a Transport and can so be animated.

3- Custom Function

CustomFunction01 CustomFunction01

Custom functions are functions in which you can draw. Select this function, draw it and then smooth it:

FunctionCustom FunctionCustom

As opposed to keyframe function, where Smode generates most of the values through interpolation, the custom function has a list of values (the buffer), and the user has to indicate every one of them.

You can use your mouse and click on the function view to change its shape by hand. What one usually does after defining the shape is to plays with the smoothing parameter to even out errors.

  • Begin, End: Defines the begin and end, to resize the buffer (see following illustration)

  • Smoothing: Defines how much the function will be smoothed out to even out errors

CustomFunction02 CustomFunction02

Here is a little example using a custom function :

4- Color functions

This is like a linear function but with color values as Inputs. Standard parametrization for color extraction or remapping.

FunctionColorLevel FunctionColorLevel

Used by color masks, color modifiers, etc. Not useful outside of this context.

5- Falloff Function

Standard parametrization of light disappearing over distance. A regular fall off with an exponent. Will be expressed in % for the ColorizeTextureModifier Icon Colorize but in meters in case of the LightV9 Icon Light .

FunctionFallOff FunctionFallOff

Used by lights, projectors, etc. Not useful outside of this context.

6- Midi Keyboard Function

Take midi notes range from a Control Device as input to control a curve. As it is one of the parametric functions, it can be found under this category:

MidiKeyboardFunction01 MidiKeyboardFunction01

Then choose your midi device and channel :

MidiKeyboardFunction02 MidiKeyboardFunction02

And have fun with it:

MidiKeyboardCatFunction MidiKeyboardCatFunction

Note that this function can be used in many different ways into Smode:

MidiKeyboardFunction03 MidiKeyboardFunction03


Variables:

  • Loading: The loading status of the function. It can be loaded , enabled by not loaded or unloaded
  • Activation: The activation status of the function. It can be active , enabled by not active or inactive
  • Color Label: Associate a color label to your function to make it easily locatable
  • Solo: Activate this to keep only this function active and hide all otherin same location
  • Editable: The editabiliy status of the function. It can be locked directly , locked indirectly or editable
  • Preset: Select a preset to apply on the function
  • Status: Warnings and errors associated to this function