New Plug-in: Label Gunn


The issue you are referring to is an inaccuracy due to the slider precision being different to the text display precision.
This was fixed about a year ago and is not an issue in the current version of Audacity.

The recommended version of Audacity for Windows Vista is Audacity 1.3.12.
Audacity 1.2.6 is ancient and has many known bugs, particularly on modern hardware and operating systems. There is no development work being done on the old 1.2.x series, so bugs will not be fixed.

You can do that with:

(setf x1 (format nil "~a" 0.123456))

x1 is then a string value and will be evaluated if not quoted in the list.

To demonstrate the principal, here’s a simple plug-in that allows you to input one label and give it a numerical name. It is a “version 1” plug-in so it is fully compatible with Audacity 1.2.6

;nyquist plug-in
;version 1
;type analyze
;categories ""
;name "Number Label"
;action "Creating Labels"
;info "Label Text from number input. GPL v.2.nBy Steve Daulton. http://easyspacepro.comnnDemonstration of how to enable user selected numbers to be usednas label text in Audacity 1.2.x (version 1 plug-ins).nnNumbers outside of the slider range can be typed, but you must thennavoid clicking on the sliders.n"

;control pos "Position" real "seconds" 10 0 100
;control numtxt "Text" real "numbers only" 0 0 1

(if (< pos 0)(setq pos 0)) ; label position must be >= 0

;; make number into a string
(setq string (format nil "~a" numtxt))

;; create label
(list (list pos string))

(Note: when copying code from the forum, do not use the “select all” link as it inserts spaces at the beginning of each line. Just select the code with your mouse then copy and paste into a text editor.)
As with your plug-in, label positions are after the cursor position, (or after the beginning of the selection if a selection exists).
The number is printed in the shortest form as this is the default format in Nyquist, so entering 0.123000 as the label text will be printed as 0.123

If you want to input alphabet characters, then one way you could do it is to enter their ascii code number, then convert that into a character.

In Audacity 1.3.12 there is no need for any of this as 1.3.12 provides a text input control which returns string values, so with a “version 3” plug-in you could do something like:

;nyquist plug-in
;version 3
;type analyze
;categories ""
;name "Add Label"
;action "Creating Labels"
;info "Add Label with Text from user input. GPL v.2.nBy Steve Daulton. http://easyspacepro.comnnDemonstration of how to create text labels in Audacity 1.3 (version 3 plug-ins).nnLabel position is the time after the start of the selection (in seconds).nFor 'Point Markers' the 'End Position' is ignored.nBackslash is not a valid character.nFor cross-platform compatibility with Export Multiple, use alphanumeric characters.n"

;control type "Select Label Type" choice "Point Marker,Region Label" 1
;control labeltxt "Enter Text for Label" string "(case sensitive)" "Example 1"
;control spos "Start Position" real "seconds" 10 0 100
;control epos "End Position" real "seconds" 20 0 100

;; negative marker positions are not allowed.
(setq spos (abs spos))
(setq epos (abs epos))

;; For region labels, ensure start of label is before end of label
;; Make label
(setq label (if (= type 0)
  (list spos labeltxt) ; point marker
  (list (min spos epos)(max spos epos) labeltxt))) ; region label

;; create label track
(list label)

As a version 3 plug-in, this requires Audacity 1.3.x

While an interesting exercise, the practicality is rather undermined as Audacity 1.3.12 already has a label manager built in.