Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sorry if the title of this post is difficult to understand...

Basically I am trying to animate something on an X axis based off a "tempo"... The possible valid X coordinates are between -30 and +30, so my range is really 0-60.

I am looking for a way to skip steps of the 0-60, based off of the value of the tempo.

For example, if T=1 (a ridiculously slow tempo), then I would expect to be moving my animation on a per pixel basis, so my X would increment 0,1,2,3,4,5..60...

But if T is something higher, then it would end up skipping steps so that it could arrive at 60 faster... In other words, if T was a really large number, the steps might be something like 0, 15, 30, 45, 60.. or even larger.. maybe ever just 0, 30, 60...

I know what the end goal is of what I want, I just am not sure what out of the old math toolbox to use to get where I want to go with this. If anyone can walk me through the process of how one would figure a way to arrive at the goal, that would great-- because I am drawing a blank on this one.

share|improve this question
What is the range for T and how is it chosen (steps of 1 of steps varying between some range or something else)? Knowing that, we can probably come up with an adaptive step size based on the X_incr range of {0 ... 60}. –  Amzoti Sep 20 '12 at 5:16
T could be anything... 0-infinity.. But we're talking musical tempos, so realistically it's probably going to be something like 30 to 240... –  patrick Sep 20 '12 at 6:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.