RE: tangent computation in .fraw / .fraw2 ?

Date : Fri, 29 Jun 2007 16:22:16 +0100
To : <XSI(at)Softimage.COM>
From : "Brent McPherson" <brentmc(at)Softimage.COM>
Subject : RE: tangent computation in .fraw / .fraw2 ?
Alex,
 
I would suggest you use .fraw2 as I don't think .fraw can support arbitrary tangents (i.e. length is fixed) because it is a very old file format.
 
Anyway, here is how tangents are computed in .fraw from the single slope value saved in the file:
For each key it reads time, value, leftslope, rightslope
 
    the right tangent of the *PREVIOUS* key is computed like this:
 
        tanX = (time - previous_time) / 3.0
        tanY = previous_rightslope * tanX
        SetRightTangent( previous_time, tanX, tanY )
 
    the left tangent for the *CURRENT* key is computed like this:
 
        tanX = -tanX (i.e. negative of value computed above)
        tanY = leftslope * tanX
        SetLeftTangent( time, tanX, tanY )
 
then update the previous_time and previous_rightslope for the next key etc.
Hope this helps.
--
Brent

From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Alexander Hemery
Sent: Friday, June 29, 2007 2:30 PM
To: XSI(at)Softimage.COM
Subject: Re: tangent computation in .fraw / .fraw2 ?

Hiya
 
Sorry didn't come to work yesterday ...
 
In .fraw format, only one value is stored for each tangent, so we assume that the length is actually derived from the difference in the key-frame time values. I have all the curve & tangent information that I need, and the distance between the key-frames. You said that "Added tangent lengths on 2 successive keys cannot be more than approx 1.25 of the distance between 2 keys ", do you know the formula to compute the single value that .fraw needs for each tangent, based on the information that I have?
 
p.s
Hopefully it will be cool yeah ...I've always deeply enjoyed visuals synched to sound! From disney's fantasia to gantz graff video clip ...it all rocks!
Would be nice to have something that helps you explore that visual/sound perfect match ...although I'm realizing that using waveforms won't get you very far. MIDI would be the way to go afterall.
 
Anyhow I'll post a link soon for a beta version anyone could try out and hopefully give some improvement feedback.
 
Cheers!
 
Alex
 
 
 
----- Original Message -----
From: javier
Sent: Wednesday, June 27, 2007 6:04 PM
Subject: Re: tangent computation in .fraw / .fraw2 ?

Fraw and fraw2 simply store the tangents. Tangent syntax requires 4 values per key (left length, left height, right length, right height). Added tangent lengths on 2 successive keys cannot be more than approx 1.25 of the distance between 2 keys and when you add a key on an editor that is ensured by the software.
But thats too simple, you must want something else.

You want to create tangents from raw key data? The only way you can do that is doing some recursive fitting algorithm.

Im not sure what you are after but making fcurves from frequency sounds cool.
 













On 6/26/07, Alexander Hemery <vortex(at)fhw.gr> wrote:
nope..but thanks
----- Original Message -----
Sent: Tuesday, June 26, 2007 5:22 PM
Subject: Re: tangent computation in .fraw / .fraw2 ?

Does the do what you are looking for?
----- Original Message -----
Sent: Tuesday, June 26, 2007 9:47 AM
Subject: tangent computation in .fraw / .fraw2 ?

Hello,
 
Anyone know how those tangent values in .fraw/.fraw2 files are computed ?
We're doing a little application to get fcurves from sound ..by using a selected frequency (not global amplitude) ...but i can't understand what those tangent numbers derive from ... Any ideas?
 
There's always the option of exporting linear keys ...but what would be nice is to get a nice bezier with as few keys as possible....
 
Cheers
 
--
Alexander Hemery
 
 
 
 


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.