y variable?

Sun Dec 13, 2020 3:01 pm

is there some example with the "y" variable ? When I use it, I get an error message 'undefined symbol"...
skarabee
 
Posts: 106
Joined: Fri Aug 28, 2015 3:11 am

Re: y variable?

Sun Dec 13, 2020 4:01 pm

Can you post a screenshot of that error?
Eric
Site Admin
 
Posts: 2992
Joined: Wed Apr 09, 2014 9:28 pm

Re: y variable?

Sun Dec 13, 2020 11:02 pm

error.jpg
error.jpg (67.7 KiB) Viewed 291 times

Just typed the example expression, but maybe there is something i didn't catch..
skarabee
 
Posts: 106
Joined: Fri Aug 28, 2015 3:11 am

Re: y variable?

Sun Dec 13, 2020 11:48 pm

All definitions are locally defined. If you have not specified what "y" is determined to be, then it will not know what you mean when you make an "if/else y" statement. May I ask what you want "Y" to be? You could create a global parameter called "Yvalue" for instance, and make your argument if(x<0.5,x,Yvalue)
sjdacruz
 
Posts: 28
Joined: Sat May 30, 2020 4:53 am

Re: y variable?

Mon Dec 14, 2020 12:36 am

In 2.31 the y variable is defined by default.

Are you sure you’re using 2.31 and not 2.3?
Eric
Site Admin
 
Posts: 2992
Joined: Wed Apr 09, 2014 9:28 pm

Re: y variable?

Mon Dec 14, 2020 5:50 am

That was the case. I did quit 2.31 and relaunched 2.30 using the wrong shortcut. Now the expression work as expected.
Anyway, some examples with the use of the new internal variable y could be fine. my skill with "expression" modifier is near from 0 :)

Edit: I already managed to split the keyboard as Eric suggested (great tip by the way), but I was wondering about other way to use "y".
skarabee
 
Posts: 106
Joined: Fri Aug 28, 2015 3:11 am

Re: y variable?

Mon Dec 14, 2020 8:27 pm

Well, a lot of the existing modifiers in Magic use the y variable internally. For example, if you do an expression with .1x+.9y, then you will get a very smooth response, like the Smooth modifier, because it combines 10% of the new value with 90% of the previous value.

Similarly, if you do if (x > y, x, .1x+.9y), then you get something like the Peak modifier, which uses the following algorithm: if the new value is greater than the previous, output the new one immediately, otherwise output the new one smoothed a bit (with the smoothing being what I described above).

Most users probably won't want to do things like that because the existing modifiers are simpler to use and also time-weighted (to account for changing frame rates, etc.). But I'm sure someone will come up with something interesting!
Eric
Site Admin
 
Posts: 2992
Joined: Wed Apr 09, 2014 9:28 pm

Return to General Discussion

© 2021 Color & Music, LLC • This web site is mobile-friendly