Page 1 of 1

Parameters arguments as expressions

Posted: Tue Feb 06, 2018 11:43 pm
by mcornholio
I've seen that you fulfilled my request about allowing globals to expression and i'm VERY grateful.

While I was enjoying this feature and struggling with programming some modifier, i thought: why can't we allow expressions in parameters?

if you print "50 * 2", you'll get a scale(100). If you print "50 * halfbeat", and halfbeat global is 10 you'll get scale(500).

I'm suggesting this implementation: you right-click on some modifier, i.e. scale and there's an option called "Make expression". You click it and your parameter field turns from number input (with up-down keys) to string input (like text, or expression parameter itself). Previous value stays in place. So, if you had "scale: 50", where 50 is number, you get "scale: 50" where 50 is expression. If you have your parameter as expression, "Make expression" option in context menu will turn to "Make numbebr"

x in expression would refer to previously caught value (like expression parameter itself).

This partially covers globals in parameters: viewtopic.php?t=1072 (except my suggestion of mapping parameters to any source).

Re: Parameters arguments as expressions

Posted: Wed Feb 07, 2018 3:46 pm
by Magic
I'm not sure what the difference is between that and just replacing the Scale modifier with an Expression modifier that says 50*x?

Re: Parameters arguments as expressions

Posted: Wed Feb 07, 2018 5:26 pm
by mcornholio
Maybe scale wasn't a good example and modifiers like "smooth" or "delay" would be better ones.

But yeah, a good point: I could actually implement most of modifiers in expression language.

I can't save any state, to implement smooth/delay/hold/etc., and, putting big one-liners in that small text field is a little bit painful.
But other than that, I may not need this feature that badly as I thought.