Suppose you’ve got a problem area in your audio.
Want to find a replacement.
Do Select/Store cursor position
Do Edit/Labels/Edit labels. Luckily you have labeled many positions of good quality segments.
Do ==> Search for a string to find the label marking the ‘good’ place. <= No can do currently.
Oh well, just scroll up and down, see if you can find it the hard way.
Do OK. The Label table vanishes.
Do spacebar. The cursor goes to the label you have picked. NICE FEATURE! And, the Labeled audio is played.
Select & copy the audio you want there.
Do Select/Cursor to stored cursor position. Adjust selection.
Paste as desired.
WONDERFUL! … except you can’t do the search. Not implemented.
But, you say, just Export the labels, and search in the new “Label track.txt” text file.
Yes, and then what?
You could copy the time stamp from that row, but then you can’t AFAIK paste
a time stamp into Audacity.
Searching for a string right in the “Edit labels” table would seem low-hanging fruit.
It would help me out a lot. Also happy to help with coding if necessary.
Thanks for your consideration.
I doubt that this is a problem for the majority of users as it is only really a problem for anyone that has a project with a vast number of named labels, but I do see the benefit of this feature request for those cases where a project does have a vast number of named labels.
One possible solution would be to write a Nyquist Macro (https://manual.audacityteam.org/man/nyquist_macros.html) to search for text in the labels and select the region / cursor position of the first label that contains the search string.
For exact matches only (where the full label text must be matched), this code should work:
This version supports partial matches. That is, if the search string is in the label, then a match is found.
Example:
Searching for “and” will be found in “Cat and Dog”.
It also has an option for case sensitive or case insensitive searching.
Thanks, Steve. This works nicely on 3.1.3. I keep some practice “recording” sessions squirreled away in .aup3 files (original in .WAV, annotated in .aup3). I can export the labels, and Windows can search the text files easily, which locates the correct .aup3 file(s) for me; the problem is then finding the label within a “forest” of annotations. This “plug-in” can help speed this search up for me.
One tiny issue. I am currently trying to do much of my work in 3.2 Alpha in hopes of spotting glitches that affect me before the real release.
When I run your program on 3.2 Alpha I get the following “Exception code 0xc00000005” crash in Audacity:
Operating system: Windows NT
10.0.19044
CPU: x86
GenuineIntel family 6 model 142 stepping 9
4 CPUs
GPU: UNKNOWN
Crash reason: EXCEPTION_ACCESS_VIOLATION_READ
Crash address: 0x1300002b
Process uptime: 33 seconds
I’ve uploaded an installable plug-in version to my blog here: https://audionyq.com/find-label-plug-in/
Fortunately this still seems to work in Audacity 3.2.0, but perhaps you (jademan) can check that it works for you too.
On Linux, Audacity 3.2.0 is not sufficiently stable or reliable for proper work. Hopefully this will improve before 3.2.0 is released, but for now I’m trying the latest alpha from time to time, report some bugs, then go back to an old version of Audacity for audio work. Fortunately Audacity 2.4.2 is still available on Linux and works well.
steve this is wonderful!
For me, the exact match version fits the bill.
That way if the first match doesn’t cut it (e.g. it doesn’t sound good enough),
I can edit the label (e.g. add “not this one”)
and find the next match.
Alternatively, if you use case sensitive search you could change the capitalization of the first (or any) character in the label that you want to skip.
or
You could modify the plug-in to give a choice of partial match or full match.
To do that, add the line:
;control match "Match" choice "Partial string,Whole string" 0
Note that when editing a Nyquist plug-in, it is essential that a “plain text” editor is used. For Windows I recommend NotePad++ (https://notepad-plus-plus.org/)
The next step is to paste in some audio (fix my wrong notes!?)
but then that creates clicks at the edges.
“Click removal” effect doesn’t work for me.
The “Repair” macro works well, but it’s tedious to select the two click spots,
or four if it was done to 2 tracks,
adjust the width (not too wide!) etc. over and over and over.
So, jumped into Nyquist programming finally.
Here’s my brand new plug-in that works wonderfully after
a pasting, or changing pitch or tempo or volume.
It works on exactly the tracks already selected,
so it can fix all four click spots in one step.
After installing with “Tools/Nyquist Plug-in Installer…”
I assigned a kbd shortcut. Exhiliarating.