Math node

Remap

Linearly maps a float value from one range to another, with optional clamping. The Remap node is the standard tool for converting values between different scales, such as converting sensor data ranges, normalizing inputs, or scaling animation parameters.

Inputs

PortTypeDefault
ValueThe number being converted from the input range into the output range. Not clamped — values outside In Min…In Max run past the output range unless Clamp is on. Also accepts an ARRAY — every element is remapped.float0
In MinThe low end of the range the incoming value arrives in. If In Min and In Max are equal every input lands on the midpoint of the output range.float0
In MaxThe high end of the incoming range. It may sit below In Min to flip the mapping; equal to In Min it parks the result at the output midpoint.float1
Out MinWhat comes out when the input sits at In Min. Any number works, and it may be larger than Out Max to invert the result.float0
Out MaxWhat comes out when the input sits at In Max. Any number works; the distance to Out Min sets how much the value is scaled.float1
ClampKeeps the result inside Out Min…Out Max, whichever way round they are. Off lets the value overshoot both ends.boolfalse

Outputs

PortType
Resultfloat

Overview

The Remap node takes an input value that lies within a source range (In Min to In Max) and linearly maps it to a corresponding position within a destination range (Out Min to Out Max). The mapping is proportional: a value at the midpoint of the input range maps to the midpoint of the output range, a value at In Min maps to Out Min, and a value at In Max maps to Out Max.

When the optional Clamp toggle is enabled, the output is constrained to stay within the output range. Without clamping, values outside the input range will extrapolate beyond the output range, which can be useful for extended mapping but risky for parameters with strict bounds.

The node handles several edge cases gracefully. If the input range is degenerate (In Min equals In Max), the output is the midpoint of the output range. Inverted ranges are fully supported on both the input and output sides. NaN and Infinity protection ensures the output is always a valid number.

How It Works

The mapping formula is a standard linear interpolation:

t = (Value - In Min) / (In Max - In Min)
Result = Out Min + t * (Out Max - Out Min)

Where t is the normalized position of the input value within the source range. When t = 0, the result is Out Min. When t = 1, the result is Out Max. Values of t between 0 and 1 interpolate linearly between the output bounds.

With Clamping

When Clamp is enabled, the result is additionally constrained:

Result = clamp(Result, min(Out Min, Out Max), max(Out Min, Out Max))

This respects inverted output ranges by clamping to the actual low and high values regardless of which port they were entered on.

Edge Cases

  • Degenerate input range (In Min == In Max): Returns the midpoint of the output range: (Out Min + Out Max) / 2.
  • NaN/Inf result: Falls back to Out Min.
  • Inverted input range (In Min > In Max): Works correctly; the mapping reverses direction.
  • Inverted output range (Out Min > Out Max): Works correctly; the output decreases as input increases.
  • Both ranges inverted: The two inversions cancel out, producing a mapping in the same direction as a non-inverted setup.

Examples

ValueIn MinIn MaxOut MinOut MaxClampResult
0.5010100off50
0010100off0
1010100off100
1.5010100off150
1.5010100on100
0.5011000off50
64012701off~0.504
0.501-11off0
180036006.283off~3.142

Use Cases

  • Sensor normalization: Convert raw sensor readings (for example, 0-4095 from a 12-bit ADC) to a normalized 0-1 range for use with other nodes.
  • MIDI to float: Remap MIDI control values (0-127) to a parameter range like volume (0-1) or filter cutoff frequency (20-20000).
  • Degrees to radians: Remap 0-360 to 0-6.2832 (2*pi) for feeding degree-based controls into trigonometric operations.
  • Color channel scaling: Remap 0-255 byte values to 0-1 float values for use with Grafit's color system.
  • Inverting a signal: Set In Min to 0 and In Max to 1, but Out Min to 1 and Out Max to 0 to reverse a value range. A value of 0.2 becomes 0.8, for example.
  • Bipolar to unipolar: Convert a signal in the range [-1, 1] to [0, 1] for display or further processing.
  • Temperature scaling: Convert Celsius (for example, 0-100) to Fahrenheit (32-212) or vice versa.

Practical Tips

  • Enable Clamp when the output will be used as a parameter with strict bounds (such as opacity 0-1 or MIDI 0-127) to prevent out-of-range artifacts.
  • Leave Clamp disabled when you want smooth extrapolation beyond the defined range, such as for animation curves that might overshoot slightly.
  • You can chain two Remap nodes to create a piecewise linear mapping: the first handles one segment of the input range, and the second handles another.
  • For non-linear remapping (such as exponential or logarithmic scaling), apply a Math node with Log or Exp before or after the Remap.
  • When remapping time-varying signals, consider using the Smooth node after the Remap to reduce jitter in the remapped output.
  • If both In Min and In Max are connected to the same dynamic source and collapse to the same value, the node gracefully returns the midpoint of the output range rather than producing a division-by-zero error.

Open Remap in the interactive catalog →

Remap is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Math nodes