Skip to content

MapRange

The MapRange operation rescales a number from one range into another — the linear interpolation that turns a raw sensor reading into engineering units, a percentage into a PWM level, or a 0–1 fraction into any span you need.

Out Min equal to Out Max makes Out that one value whatever arrives, and the Editor marks both fields with an info mark.

MapRange operation

Inputs

PortTypeRequiredDescription
>AnyNoOptional gate. When closed, the path stops and Out keeps its previous value.
InInteger or FloatYesThe value to rescale. A non-numeric or Nil value fails the Node; its On Error verb resolves the failure.

Outputs

PortTypeDefaultDescription
OutFloatNilThe rescaled value. Always a Float.

Properties

NameTypeDefaultDescription
In MinNumber0Value of In that maps to Out Min.
In MaxNumber1Value of In that maps to Out Max.
Out MinNumber0Result at In Min.
Out MaxNumber1Result at In Max.
Clamp to output rangeBooleanfalseWhen true, the result is confined to the span between Out Min and Out Max. When false, an input outside the source range extrapolates past it.
On ErrorComboStop this branchPer-op On Error verb (Stop this branch / Continue with the last value / Continue with the fallback). See the Error Handling guide.

State on Reload

Out is preserved across restarts.


  1. Gate check — if the Gate is connected and closed, the path stops here.

  2. Read the input — In must carry a number. Anything else fails the Node, and its On Error verb resolves the failure.

  3. Rescale — Out = Out Min + (In − In Min) × (Out Max − Out Min) / (In Max − In Min).

  4. Confine (optional) — with Clamp to output range on, the result is held between the smaller and the larger of Out Min and Out Max, whichever way round they were entered.

  5. Emit — Out is written as a Float and the path continues.


In Min: 0   In Max: 1   Out Min: 0   Out Max: 100

In: 0.42 → Out: 42.0


  • Engineering units — turn a raw analogue count into the pressure, temperature or voltage it represents.
  • Driving an actuator — map a 0–100 percentage onto whatever span the device expects, inverting it where the hardware treats 0 as full scale.
  • Normalising for comparison — bring two signals recorded on different scales onto a common 0–1 range before Comparing them.

MapRange fails when In is unconnected, Nil, or not a number; the Node’s On Error verb resolves the failure.

VerbWhat it does
Stop this branch (default)This Node and its dependents stop; Out keeps its value and reads as a failed update.
Continue with the last valueDependents run on the value Out already holds, not stamped as new; it reads as a failed update.
Continue with the fallbackDependents run on Out’s per-output Fallback, stamped as this run’s value; it reads as a failed update. The Editor refuses a Task where the Fallback is unset.

  • The four bounds are fixed at configuration time and cannot be driven from input ports.
  • The mapping is linear. For a curve, chain a JavaScript node.
  • Out is always a Float. Feed it through Convert when a downstream port requires an Integer.