Discussion:
[Audacity-devel] Potential change to void WaveTrack::SplitAt(double t)
David Bailes
2017-05-04 16:02:17 UTC
Permalink
In trying to sort of the problems with rounding errors in the start and end
times of clips which are affecting the clip boundaries commands, I would
like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two
lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.
Paul Licameli
2017-05-04 16:52:45 UTC
Permalink
There is a commit from ra dated 23 Jan 2010, before which, there is nothing
in our Git repository.

If you need to research older history, clone this repository:
https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL
Post by David Bailes
In trying to sort of the problems with rounding errors in the start and
end times of clips which are affecting the clip boundaries commands, I
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);
newClip->SetOffset(c->GetEndTime());
Can anyone see a problem with this change? Using Git, the first of the two
lines was last changed by RA, which I presume is Richard Ash.
thanks,
David.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-05-04 17:11:43 UTC
Permalink
Your proposed change makes sense to me. The simplification is welcome.

PRL
Post by Paul Licameli
There is a commit from ra dated 23 Jan 2010, before which, there is
nothing in our Git repository.
https://github.com/JamesCrook/audacity-from-svn-5GB.git
PRL
Post by David Bailes
In trying to sort of the problems with rounding errors in the start and
end times of clips which are affecting the clip boundaries commands, I
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);
newClip->SetOffset(c->GetEndTime());
Can anyone see a problem with this change? Using Git, the first of the
two lines was last changed by RA, which I presume is Richard Ash.
thanks,
David.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-05-04 17:34:51 UTC
Permalink
Post by Paul Licameli
Your proposed change makes sense to me. The simplification is welcome.
thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all
cases.

David.
Post by Paul Licameli
PRL
Post by Paul Licameli
There is a commit from ra dated 23 Jan 2010, before which, there is
nothing in our Git repository.
https://github.com/JamesCrook/audacity-from-svn-5GB.git
PRL
Post by David Bailes
In trying to sort of the problems with rounding errors in the start and
end times of clips which are affecting the clip boundaries commands, I
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);
newClip->SetOffset(c->GetEndTime());
Can anyone see a problem with this change? Using Git, the first of the
two lines was last changed by RA, which I presume is Richard Ash.
thanks,
David.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-05-04 17:47:00 UTC
Permalink
So the change is necessary but insufficient?

Be warned that I also intend to change SplitAt soon, because I am fixing
miscellaneous bugs in envelopes. Whichever of us commits second, may have
a conflict there, but it should not be a difficult one.

PRL
Post by David Bailes
Post by Paul Licameli
Your proposed change makes sense to me. The simplification is welcome.
thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all
cases.
David.
Post by Paul Licameli
PRL
Post by Paul Licameli
There is a commit from ra dated 23 Jan 2010, before which, there is
nothing in our Git repository.
https://github.com/JamesCrook/audacity-from-svn-5GB.git
PRL
Post by David Bailes
In trying to sort of the problems with rounding errors in the start and
end times of clips which are affecting the clip boundaries commands, I
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);
newClip->SetOffset(c->GetEndTime());
Can anyone see a problem with this change? Using Git, the first of the
two lines was last changed by RA, which I presume is Richard Ash.
thanks,
David.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-05-04 17:59:11 UTC
Permalink
Post by Paul Licameli
So the change is necessary but insufficient?
At the moment, I'm not sure if it's necessary.
Post by Paul Licameli
Be warned that I also intend to change SplitAt soon, because I am fixing
miscellaneous bugs in envelopes. Whichever of us commits second, may have
a conflict there, but it should not be a difficult one.
thanks for letting me know, but as you say, shouldn't be difficult,
David
Post by Paul Licameli
PRL
Post by David Bailes
Post by Paul Licameli
Your proposed change makes sense to me. The simplification is welcome.
thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all
cases.
David.
Post by Paul Licameli
PRL
Post by Paul Licameli
There is a commit from ra dated 23 Jan 2010, before which, there is
nothing in our Git repository.
https://github.com/JamesCrook/audacity-from-svn-5GB.git
PRL
Post by David Bailes
In trying to sort of the problems with rounding errors in the start
and end times of clips which are affecting the clip boundaries commands, I
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);
newClip->SetOffset(c->GetEndTime());
Can anyone see a problem with this change? Using Git, the first of the
two lines was last changed by RA, which I presume is Richard Ash.
thanks,
David.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...