Previous topicNext topic

Parameters arguments as expressions

Suggestions for new features for Magic.
Post Reply
mcornholio
Posts: 22
Joined: Sat Sep 09, 2017 6:57 pm

Parameters arguments as expressions

Post 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).
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Parameters arguments as expressions

Post 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?
mcornholio
Posts: 22
Joined: Sat Sep 09, 2017 6:57 pm

Re: Parameters arguments as expressions

Post 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.
Post Reply