# Range Mapper

## Overview

![The Range Mapper Node.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-f20bc0450d10deda0a84bc6dd1113d6899ad3081%2Frangemapperupdatedimage.png?alt=media)

**Range Mapper** transforms a single numerical value, from its relative position in a given reference range, to a new value within a second target range.

In the event that `Input` is outside of the reference (input) range, `Clamp` determines whether the `Output` should be clamped within the target range or transformed to its relative value outside of the range.

| `Input` | Input Range | Output Range | `Clamp` | `Output` |
| ------- | ----------- | ------------ | ------- | -------- |
| 0.5     | 0-1         | 0-100        | ✔ or ✖  | 50       |
| 20      | 0-100       | 100-0        | ✔ or ✖  | 80       |
| 1.5     | 0-1         | 0-360        | ✔       | 360      |
| 1.5     | 0-1         | 0-360        | ✖       | 540      |

[**Scope**](https://docs.incari.com/incari-studio/2023.1/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The Range Mapper Node Attributes.](https://2628349686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwnv17cpjDin2deSlOz0z%2Fuploads%2Fgit-blob-9659dffda7f10a95a0437cdfda2b43a117d3b4ce%2Fnode-range-mapper2-attr.png?alt=media)

### Inputs

| Attribute   | Type                                          | Description                                                                                                |
| ----------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `Data Type` | **Drop-down**                                 | The type of data that will be plugged into the `Input`, `Input From`, and `Input To` **Sockets**.          |
| `From`      | *Defined in the `Data Type`* ***Attribute***. | The default beginning of the reference range, if there is nothing attached to the `Input From` **Socket**. |
| `To`        | *Defined in the `Data Type`* ***Attribute***. | The default end of the reference range, if there is nothing attached to the `Input To` **Socket**.         |

### Outputs

| Attribute   | Type                                          | Description                                                                                                                        |
| ----------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `Data Type` | **Drop-down**                                 | The type of data that will be plugged into the `Output From` and `Output To` **Sockets** and returned via the `Output` **Socket**. |
| `From`      | *Defined in the `Data Type`* ***Attribute***. | The default beginning of the target range, if there is nothing attached to the `Output From` **Socket**.                           |
| `To`        | *Defined in the `Data Type`* ***Attribute***. | The default end of the target range, if there is nothing attached to the `Output To` **Socket**.                                   |
| `Clamp`     | **Bool**                                      | Whether the `Output` should be clamped within the target range or transformed to its relative value outside of the range.          |

## Inputs

| Input             | Type                                          | Description                                                           |
| ----------------- | --------------------------------------------- | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**                                     | A standard input **Pulse**, to trigger the execution of the **Node**. |
| `Input`           | *Defined in the `Data Type`* ***Attribute***. | The value to be transformed/mapped.                                   |
| `Input From`      | *Defined in the `Data Type`* ***Attribute***. | The beginning of the reference range.                                 |
| `Input To`        | *Defined in the `Data Type`* ***Attribute***. | The end of the reference range.                                       |
| `Output From`     | *Defined in the `Data Type`* ***Attribute***. | The beginning of the target range.                                    |
| `Output To`       | *Defined in the `Data Type`* ***Attribute***. | The end of the target range.                                          |

## Outputs

| Output             | Type                                          | Description                                                                                                                            |
| ------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse**                                     | A standard output **Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Output`           | *Defined in the `Data Type`* ***Attribute***. | The transformed value.                                                                                                                 |

## See Also

* [**Clamp**](https://docs.incari.com/incari-studio/2023.1/toolbox/math/clamp)
