Easy way to put Selection Toolbar info into export filename?

Effects, Recipes, Interfacing with other software, etc.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by frew_frew » Tue Feb 07, 2017 8:02 pm

steve wrote:Try this:

Code: Select all
(setf decimal-places 3)

(defun format-time (sec)
(setf *float-format*
(format nil "%.~af" decimal-places))
(let* ((hh (truncate (/ sec 3600)))
(sec (- sec (* hh 3600)))
(mm (truncate (/ sec 60)))
(sec (- sec (* mm 60))))
(cond
((> hh 0)
(format nil "~ah:~am:~as" (dd hh) (dd mm) (dd sec)))
((> mm 0)
(format nil "~am:~as" (dd mm) (dd sec)))
(t
(format nil "~as" (dd sec))))))

(defun dd (n)
"pads n if required for double digit"
(if (< n 10)
(format nil "0~a" n)
n))

(let* ((start (get '*selection* 'start))
(end (get '*selection* 'end))
(content (format nil "~a ~a"
(format-time start)
(format-time end))))
(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! )
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames001.png
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames001.png (11.22 KiB) Viewed 643 times


I can easily get to something like this: ( Edit: with Export Multiple that is...noted for any others new to these things)
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames002.png
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames002.png (3.41 KiB) Viewed 643 times


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.

Thanks again,

frew
frew_frew
 
Posts: 31
Joined: Mon Jan 02, 2017 5:55 pm
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by Robert J. H. » Wed Feb 08, 2017 9:55 am

frew_frew wrote:
steve wrote:Try this:

Code: Select all
(setf decimal-places 3)

(defun format-time (sec)
(setf *float-format*
(format nil "%.~af" decimal-places))
(let* ((hh (truncate (/ sec 3600)))
(sec (- sec (* hh 3600)))
(mm (truncate (/ sec 60)))
(sec (- sec (* mm 60))))
(cond
((> hh 0)
(format nil "~ah:~am:~as" (dd hh) (dd mm) (dd sec)))
((> mm 0)
(format nil "~am:~as" (dd mm) (dd sec)))
(t
(format nil "~as" (dd sec))))))

(defun dd (n)
"pads n if required for double digit"
(if (< n 10)
(format nil "0~a" n)
n))

(let* ((start (get '*selection* 'start))
(end (get '*selection* 'end))
(content (format nil "~a ~a"
(format-time start)
(format-time end))))
(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! )
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames001.png


I can easily get to something like this: ( Edit: with Export Multiple that is...noted for any others new to these things)
Audacity_selection_start_end_times_label_names_to_export_multiple_filenames002.png


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.

Thanks again,

frew

By the way, you can also save a script in the Nyquist prompt as a preset, I give the keyboard shortcuts here:

Alt-m (manage)
s (save)
<enter the preset name> Return

and for loading
Alt-m
u (user presets)
select preset by any mean (mouse click, arrows, first letter) Return

The text is now loaded and you can press OK.
Robert J. H.
 
Posts: 1813
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 7

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by Gale Andrews » Wed Feb 08, 2017 2:06 pm

steve wrote:frew' requested (an) "Easy way to put Selection Toolbar info into export filename"

Frew gave a very detailed use case in the first post, then described a more general use case:
(for) "those creating lots of loop extracts from long recordings,
where a reference to the time position of the loop in the original recording
is placed directly into the filename of the exported loops."


I'm not sure that I'd described asking users to type, or even copy/paste thirty lines of code into the Nyquist Prompt, as an "easy way", though the code could be made into a plug-in, and that may suffice.

Actually I read all that before asking. I asked because you provided a solution and then moved it to Feature Requests and it will probably be me who has to decide what to do with the request.

Frew seems happy with your solution (thanks), so unless someone else votes for some aspect of the proposition I won't be adding this to the feature requests system.

I might suggest an improvement if it were possible, which is to run the code once after adding all the labels.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by steve » Wed Feb 08, 2017 3:47 pm

Gale Andrews wrote:I might suggest an improvement if it were possible, which is to run the code once after adding all the labels.

That's not currently possible with Nyquist as label tracks are not readable for plug-ins.

Gale Andrews wrote:I asked because you provided a solution and then moved it to Feature Requests

Yes, because I think it is a valid feature request.
If we consider that a "solution" posted on the forum is adequate response to a feature request, then I suspect that many of the features requested on the wiki can be removed.

Gale Andrews wrote:it will probably be me who has to decide what to do with the request.

I don't understand what needs to be "decided". Isn't it your policy to log and track feature requests?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by Gale Andrews » Wed Feb 08, 2017 5:03 pm

steve wrote:
Gale Andrews wrote:I might suggest an improvement if it were possible, which is to run the code once after adding all the labels.

That's not currently possible with Nyquist as label tracks are not readable for plug-ins.

OK, I now see it on Nyquist Wish List.

steve wrote:
Gale Andrews wrote:I asked because you provided a solution and then moved it to Feature Requests

Yes, because I think it is a valid feature request.

Usually if the original requester is satisfied by a solution, as here, we don't add the request to the system. unless they change the request or want a better solution.

It's vague as to what your preferred solution should be. All I see is a use case.

As I asked, should that solution only apply to export multiple?

You never yourself said that you supported this request, so I assumed you didn't. So if you don't give it a +1 and no-one else does, I would assume it now has no votes (because Frew is satisfied).

steve wrote:
Gale Andrews wrote:it will probably be me who has to decide what to do with the request.

I don't understand what needs to be "decided".

See above.

steve wrote:Isn't it your policy to log and track feature requests?

Yes if they have sufficient detail and it is clear that someone other than the original requester is now voting for it. There must be many ways the request could be met, such as by a multi-text clipboard. Normally we triage the requests here and end up with a focused request that has some implementation suggestions.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by steve » Wed Feb 08, 2017 6:09 pm

Gale Andrews wrote:because Frew is satisfied

frew is clearly in favour of the feature, and is satisfied because the feature is now available in their one personal copy of Audacity, but it's not available for anyone else unless they happen to stumble across this thread.

If we consider feature requests only in terms of usefulness to the individuals that make the requests, then is it really worth the time and effort? Even the "popular" requests have an insignificant number of votes as a percentage of all users. I don't see that a 0.0005% vote is a strong argument for doing something (especially as we don't record votes against). On the other hand, I do see value in having a record of the ideas that users put forward for improving Audacity.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by frew_frew » Wed Feb 08, 2017 7:26 pm

Robert J. H. wrote:By the way, you can also save a script in the Nyquist prompt as a preset


Robert, thanks for that reminder.
And thanks again for pointing in this Nyquist direction for this workflow optimization request.

frew
frew_frew
 
Posts: 31
Joined: Mon Jan 02, 2017 5:55 pm
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by Gale Andrews » Thu Feb 09, 2017 2:10 pm

steve wrote:
Gale Andrews wrote:because Frew is satisfied

frew is clearly in favour of the feature, and is satisfied because the feature is now available in their one personal copy of Audacity, but it's not available for anyone else unless they happen to stumble across this thread.

If we consider feature requests only in terms of usefulness to the individuals that make the requests, then is it really worth the time and effort? Even the "popular" requests have an insignificant number of votes as a percentage of all users. I don't see that a 0.0005% vote is a strong argument for doing something (especially as we don't record votes against). On the other hand, I do see value in having a record of the ideas that users put forward for improving Audacity.

