[CM] Finding the duration of a time-varying resampled sound.

Kjetil S. Matheussen k.s.matheussen@notam02.no
Mon, 27 Oct 2003 11:01:25 +0100 (MET)


I have just made a lisp-graph dialog for snd to change the
resampling factor over time. For example to let the sound
start at 44100hz and gradually change over to 22050hz.

But, I have a problem. I need to find the length of the
finished processed sound, before doing the actual processing.
And the function I have now does that the wrong way.
(It just takes the average speed between to points and
multiply with the length)

The lisp-graph looks like this:

 1-------------------
 |
 0-------------------
 |
-1-------------------

So if theres a line starting at 1 and ends at 0.5, the
speed of the sound gradually change from full-speed to
half speed. The duration is then obviously longer the
closer the y-value is to 0.

What I need is a general formula for the scale-factor 's'
between two points (x1,y1) and (x2,y2), where y1 and y2 are
always positive values.





--