[Ardour-Dev] Crossfade code overlap 2.x and 3.0

Giso Grimm gg3137 at vegri.net
Sun Dec 14 07:34:20 PST 2008


Here are more observations:

When layer model is "more recently moved is higher" and I move the first
region, I hear a click at the end of the crossfade. If I move the second
region, then I have to move the first region twice to make the click
audible.

The click has the amplitude of the last sample from the first region,
and is at that position.

Whenever a click is audible, the function _in->read_at() in
Crossfade::read_at() returns one value less than _out->read_at() just
one line before. The length of the crossfade is always the larger number
(i.e. the return value of _out->read_at()).

The last values of "crossfade_buffer_in" and "corssfade_buffer_out" seem
to be correct, though, and also the mixed values stored in "buf".

Question 1:
Does the playlist somehow know that only N-1 values have been read from
the fade in region, and will not use more than N-1 values for the
crossfade, but still starts the second region (I mean that part of the
later region which lies after the end of the crossfade) only N samples
after begin of crossfade?

Question 2:
Why does _in->read_at only return N-1 values, even if the region has
more samples?

I think the answer to question 2 could solve the bug, while the answer
to question 1 would help me understand the code and could provide a
work-around.

(its all 2.7.1)

Giso


Giso Grimm wrote:
> 
> Paul Davis wrote:
>> On Thu, 2008-12-11 at 22:08 +0100, Giso Grimm wrote:
>>> How much overlap is in the crossfade code between 2.x and 3.0? I would
>>> like to start debugging a crossfade bug (#1737), but maybe it is not
>>> worth doing so if the code is almost outdated...
>> its a bit different, for sure. first make absolutely sure the bug is
>> still there, because there was a definite bug that i fixed for 2.7.1
>> that affected the very final sample of a crossfade.
> 
> It is still there, 2.7.1, rev 4296. I am (was) almost sure it is an
> off-by-one bug in crossfade.cc, but the strange thing is that the click
> disappears when I manually change the layering. The setting "Most
> recently moved is higher" is selected, and if I move the first region to
> make it higher again than the click is again there. Even is it was the
> higher layer anyway before, by raising it manually to top layer.
> 
> I will have a deeper look at it, and will report if I find out more.
> 
> Giso
> 
> 
>> otherwise, the math is similar/identical, but the code has changed
>> around.
>>
>> in addition, i am still merging the 2.X changes from rev 3890-4299 into
>> 3.0, so actually working on this would probably be premature.
>>
>> --p
>>
>>
> _______________________________________________
> ardour-dev mailing list
> ardour-dev at lists.ardour.org
> http://lists.ardour.org/listinfo.cgi/ardour-dev-ardour.org



More information about the Ardour-Dev mailing list