Re: [linux-audio-dev] math question re. tempo changes

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] math question re. tempo changes
From: Paul Winkler (slinkp_AT_ulster.net)
Date: ti joulu  07 1999 - 02:40:49 EST


Thanks for the reply, Eli.

If you can bear with my ignorance a bit, I hope I can make sense of
your message... I'm out of my depth here, but I'm trying!

Eli Brandt wrote:
>
> Paul Winkler wrote:
> > What I want to do is basically this:
> > Let's say I have a section that starts at "beat" 0. The section
> > lasts until "beat" 10. During this section, the tempo accelerates
> > (linearly) from 60 to 120.
> >
> > Given any beat value in this section, I should be able to calculate
> > the "real" (seconds) time value for this beat.
> > Let's say it was a function called:
> > beat_to_clock(beat_value, start_tempo, section_length, end_tempo)
> >
> > How can I do that?
>
> ok, we're dealing with
> tempo: beats per second
> tempocurve: function from beats to tempo
> beat_to_clock: function from beats to seconds
>
> the basic relationship is
> d(beat)/d(sec) = tempocurve(t)

what is d?
what is t? I thought short for "tempo" but that would suggest tempo
is the argument, not return value, of tempocurve?

> so
> d(sec)/d(beat) = 1 / tempocurve(t)

OK, that much I can handle. :)

> so
> b_t_c(beat) = Integral(from 0 to beat) 1 / tempocurve(b) d(b)

uh-oh.
 

This is what I was afraid of -- we've left the realm of the math
courses I took so long ago... I never got farther than trig (which I
barely remember) and some logic, no calculus. I don't know what an
integral is, nor how to compute it, nor where to find an explanation
of that which I can understand. any pointers would be appreciated.
Preferably online as libraries here are rather limited (no good
university I can get to easily), and I have no money for books these
days.

Also I looked for "integrals" in the python documentation and turned
up empty, except in several cases where they seem to mean "integer".
So much for hoping to solve the problem without understanding it!

> you've got a linear tempo curve
> tempocurve(b) = start_tempo + (b / section_length) *
> (end_tempo - start_tempo)
> so in this case
> b_t_c(beat) = Integral(from 0 to beat)
> start_tempo +
> ((end_tempo - start_tempo) / section_length) * b
> d(b)
> = 1/k ln(start_tempo + k*b)

That last line looks tantalizingly simple. Too bad I'm lost again...
what's ln()?

> where
> k = (end_tempo - start_tempo) / section_length
>
> hmm, does that look sane?

Sure! {:)

-- 
................    paul winkler    ..................
slinkP arts:   music, sound, illustration, design, etc.
A member of ARMS    ----->    http://www.reacharms.com
or http://www.mp3.com/arms or http://www.amp3.com/arms
personal page   ---->    http://www.ulster.net/~abigoo


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:26 EST