audacity / audacity/audacity

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

Open
#4,220 1 comment 0 reactions 0 assignees View on GitHub
Enhancement Request macros / scripting
Dominant language
C++
Stars
18.4k
Forks
2.7k
Avg merge
3d 3h
Merged PRs (30d)
85

Description

### 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_

Contributor guide

Open the contributing guide

Research direction

Start at the GetInfo entry point used by mod-script-pipe, Python, and Nyquist scripting; the issue does not identify a source file or test. Trace where numeric values are rounded and determine how scripting responses are formatted. Done means scripting clients receive sufficient precision to preserve sample-accurate clip positions, effects, and label placements.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.