Help required to calculate change in tempo over time

  • Context: MHB 
  • Thread starter Thread starter sammyg1
  • Start date Start date
  • Tags Tags
    Change Time
Click For Summary

Discussion Overview

The discussion revolves around calculating the change in tempo and the subsequent start times of audio loops that vary in length over time. Participants explore how to determine the next interval's start time after changing tempos multiple times, focusing on the mathematical relationships between beats per minute (bpm) and loop durations.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant seeks assistance in calculating the start time of audio loops that change tempo, providing an example with specific bpm and loop lengths.
  • Another participant explains the relationship between tempo changes and loop duration, questioning the initial assumption of the new loop length.
  • Some participants propose equations to calculate the next start time based on elapsed time and changing tempos, including a formula that incorporates the number of beats and tempo changes.
  • A later reply suggests that the calculation could be approached on a case-by-case basis, indicating that a simple formula may not exist for all scenarios.
  • There is a discussion about the need for precise calculations when changing tempos and how to handle multiple tempo changes over time.
  • One participant expresses uncertainty about the formatting of their proposed equation and suggests using a computer program for complex calculations.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a single formula for calculating the next interval's start time, with multiple competing views and approaches presented throughout the discussion.

Contextual Notes

Some participants note that the current equations may require small time properties to compute remaining durations accurately, indicating potential limitations in their applicability to larger time intervals.

sammyg1
Messages
7
Reaction score
0
Hi There,

I am in need of help to figure out the best way to track a time interval that changes tempo/length over a period of time. So that I know the start time of the next interval.

For example, say I have an audio loop playing at 120bpm and the loop length is 2 seconds. If I was to change the tempo to 80bpm at 1.5 seconds, how would I calculate the next interval or start time of the loop, which now has a length of 3 seconds.

Any help would be great!
 
Mathematics news on Phys.org
If you have a 2 second loop that has a tempo of 120 bpm, then you have 2 bps. If the tempo changes to 80 bpm at 1.5 seconds, you have already played 3 beats at the original tempo, and the remaining beat at the new tempo will take 0.75 seconds, so the loop will increase in length by 0.25 seconds.

I don't see why the new loop would be 3 seconds in duration. Could you elaborate?
 
MarkFL said:
If you have a 2 second loop that has a tempo of 120 bpm, then you have 2 bps. If the tempo changes to 80 bpm at 1.5 seconds, you have already played 3 beats at the original tempo, and the remaining beat at the new tempo will take 0.75 seconds, so the loop will increase in length by 0.25 seconds.

I don't see why the new loop would be 3 seconds in duration. Could you elaborate?

By changing the tempo the loop will adjust in pitch as to keep in time with the tempo. This change in pitch results in change in length. Increasing the tempo shortens the loop and vice-versa. The loop would be 3 seconds to span an entire bar before it repeats. I worked that out by 120bpm / 80bpm x 2 seconds = 3 seconds.

I am looking for an equation to calculate next StartTime if the loop started at 0 and changes tempo x number of times over a period of time.
 
If the entire loop, which at 120 bpm takes 2 seconds, is played at 80 bpm, then yes, it will take 3 seconds, as 120:80 = 3:2. But, I thought you are changing the tempo after 1.5 seconds, and playing the remaining beat at the new tempo.
 
Yes I am. So from 0 to 1.5 seconds the tempo would be 120bpm with a starting length of 2 seconds. Then same loop will play from 1.5 seconds to 2.25 seconds at 80bpm with a remaining length of 0.75. Then at 2.5 seconds the tempo may change to 60bpm and so on and so forth...

I need to be able to do this more than once and continuously over a period of time. Is there an equation I could use to calculate this? Gathering I know the current time, how could I work out the StartTime of the next interval/loop?
 
So, from 2.25 to 2.5 second, the loop restarts, still at 80 bpm, and during this 0.25 seconds will play 1/3 beats, leaving 11/3 beats now to be played ay 60 bpm, or 1 bps, so it will take 11/3 seconds to complete at the new tempo.

Thus, if we have an $n$ beat loop which begins at a tempo of $T_1$ bpm, then after $t<\dfrac{60n}{T_1}$ seconds changes to a new tempo of $T_2$ bpm, the duration $d$ of the loop in seconds will be:

$$d=t+\left(n-t\cdot\frac{T_1}{60} \right)\cdot\frac{60}{T_2}$$
 
Thank you! That's very helpful. If you are also able to consider the following it would be great...

Rather than working out the remaining duration, is it possible to equate the next StartTime of the loop if i know it has been playing for 17.5 seconds at 120bpm, then 6.75 seconds at 80bpm, then for 11 seconds at 90bpm, so on and so forth... ?

That gives a total of 32.25 seconds of elapsed time. At what time would the next interval begin?
 
At this point, I will have to hand it off to someone else, as it is just after 4:30 am here, and nearing time for my slumber. If, when I get up and after I have completed a project I have waiting for me, and no one has offered further help, I will be glad to try to offer assistance. :D
 
Thanks for all your help so far. Any further assistance would be greatly appreciated. :)
 
  • #10
It seems to me that what you could do is take each time interval on a case-by-case basis and compute how many loops will play, and use the formula I gave above for the transition from one tempo to another. I don't see a simple formula for this; it's just going to take a lot of arithmetic.
 
  • #11
I thought this would be the case. Although the current equation requires the time property to be small to compute the remaining duration. Is it possible to use 17.5 seconds and then figure out the next interval when changed to 80bpm?

For example, nextInterval = 17.5 + ...

Then the result should be 18.25 with 0.75 remaining of the loop at the new tempo (80bpm).

Are you able to show an example of how this would work?
 
Last edited:
  • #12
I'm fairly sure I have worked it out...

i = t + ( ( ceil( t / n ) * ( n - t ) ) * ( t1 / t2 ) )

Please excuse my formatting, I wasn't sure how to do Ceil in LaTex.
 
  • #13
To format that in $\LaTeX$ use the code (after rearranging a little and omitting some unnecessary bracketing):

i=t+\left\lceil\frac{t}{n} \right\rceil\frac{T_1}{T_2}(n-t)

to get:

$$i=t+\left\lceil\frac{t}{n} \right\rceil\frac{T_1}{T_2}(n-t)$$

You've lost me with that formula, but if it works for your purposes, then I am glad.

I was going to suggest writing a computer program to handle a case like the last one you posted.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
395
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
7
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K