Find a function
Search by name or by what you want to do — “blend two colours”, “front montant”, “decimals” — or browse by category.
BackNode wiki
The Expression node entry, and every other node in the graph editor.
Graph Editor · Expressions
// Expression language
One node, a whole toolbox. The Expression node runs a tiny sandboxed language over telemetry — this page is its full reference: the grammar, every function with an example, and a search box to find the right one fast.
| Syntax | Meaning | Example |
|---|---|---|
name | Bare name never assigned → input socket | rpm / rpmMax |
name = …; | Local variable (no socket) | ratio = rpm / rpmMax; |
@channel | Reads a telemetry channel directly (read-only, no wire) | @gear · @speed_kmh |
$name = …; | Declares a named output socket — the only way to make one. No $ = no output. | $shift = ratio > 0.95; |
.x .y · .r .g .b .a | Component access — vector / colour (colour 0–255) | $dir.x = vel.x * 2 |
$out = value — replace it with your own program. The editor colours the syntax live and autocompletes functions, constants and @channels as you type.Socket types are inferred from how you use a name — there is nothing to declare:
.x .y on a name → vector socket..r .g .b .a on a name, or a bare name fed to mixcolor() → colour socket.rgba() / mixcolor() → colour output."…", str(), format()) → text output — feed it to a Text display.Typing is soft: using a colour in arithmetic yields NaN, not an error. Text flows out of the node only — text input sockets are not supported.
+ - * / % ^ — + concatenates when either side is text: "P" + str(pos).== != < <= > >= · logic && || !.cond ? a : b — chains nicely: g == 0 ? "N" : g == -1 ? "R" : str(g).PI and E.Type to filter — by name, or by what you're trying to do (French works too: « mélange », « front montant », « décimales »). Click a category to narrow down.
min(a, b, …)Smallest of the values. min(@fuel_level, 20)
max(a, b, …)Largest of the values. max(0, delta)
clamp(x, lo, hi)Bound x to [lo, hi]. clamp(@rpm / 8000, 0, 1)
abs(x)Absolute value. abs(@delta)
sign(x)-1, 0 or 1 by sign. sign(@delta)
floor(x)Round down. floor(@lap_time / 60)
ceil(x)Round up. ceil(laps_left)
round(x)Round to nearest. round(@speed_kmh)
trunc(x)Truncate toward zero. trunc(-1.7) → -1
fract(x)Fractional part, x - floor(x). fract(elapsed())
sqrt(x)Square root. sqrt(gforce)
sin(x)Sine, x in radians. $y = sin(elapsed() * 2 * PI)
cos(x)Cosine, x in radians. $x = cos(angle) * r
tan(x)Tangent, x in radians.
asin(x)Arc sine → radians.
acos(x)Arc cosine → radians.
atan(x)Arc tangent → radians.
atan2(y, x)Angle of (x, y), quadrant-aware. atan2(vel.y, vel.x)
deg(x)Radians → degrees. deg(atan2(y, x))
rad(x)Degrees → radians. sin(rad(steer_deg))
exp(x)ex. exp(-t) for decay curves.
log(x)Natural log (base e).
log2(x)Log base 2.
log10(x)Log base 10. $db = 20 * log10(v)
pow(a, b)a to the power b — same as a ^ b. pow(t, 3)
hypot(a, b, …)Euclidean length √(a² + b² + …). hypot(vel.x, vel.y)
lerp(a, b, t)Linear blend from a to b, t ∈ 0–1. lerp(0, 270, ratio) for a needle angle.
remap(x, inLo, inHi, outLo, outHi)Re-map x from one range to another. remap(@rpm, 0, 8000, 0, 1)
smoothstep(lo, hi, x)Eased 0→1 as x crosses [lo, hi]. smoothstep(0.7, 0.95, ratio)
rgba(r, g, b, a?)Build a colour — components 0–255, alpha optional. $c = rgba(255, 80, 0)
mixcolor(c1, c2, t)Blend two colours, t ∈ 0–1. Bare names passed in become colour inputs. $c = mixcolor(cold, hot, heat)
str(x)Number → text; concatenate with +. $label = "P" + str(@position)
format(x, decimals)Fixed decimals. format(@fuel_level, 1) → "42.3"
prev(x)Value of x on the previous tick. $dv = x - prev(x)
changed(x)true on the tick x changes (any direction). changed(@gear)
rising(x)true on the tick x increases. rising(@flag)
falling(x)true on the tick x decreases. $better = falling(@delta)
pulse(trig, dur_s)true for dur_s seconds after a rising edge of trig (re-trigger restarts). pulse(changed(@flag), 3)
blink(freq_hz, duty?)Square wave at freq_hz; duty 0–1, default 0.5. ratio > 0.95 ? blink(6) : 0
elapsed()Seconds since the dashboard started rendering. sin(elapsed() * 2 * PI)
No function matches — try another word, or clear the category filter.
blink() in one program are two independent oscillators.blink() resumes where it left off).Coloured exactly like the editor — outputs, channels, functions, numbers each in their own hue (see the colour key).
| Goal | Program |
|---|---|
| Shift light that flashes near the limiter | ratio = @rpm / 8000; $on = ratio > 0.95 ? blink(6) : 0; $col = mixcolor(rgba(0,255,0), rgba(255,0,0), smoothstep(0.7, 0.95, ratio)) |
| Gear label with N / R | $g = @gear == 0 ? "N" : @gear == -1 ? "R" : str(@gear) |
| Warning held 3 s after a flag | $warn = pulse(changed(@flag), 3) |
| Delta trend arrow input | $better = falling(@delta) |
| Fuel laps left, one decimal | $laps = format(@fuel_level / max(0.1, @fuel_used_per_lap), 1) |
| Needle sweep angle | $angle = lerp(-120, 120, clamp(@rpm / 8000, 0, 1)) |
The editor and the Properties panel colour the source the same way:
clamp function
8000 number
"R" string
@rpm channel
$shift output
.x .r component
PI constant
rpm variable
+ * operator
Whitelisted by design: only the functions on this page run, and arbitrary member/index access is locked down — an expression can't reach outside its sandbox. random, hyperbolics and array helpers stay blocked.