Math channels 101: your channels, your maths
A practical introduction to Muretto's math channels: the expression language, units, conditions, and how to make a channel that reads well on every chart.
Scorsa Team5 min read

A math channel is a channel you calculate from other channels. Once you have written one, it goes anywhere a logged channel goes: charts, track maps, tables, gauges, histograms, X-Y plots and templates.
This post covers the language. Later posts cover filters and lap values, comparing laps, and turning channels into events.
Making one
Open the Channels drawer and press the ƒx + button. The New math channel dialog asks for:
- a name, which is how you will refer to it, and must not clash with an existing channel;
- a unit, shown on axes and in tables;
- a colour for its trace;
- the number of decimals to show;
- the expression itself.
The editor lists every channel, constant and function beside the expression box. Click one to insert it, or hover over a function to see what it does. To change a channel later, right-click it in the Channels drawer and choose Edit math channel.
Channels go in square brackets
A channel is its name in square brackets. Here is speed in miles per hour:
[Speed] * 0.621371
And combined grip, from lateral and longitudinal g:
sqrt([G Lat]^2 + [G Long]^2)
Because car profiles map every logger to the same names, [Speed] means the same thing in an iRacing lap, a MoTeC file and a VBOX file.
Units
You rarely need conversion factors. Put a unit in a second pair of brackets straight after the channel and Muretto converts it before using it:
[Speed][mph]
Speed, length, angle, pressure and temperature units all convert this way, for example [Tyre Pres FL][psi] or [Oil Temp][°F]. The editor tells you straight away if a unit does not fit the channel.
Operators
The arithmetic is what you would expect: + - * /, % for remainder and ^ for power. Power binds tightest and runs right to left, so -2^2 is -4, as in maths notation.
Comparisons (< > <= >= == !=) give 1 or 0. That is the most useful idea in the language, because a condition is also a number you can multiply. This is the built-in Pedal Overlap channel:
([Throttle] > 5) * ([Brake Pres] > 2) * 100
It is 100 where both pedals are pressed and 0 everywhere else. Multiplying the two conditions means "both", and the * 100 turns the result into a percentage that plots nicely beside other pedal traces.
For longer rules you can write the logic out: && or and, || or or, ! or not. Note that not applies only to the value right after it, so write not([Gear] == 3), with brackets.
Choosing a value: where()
where(condition, yes, no) picks yes wherever the condition holds and no everywhere else. if() and choose() are the same function, if those names read better to you.
Conditions can nest. This is the built-in Pedal State channel, which labels every sample with what the driver's feet are doing:
where([Brake Pres] > 65, 4,
where([Brake Pres] > 2, 3,
where([Throttle] > 98, 2,
where([Throttle] > 2, 1, 0))))
0 is coasting, 1 part throttle, 2 flat out, 3 braking and 4 hard braking. Colour a track map by it and you can see the whole lap's pedal work at a glance.
Leaving gaps on purpose
Some channels only mean something some of the time. Wheel slip at walking pace, or corner radius on a straight, is noise. Divide zero by zero to leave a sample blank:
where(abs([G Lat]) > 0.2,
([Speed] / 3.6)^2 / (abs([G Lat]) * 9.81),
0 / 0)
That is the built-in Corner Radius: the radius the car is turning on, from speed and lateral g, and blank on the straights. Blank samples are not drawn, so the trace shows only the part of the lap you meant.
Channels built on channels
A math channel can read another math channel. The built-in Slip Front is just the average of two others:
([Wheel Slip FL] + [Wheel Slip FR]) / 2
Build small channels that each do one thing, then combine them. They are easier to check, and when you fix one, everything built on it is fixed too.
Car constants
Some calculations need the car's geometry. Three constants are filled in from the car, the setup or the telemetry:
$wheelbase, in metres;$steeringRatio;$maxSteering, lock to lock, in degrees.
For example, road-wheel angle from the steering wheel is [Steering] / $steeringRatio.
Comments
Long expressions are easier to come back to with notes in them. // comments out the rest of a line, and /* like this */ works anywhere:
// front share of brake line pressure, only while braking
where([Brake Pres] > 5,
([Brake Line FL] + [Brake Line FR]) /
([Brake Line FL] + [Brake Line FR] + [Brake Line RL] + [Brake Line RR]) * 100,
0 / 0)
Make it read well: the Display tab
The second tab in the editor, Display, controls how the channel draws everywhere it appears. You can:
- grade it into colour bands, with a label for each band, as Pedal State does, so a track map coloured by the channel has a legend that means something;
- use a gradient from one colour to another across the scale;
- draw lines at fixed values, such as a limit or a target.
These settings belong to the channel, not the panel, so you set them once.
Tips
- Start from a built-in. Muretto ships around forty math channels. Open one, read the expression, and copy the pattern.
- Name channels for what they mean, not how they are calculated. "Rear Wheelspin" is more useful on a chart than "Slip Rear > 6".
- Plot it beside its inputs the first time. If Pedal Overlap fires and neither pedal looks pressed, a threshold is wrong.
- Thresholds are per car. A 6 % slip limit suits one car and not another. Treat the numbers in the built-ins as starting points.