-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interpolated BEAN number for animation use #470
base: master
Are you sure you want to change the base?
Conversation
Adds new global variable INTERBEAN, which is a float that is interpolated between BEAN numbers, in a linear way between frames. This can be used to key animations without getting the lower frame rate of BEAN.
INTERBEAN is also a bit long name for a variable you might repeat a ton of times while writing animations, anyone have a better suggestion? FBEAN? (float bean) BEAF? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine INTERBEAN might be piecewise linear from bean to bean, but have different slopes depending the relation between bpm and fps. Perhaps a better approach would be to construct INTERBEAN by just scaling frame to match? Of course, then INTERBEAN and BEAN wouldn't necessarily be equal when BEAT is true, which might not be optimal either 🤔
Not sure I follow. This PR would make INTERBEAN piecewise linear with the slope depending on bpm and fps already, right? |
Yes, we agree about the current behaviour then. It is piecewise linear and certainly not just a straight line. I went back to find the original use case that motivated this: Basically it's used for animations between states that complete on a beat. (In this case the rotation of the cube). And since there could be different amounts of frames between beats you do want the rotation speed to vary. You're right though, this could easily be used in scenarios where you want/expect a constant speed. An alternative that would also solve the motivating scenario would be a number that goes 0.0 -> 1.0 between each beat? |
Also happy to make the decision that this is more confusing than useful and close this PR. |
Maybe we can just give it a name that implies the piece-wise-ness strongly enough and merge that. |
Adds new global variable INTERBEAN, which is a float that is
interpolated between BEAN numbers, in a linear way between frames.
This can be used to key animations without getting the lower frame rate
of BEAN.
Discussion to be had here: Can we instead change BEAN to have fractional values? The way I see it that would be the preferred option here, but I'm afraid of changing behaviour if people have already relied on it being an integer somewhere.