Value Tracker

Track a numeric value over time as a running sum, min, max, average, EMA, rate, or count.

What it does

Value Tracker watches a number over time and carries state forward from frame to frame: a running total, the highest or lowest value seen, a smoothed average, a rate of change, or a count of threshold crossings. Mode sets which. No hand-built feedback loop is needed.

It also reports whether the tracked value changed this frame and how many samples have been processed since the last reset.

When to use it

ParameterTypeDefaultWhat it does
inputNumber or Number[]—Numeric value to track (Number or NumberArray)
resetBoolean or Number—Rising edge resets tracked value to initial_value
gateBoolean or Number—When false, tracking pauses and output holds at last known value
modeString"Sum"Sum: running total. Max/Min: highest/lowest seen. Average: arithmetic mean. EMA: exponential moving average. Rate: change per second. Count: threshold crossings. One of: Sum, Max, Min, Average, EMA, Rate, Count.
initial_valueNumber0Initial tracked value and the value restored on reset
fadeNumber0Decay rate per frame. Stored value is multiplied by (1 - fade) each frame before new input. 0 = no decay.
windowNumber0Rolling window size in frames. 0 = track over all time.
smoothingNumber0.100Smoothing factor (alpha). Lower = smoother/slower. Higher = faster/noisier. Formula: state += alpha * (input - state).
thresholdNumber0.500Input must cross this value to increment the count
count_edgeString"Rising"Rising: count when crossing above. Falling: below. Both: either direction. One of: Rising, Falling, Both.
enable_boundsBooleanfalseClamp or wrap the output value to a range
bounds_modeString"Clamp"Clamp: restrict to [min, max]. Wrap: modulo wrap around the range. One of: Clamp, Wrap.
bound_minNumber0Lower bound
bound_maxNumber1Upper bound

Gotchas

Fade multiplies the stored value by (1 - fade) every frame before the new input is folded in. It decays toward zero, not toward Initial Value. Leave it at 0 for no decay.

Window applies to Average, Max and Min mode only. Left at 0 it tracks over all time since the last reset; raise it to track only the most recent N frames.

Gate pauses tracking and holds the output at its last value. It resets nothing. Use Reset, on a rising edge, to snap the tracked value back to Initial Value.

Count mode needs Threshold and Count Edge, which stay hidden unless Mode is Count. Rising counts upward crossings, Falling counts downward crossings, and Both counts either direction.

Worked example

  1. Add a Value Tracker and wire a changing number into Input.

  2. Set Mode to Average and raise Window to smooth out short-term noise over the last N frames.

  3. Wire a Boolean into Reset so an external trigger can snap the running average back to Initial Value.

  4. Turn on Bounds and set Bound Min/Bound Max if the output must stay inside a fixed range.

See also

Hold · Analyze · Math · Numbers, signals & audio