Negative comments (reasons why a feature should not be implemented, or not implemented in the voted-for way) can be recorded (but not counted as negative votes) in a bullet point.

If you can see a good way with the current system to record negative votes (where we are sure the comment amounts to a negative vote) then please post it on the Talk page of Wiki Feature Requests. I suppose we could show something like "12 votes -2" but it is still meaningless without reading the comments.

What I am trying to get across is that Frew is presumably not now voting for this feature in a way that we can implement. Frew has not for example asked for a built-in effect to do what your plugin does.

You Steve have declined to vote for it.

So in terms of me transferring anything to Wiki Feature Requests there is nothing to transfer because there are no votes for it unless someone else votes for it before the month is out. This is how it usually works as far as I know. User asks for X and is then told they can do it with experimental plugin Y and then they don't vote for X. I think you have cautioned against assuming votes when someone is satisfied with a workaround.

Even if there were votes for this, there are no details of a desired implementation. That doesn't stop a vote being recorded if there were votes for it, but it isn't all that helpful to someone who might want to implement a formal solution.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by Gale Andrews » Thu Feb 09, 2017 2:31 pm

frew_frew wrote:thanks again for pointing in this Nyquist direction for this workflow optimization request.

Frew, do you want to "vote" for a built-in solution, so you don't have to use an optional piece of script? That script will be lost if you ever need to reset your pluginsettings.cfg file, even if you saved a preset.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26093
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Easy way to put Selection Toolbar info into export filen

Permanent link to this post Posted by steve » Thu Feb 09, 2017 2:56 pm

Gale Andrews wrote:If you can see a good way with the current system to record negative votes

We could write:

  • Feature short description: [votes +10 | -2]
    Long description ...
    Optional dev notes.
but if we are going to move over to a Q2A system then I don't think it's worth the time/effort to change the current system at this late stage.

Gale Andrews wrote:What I am trying to get across is that Frew is presumably not now voting for this feature in a way that we can implement.

My interest here now is more about procedure than the specific case. I would prefer to split this to a different topic, but it's become entangled, and frew's request is a good example to work with.

Shouldn't we still record this as +1 from frew?
  • Frew is clearly in favour of "the feature" because he's using it.
  • The requested feature has not been implemented in a way that is generally available to users (not a "closed" or "resolved" issue except for one specific user).

Gale Andrews wrote:Even if there were votes for this, there are no details of a desired implementation.

Implementation details are really a matter for the developer(s). Users / QA may or may not have clear ideas about how a feature should be implemented, but it's the developer(s) that have to implement it, and they have to work within what is possible, practical and safe.

I think where this is leading is: When is a feature request considered "done" / "implemented"?
You seem to be suggesting that frew's feature request should not be recorded because (for frew) the request has been satisfied (it's done). On the other hand, we still list the feature request "Stereo widener (2 votes)", even though it has been available in the Channel Mixer plug-in for years.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 44678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

PreviousNext

Return to Audio Processing



Who is online

Users browsing this forum: Bing [Bot] and 7 guests