[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: [linux-audio-dev] math question re. tempo changes
From: Paul Winkler (slinkp_AT_ulster.net)
Date: ma joulu  06 1999 - 03:59:08 EST


Hi folks,

I have a math question about tempo.
I'm working on a python module for creating csound scores, and I
want a way to do what csound does with the "t" statement.
(Eventually I want to do more than that, but that would do for a
start.) This is a simple linearly-interpolated accelerando /
decelerando. Trouble is, I can't for the life of me figure out the
math.

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?

I tried looking at cscsort.c (in the csound sources) and the files
it includes, but I can't read C nearly well enough to have any idea
what's going on there.

I played around with some "t" statements in csound scores, just to
see what I could observe about the results. All I could tell is that
the ratio between beat-time and clock-time changes linearly during
the section. I have no idea what formula would produce the desired
result. Blind guessing has got me nowhere, so I thought I'd throw
myself on the mercy of this list.

thanks,

--PW

p.s. anyone who really wants to see my code, just ask. I'll be
posting it on my website before long. At the moment pysco does
everything that Pscore did (Pscore was my earlier attempt at doing
the same things in Perl), with a few new features. I would not yet
characterize pysco as useful code, but I think it will soon be in a
state where I at least can compose with it. Tempo changes are the
big hurdle at the moment.
 
................ 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