steve wrote:Try this:
Code: Select all
(setf decimal-places 3)
(defun format-time (sec)
(format nil "%.~af" decimal-places))
(let* ((hh (truncate (/ sec 3600)))
(sec (- sec (* hh 3600)))
(mm (truncate (/ sec 60)))
(sec (- sec (* mm 60))))
((> hh 0)
(format nil "~ah:~am:~as" (dd hh) (dd mm) (dd sec)))
((> mm 0)
(format nil "~am:~as" (dd mm) (dd sec)))
(format nil "~as" (dd sec))))))
(defun dd (n)
"pads n if required for double digit"
(if (< n 10)
(format nil "0~a" n)
(let* ((start (get '*selection* 'start))
(end (get '*selection* 'end))
(content (format nil "~a ~a"
(list (list 0 (get-duration 1) content)))
Thank you very much Steve !
This works wonderfully.
So now when I have something like this: ( EDIT: that is, now it is so easy to produce this these kinds of exacting labels! ) I can easily get to something like this: ( Edit: with Export Multiple that is...noted for any others new to these things) This is so easy to do now in Audacity.
It's amazing really.
At the Nyquist Prompt I just pasted in your code, then did Save as a .ny file,
so now whenever I need it, I just load that .ny file into the Nyquist Prompt.
Thankfully the Nyquist prompt remembers the script even between opening and closing
various projects...perhaps even indefinitely...until other code is put into the prompt.
Often my workflow, when creating many loop extracts from a longer recording, does not
entail using various effects, so once I "Okay" the prompt for the first time after opening
a project, the Ctrl+R works nicely to keep going with Effect> Repeat Last Effect.
I would imagine many other Audacity users will find this Audacity capability to be very exciting,
very useful, and very time saving in their workflow.
This is very helpful indeed.