Page 1 of 1

Floating Point error in Labels

Posted: Fri Mar 07, 2008 5:35 pm
by quixadhal
I just downloaded the new (1.3.4) beta build and went to make a mix album. Importing a handful of tracks, I use the time shift tool to arrange them with some overlap, then used the label tool to create labels for each track in a new label track. Then I mixed/rendered the tracks into a single track and did an export-multiple to get tracks with the overlap fade I wanted.

I quickly discovered that because labels have start and end points, this causes export-multiple to create each track in full, thus duplicating the overlap material. Ok, I thought, no biggie. I'll just go edit the labels in the label editor and set their start and end point to the exact same value (in time + frames).

I did this, everything appeared correct. When I redid export-multiple, some tracks were correct, and others were almost zero length (only a handful of frames). So, I exported the label track and discovered the following floating point conversion errors.

Code: Select all

1613.760000	1613.760000	Cranes - Watersong
1841.826667	1841.830000	Lagerfeldt - Flip the Flop
2044.586667	2044.590000	Bobby Darin - Beyond the Sea
Note that in the project, all these tracks appear to have labels which start and end on the same frame, as desired. Yet when exported as floating point seconds, we're seeing a roundoff error (probably because of different precisions being used at different points).

I'll try hand-editing the label file and re-importing it as a label track to see what happens, but I figured you guys would want to know.

Re: Floating Point error in Labels

Posted: Fri Mar 07, 2008 8:25 pm
by steve
In the label file, the first number is the start of the labelled region and the second is the end.

In the following example;
The region "chirp" starts at 0.000000 seconds and ends at 30.783920 seconds (just under 31 seconds duration)
The region "noise" starts at 30.783920 seconds and ends at 42.775755 seconds (about 12 seconds duration)
The region "tone" starts at 42.775755 seconds and ends at 63.761468 seconds (just under 21 seconds duration)

Code: Select all

0.000000	30.783920	chirp
30.783920	42.775755	noise
42.775755	63.761468	tone

Re: Floating Point error in Labels

Posted: Mon Apr 07, 2008 9:11 pm
by quixadhal
Yes, I know *what* the fields are. My point was that there appears to be a floating point roundoff error in the code that generates them. This makes it almost impossible to generate seamless tracks from a single source track, since the start and end points don't line up, even if they are set to the same values in the GUI.

Re: Floating Point error in Labels

Posted: Wed Apr 09, 2008 12:32 am
by steve
You are setting the wrong numbers to be equal.
quixadhal wrote:

Code: Select all

    1613.760000   1613.760000   Cranes - Watersong
    1841.826667   1841.830000   Lagerfeldt - Flip the Flop
    2044.586667   2044.590000   Bobby Darin - Beyond the Sea
In this example you are saying that the song "Cranes - Watersong" starts and ends at "1613.760000"
This would meant that the song is of zero length.
The first number should be the start of the song, and the second number should be the end of the song.

If the number for the start of the second song is exactly the same as the number for the end of the first song, then they will match up exactly.