---
title: expressions.md
tags: mewa-user-guide
description: Mewa - Video Creator & Compositor
---
## Expressions in Parameters
One of the more powerful aspects of Mewa is its ability to use a wide variety of expressions and script code directly
into any parameter.
### Editing a parameter expression
Parameter expressions are set in the expression box that becomes visible when clicking on  button.
*Expression editing box, empty*
The expression box button is gray  if no expression is set and yellow  if there is an expression associated with it.
*Expression editing box with expression*
The lock icon inside the parameter text box means the value of the parameter cannot be changed through the parameter text box because a expression is set.
The  button clears any expression associtated to the parameter with the current value becoming it's constant value.
### Curves in Parameters
Curves are the most used method to animate parameters, and so, it's usefull to know
By default a prameter shows 2 buttons, the *new curve* button 
and the *expression* button 
*Node and it's Parameter window*
When a curve is set to a parameter it shows two arrow buttons.
*Node parameter with curve associated*
The arrow buttons are in the color of the curve and they move the play-head to the previous or next curve point.
Parameters using curves are in practice using an expression. Opening the expression box we should see a similar expression to:
```javascript
curve("myCurve").value( frame() )
```
A breakdown understanding of the expression:
* The [*curve()*]() function returns the curve with the given name;
* The [*value()*]() method returns the curve *y* value for the given input *x*;
* The function [*frame()*]() returns the current frame number, indicated by the playhead;
Value at a Different Frame
If a parameter is animated and you want to obtain a value at a specific frame, or at a frame that’s offset from the current time.
For example, the following expression obtains the value from ''Move2D@x'' curve at the previous frame:
```javascript
curve("Move2D@x").value( frame() - 1 )
```
### Linking Parameters
"linked parameter" is the term used to describe a node parameter which value is shared with other node parameters.
To refer to the value of a parameter we create an expression that finds the node parameter and returns it's value.
```javascript
node("Move2D").value("Translation", 0)
```
The Move2D node has a parameter called translation which returns an array with size 2. Because we want the x value we pass 0 as index value.
```javascript
t = node("Move2D").value("Translation");
return t(0);
```