Welcome to my CPE 474 final project: the
Animated Keyboard!
Press these buttons to make different sounds:
Timing Functions
Each of the cube-instruments use a different
timing function to achieve their motion. For each movement, I pass in a start transform, an ending transform and a duration. Without the timing function, each animation would simply linearly go from the starting transform to the ending transform.
This would be super boring. Instead, I modify each animation with a
timing function. First, I
normalize the time elapsed for each animation. That is, instead of going from (starting milliseconds) to (ending milliseconds), each animation goes from 0 to 1. Then, I pass in the normalized time parameter into my timing function.
Javascript lets you treat functions like variables and argument parameters, so the entire function to animate a cube looks like:
animate_cube( cube, start_transform, end_transform, duration, timing_function );
Timing Function Examples
Shimmy