Hi @ClintGoss,
I always confuse even myself a little with this math expression stuff.
Cantabile has two expression engines:
- The main one for general purpose use in sysex and string variable expressions and,
- a more highly optimized, numeric only one used control curves.
The numeric only one is more highly optimized (and limited) because it needs to be fast for high update rate of level meters.
All that’s to say there’s two expression engines that are similar, but different and the numeric one doesn’t have the clamp function.
But you can probably add it yourself with another definition entry similar to this:
"clamp(x,a,b)": "x < a ? a : (x > b ? b : x)"
(I haven’t tested this, let me know if it works or not)
Or, if you can wait to the next build I can add it?