Re: [Audacity-devel] Sample-level time accuracy
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Vaughan J. <va...@au...> - 2010-09-14 21:37:37
|
That's sure a lot of places to add QUANTIZED_TIME. Does it make sense to add class member vars in some cases, to also store the quantized values, rather than calculate repeatedly with QUANTIZED_TIME? For example, ViewInfo::sel0 and ViewInfo::quantizedSel0, AudioIO::mT1 and AudioIO::mQuantizedT1? Or is it better (clearer code and coding ease) to keep time values all as the real values and consistently convert? - Vaughan On 9/13/2010 5:25 PM, Martyn Shaw wrote: > > > On 13/09/2010 02:38, Al Dimond wrote: >> On Sunday, September 12, 2010 16:46:54 Martyn Shaw wrote: >>> Hi there >>> >>> I have recently been looking into sample-level accuracy of >>> envelopes, clips and the like, and made some progress, I feel. >>> Feel free to contradict me. >>> >> >> Thanks for working on this. I've liked what I've seen from your >> changes, though I haven't spent much time testing them. For what it's >> worth, I've read a lot of it, and it makes sense to me. > > Ta > >>> WaveClips have an offset as a double in the code, 8 dps in an AUP >>> file. Either way, not always a whole number of samples (especially >>> if you paste into a track at a different rate). And so everything >>> to do with copying/pasting/displaying/rendering WaveClips should >>> be using QUANTIZED_TIME at the appropriate 'rate'??? >>> >> >> Are we going to try to guarantee that a clip's offset falls "at" (very >> close to) a sample boundary for the track's sample rate? If so, then >> we could use QUANTIZED_TIME for all the operations and be pretty sure >> it was the right thing to do. > > So use QUANTIZED_TIME to round every t in every method that uses a > passed-in time in WaveTrack? And then the same for WaveClip? It > sounds like a plan, but is it reasonable? I'm thinking so. > > Scanning down WaveTrack.h that would be (first lines only): > > virtual void SetOffset (double o); > virtual bool Cut (double t0, double t1, Track **dest); > virtual bool Copy (double t0, double t1, Track **dest); > virtual bool Clear(double t0, double t1); > virtual bool Paste(double t0, Track *src); > virtual bool ClearAndPaste(double t0, double t1, > virtual bool Silence(double t0, double t1); > virtual bool InsertSilence(double t, double len); > virtual bool SplitAt(double t); > virtual bool Split( double t0, double t1 ); > virtual bool CutAndAddCutLine(double t0, double t1, Track **dest); > virtual bool ClearAndAddCutLine(double t0, double t1); > virtual bool SplitCut (double t0, double t1, Track **dest); > virtual bool SplitDelete(double t0, double t1); > virtual bool Join (double t0, double t1); > virtual bool Disjoin (double t0, double t1); > virtual bool Trim (double t0, double t1); > bool HandleClear(double t0, double t1, bool addCutLines, bool > virtual bool SyncLockAdjust(double oldT1, double newT1); > bool IsEmpty(double t0, double t1); > > and we perhaps have to take care with: > void GetEnvelopeValues(double *buffer, int bufferLen, > bool GetMinMax(float *min, float *max, > bool GetRMS(float *rms, double t0, double t1); > bool CanOffsetClip(WaveClip* clip, double amount, double > bool ExpandCutLine(double cutLinePosition, double* cutlineStart > bool RemoveCutLine(double cutLinePosition); > > Similarly in WaveClip: > > void SetOffset(double offset); > void Offset(double delta) { SetOffset(GetOffset() + delta); } > bool WithinClip(double t) const; > bool BeforeClip(double t) const; > bool AfterClip(double t) const; > bool CreateFromCopy(double t0, double t1, WaveClip* other); > bool GetWaveDisplay(float *min, float *max, float *rms,int* bl, > bool GetSpectrogram(float *buffer, sampleCount *where, > bool GetMinMax(float *min, float *max, double t0, double t1); > bool GetRMS(float *rms, double t0, double t1); > bool Clear(double t0, double t1); > bool ClearAndAddCutLine(double t0, double t1); > bool Paste(double t0, WaveClip* other); > bool InsertSilence(double t, double len); > bool FindCutLine(double cutLinePosition, > bool ExpandCutLine(double cutLinePosition); > bool RemoveCutLine(double cutLinePosition); > void OffsetCutLines(double t0, double len); > > I'm guessing that there shouldn't be other place to worry about this. > For example when a project gets read in it presumably uses these > methods to place tracks/clips into the project. Maybe in Effects? > > So what do you think? > TTFN > Martyn > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel > |