The Math Automation allows you to create dynamic animations using mathematical formulas. This powerful feature gives you precise control over how properties change over time, react to audio, or respond to other variables.
How it works
Math Automation works by evaluating a mathematical formula on each frame during playback. The result of this formula can be connected to any property in your project, allowing for complex and precise animations.
The formula can include various variables and functions, making it extremely versatile for creating both simple and complex animations.
Use cases
Math Automation is particularly useful for:
- Creating smooth, wave-like movements using sine or cosine functions
- Making properties react to audio in customized ways
- Building complex animations that would be difficult to achieve with keyframes
- Creating procedural animations using noise functions
- Implementing mathematical relationships between different properties
Variables
You can use these special variables in your formulas:
| Variable | Description |
|---|---|
| t | Current time in seconds |
| p | Previous calculated value |
| a | Current audio impact (overall audio level) |
| d | Total project duration in seconds |
| m | Maximum audio impact recorded |
| u1-u5 | User-defined variables (can be set in the interface) |
| rx | Current resolution width in pixels |
| ry | Current resolution height in pixels |
Functions
The Math Automation supports these mathematical functions:
| Function | Description | Example |
|---|---|---|
| sin(x) | Sine of x (in radians) | sin(t) |
| cos(x) | Cosine of x (in radians) | cos(t*2) |
| tan(x) | Tangent of x | tan(t) |
| min(a,b) | Minimum of a and b | min(sin(t), 0.5) |
| max(a,b) | Maximum of a and b | max(sin(t), 0) |
| sgn(x) | Sign of x (-1, 0, or 1) | sgn(sin(t)) |
| linear(input,inMin,inMax,outMin,outMax) | Remaps a value from one range to another | linear(sin(t),-1,1,0,1) |
| noise(x,seed) | Simplex noise function | noise(t*0.1, 42) |
| round(x) | Rounds x to the nearest integer | round(sin(t)*10) |
| floor(x) | Rounds x down to the nearest integer | floor(t) |
| ceil(x) | Rounds x up to the nearest integer | ceil(sin(t)*5) |
| abs(x) | Absolute value of x | abs(sin(t)) |
Example formulas
| Formula | Effect |
|---|---|
sin(t) | Smooth wave oscillating between -1 and 1 |
sin(t*2*PI) | One complete sine wave per second |
abs(sin(t)) | Bouncing effect between 0 and 1 |
sin(t) * a | Sine wave that reacts to audio |
noise(t*0.1, 42) | Smooth random movement |
linear(sin(t),-1,1,0,100) | Sine wave remapped to range 0-100 |
sin(t*u1) * u2 | Sine wave with controllable frequency (u1) and amplitude (u2) |
For more examples and practical formulas, see the Math Automation Examples page.
Combining with audio
Try using the audio impact variable (a) in your formulas to make properties react to music. For example,
0.5 + sin(t*2) * a * 0.5creates a wave that gets more pronounced with louder audio.
Creating complex movements
You can combine multiple functions for more complex effects. For example,
sin(t) * cos(t*2)creates a modulated wave pattern.
Related topics
- Math Automation Examples - A collection of useful formulas
- Using Automations - Practical guide with examples
- Audio Impact Automation - Another way to create dynamic animations
- Troubleshooting Automations - Solutions to common issues