(I’ll use upper case for “L” - Nyquist is case insensitive anyway.)
The function (add-label …) , which is defined on line 49, returns a variable “L” which is a specially formatted list:
((int-or-float "string") (int-or-float "string") ... )
Note that this is a list of lists.
(int-or-float “string”) is a list with 2 elements.
The label list will be a list where each element is a list in the form (int-or-float “string”).
When a Nyquist script reaches the end, the final returned value is passed to Audacity.
If the value is a string or number, it is output to the primary display (screen).
If the value is a sound, it is output to the selected track.
If the value is a single channel sound and the track is a multi-channel (stereo) track, then the sound will be sent to all (both) channels.
If the value is a multi-channel sound and the track has less channels, an error is generated.
If the track contains channels with different sample rates (for example Left channel is 44.1 and right channel is 48 kHz), an error is generated.
If the value is a suitably formatted list, labels are generated. (if there is a label track selected the label(s) will be sent to the first label track. If there is no label track selected then a new label track is created).
Note that the format for labels has changed from 1.2.6 to 1.3.12
Audacity 1.2.6 requires the list to be in the form (where “number” is an integer or flonum)
((number "string") (number "string") ... )
Audacity 1.3.12 can either use that form (for point labels) or for “region” labels:
((number number "string") (number number "string") ... )
;If no silence markers were found, return a message
(if (null l)
(setq l "No silences found. Try reducing the silencenlevel and minimum silence duration.")
All that that code is doing is checking to see if “L” is still “NIL” (it was initialised to NIL in line 44).
If “L” is still NIL, then no label lists have been generated, so “L” is given a string value (the message) which Audacity then sends to the screen.
Sorry, I can’t help you with how Audacity captures the returned data from Nyquist, or how it then sends it to the appropriate place - that’s all in the Audacity code and I’ve no idea when it comes to C+.
I’ve hated the use of the l char in this script.
If you’re after votes for changing it, put me down for +L