Sorry to revive the old thread, but I’m trying to use them now - I need to do a bit of variable scaling to an incoming value. I’ll be specific:
the user is moving a slider which sends me OSC, with a value of 0.0 - 1.0, let’s call that inValue
for each slider, I want to store a string to be used as an expression, say “(inValue * 2.0) - 1.0”
My class that is running the expressions now inherits from Expression::scope, so it can handle things like ‘currentValue’, or parent.x etc.
My question is, can’t I inject the one value in without returning it from the scope? I see I can create an expression from a double, or an operation, should I be making an expression with my value, and then applying the stored expression?
Or do I have to set the incoming value to a member so I can pass it back in the scope, which seems a bit back-assward to me?
Edit: it does work this way. It just seems that I should be able to pass at least one value in when I evaluate.