I am writing a game, and I have a period (a repeating cycle) which is mapped to the scrolling of a background. I want to change this period, so that the scrolling is faster or slower--- but if I just change the period, the background's x position will JUMP to wherever it would be had it been moving at the rate of the new period. To compensate for this, I need to on a frame-by-frame basis, be gradually changing the period from the old and the new.
This is where my problem lies: I know the difference between the old and new period-- It's just not apparent to me how to figure out the formula for finding how many steps to break up this transition over time. Any help would be greatly appreciated.