audacity icon indicating copy to clipboard operation
audacity copied to clipboard

Scripting: Don't limit precision of values from GetInfo:

Open SteveDaulton opened this issue 3 years ago • 1 comments

Your idea

Currently, numeric values from GetInfo are rounded to a maximum of 4 decimal places.

While it may be convenient to limit the number of digits when displaying values from "Extra menu > Scriptables II > GetInfo", this (arbitrary) limitation prevents sample accurate editing via (mod-script-pipe) scripting or Nyquist.

This proposal is to return higher precision values when returned from Python / Nyquist scripting commands. Ideally double-precision floating-point format, or at least 32-bit float. (Nyquist uses 32-bit float, while Python's built-in float type has double precision).

Problem to be solved

  • Pasting audio clips based on GetInfo clip positions may cause the destination to overlap another clip due to rounding.
  • The first / last samples of a clip may be missed when applying an effect.
  • Label placements may be off by a few samples if based on GetInfo data.
  • And similar issues

Prior art

No response

Additional context

No response

SteveDaulton avatar Jan 22 '23 18:01 SteveDaulton

I came here from the Audacity Forum.

The limited precision for timing information from GetInfo makes it unsuitable for tasks that require sample accuracy.

This limitation to facilitate display of the values mixes information and its representation resulting in an unnecessary kludge.

I'd like to upvote this request. Also, if anyone knows of a workaround, I'd love to hear about it.

bwagner avatar Aug 22 '24 05:08 bwagner