Multiple choice board to create markers

Hello,

I participate in a hackaton to developp an application in order to automate birds calls recognition.
For the moment, we record birds, then we use Audacity to look spectrograms and analyse them.
When there’s something we recognize, we create a marker and name it, but it’s very long because we have to write everything everytime and records are often longs (8 hours) with a lot of things to note.

Something that could decrease our work-time would be to create a “multiple choice board” (as in Excel) that would appear when we create a marker => we click on a choice and it’s done. Is this possible ?

Regards,
Hervé

You could make a list of the commonly used label text in a text file, then copy and paste.
(If you use Linux, you can set the text document as the top window so that it doesn’t get hidden behind other windows).

“Ctrl + C” to copy
“Ctrl + B” to add a label (when stopped)
“Ctrl + V” to paste.

Thank you Steve,

I’ve thought about that, but i’m on Windows (pffff…), so the text file get always hidden…Copy+paste is longer than click…but you’re right : it’s better than type !
Could a “multiple choice board” for labels possible to be developped ?

Audacity is deliberately general purpose. This allows it to be useful for a huge range of applications. When additional tools are required for specific jobs or workflows, it’s better that they are added as plug-ins (rather than inflicting them on everyone :wink:)

I think it would be possible (fairly easy) to make a Nyquist plug-in with multiple choice labels, but the choices would need to be written into the plug-in code. What choices would you want?

Basicly, we need 4 choices (it’s french) :
-autre biophonie
-autre anthropophonie
-autre geophonie
-autre bizarrophonie
…but, i’m think i’m not able to create a plugin myself…could someone create it ? And, if we need to change a choice, is this difficult to do?

The easiest way (by far) to program this requires a slightly quirky way to use the effect. Both the audio track and the label track need to be selected, otherwise the plug-in will create a new label track every time.

If you only have one audio track and one label track, then:

  1. Click on the audio track where you want the label added
  2. “Down” cursor key
  3. “Enter”
  4. Run the plug-in.

If you have multiple label tracks then you may need to press the “Down” key multiple times to reach the label track.
I think it should be possible to automate these steps with a Macro if you can be bothered.

You will probably want to make a keyboard shortcut to the plug-in: https://manual.audacityteam.org/man/keyboard_preferences.html

To install Nyquist plug-in on Windows: https://manual.audacityteam.org/man/installing_effect_generator_and_analyzer_plug_ins_on_windows.html#nyquist_install
This plug-in will appear in the “Tools” menu when installed.

Here’s the plug-in:
AutreEtiquette.ny (603 Bytes)
Nyquist plug-ins may be edited in a plain text editor - for Windows I recommend NotePad++
(Do NOT attempt to edit Nyquist plug-ins in any word processor)


The plug-in code:

;nyquist plug-in
;version 4
;type generate tool
;name "Autre Etiquette"
;author "Steve Daulton"
;release 2.4.0
;copyright "Released under terms of the GNU General Public License version 2 or later"

;control id "Select label text" choice "biophonie,
                              anthropophonie,
                              geophonie,
                              bizarrophonie" 0

(setf label-list  (list "autre biophonie"
                        "autre anthropophonie"
                        "autre geophonie"
                        "autre bizarrophonie"))

(list (list 0 0 (nth id label-list)))

The lines starting with “;control” defines the multi-choice widget. The options are comma separated:
“biophonie,anthropophonie,geophonie,bizarrophonie”
The zero at the end (“0”) indicates that the default choice is first item in that list.

The lines starting with “(setf label-list” defines the label text strings. Each string is “quoted”.

The final line creates a label at the cursor position by selecting the nth item from the list “label-list”.

Oh, this seems to be a huge help! I’ll traduce, understand all your explenations, try this process…and i return back here to tell you what’s New !

Until this : thank you very much!
Hervé

Hello,
So, of course some pb appear…i’m not very “strong” with computer, sorry…

=> I’ve get your plugin, and have installated it. It appears in “Tools => add/delete plugin” and i’ve activated it.
=> but when i click on “effect”, the plugin doesn’t appear…

=> I’ve tried “Tools => “Console Nyquist” (sorry, i can’t traduce it…)”=> the screenshot attached here appears, but nothing’s going on…

=> Then I click on "debug’ in “console Nyquist” and the result is “biophonie found 0” and then :
error: unbound variable - ANTHROPOPHONIE
if continued: try evaluating symbol again
1> error: unbound variable - GEOPHONIE
if continued: try evaluating symbol again
2> error: unbound function - COMMA
if continued: try evaluating symbol again
3> " 0\n\n(setf label-list (list "
3> error: unbound variable - AUTRE
if continued: try evaluating symbol again
4> error: unbound variable - BIOPHONIE
if continued: try evaluating symbol again
5> "\n "
5> error: unbound variable - AUTRE
if continued: try evaluating symbol again
6> error: unbound variable - ANTHROPOPHONIE
if continued: try evaluating symbol again
7> "\n "
7> error: unbound variable - AUTRE
if continued: try evaluating symbol again
8> error: unbound variable - GEOPHONIE
if continued: try evaluating symbol again
9> "\n "
9> error: unbound variable - AUTRE
if continued: try evaluating symbol again
10> error: unbound variable - BIZARROPHONIE
if continued: try evaluating symbol again
11> error: unexpected EOF
Function: #<Subr-(null): #128ad3b0>
Arguments:
#<File-Stream: #12648990>
#"
12> 11> 10> 9> 8> 7> 6> 5> 4> 3> 2> 1>

There’s something i do wrong, sure, but what…?
Capture d'écran 2020-12-03 21.50.32.jpg

Which version of Audacity are you using?

It’s an old one on this computer, because recent version doesn’t run with its os (DLL problem i guess).
I didn’t tought about that.

Look in “Help menu > About Audacity”

I can probably modify the plug-in to work with an older version, but I need to know which version.

It’s the 2.3.3

Try this version:
AutreEtiquette.ny (510 Bytes)
The difference is that Audacity 2.3.3 requires the “;control” line to be all on one line like this:

;control id "Select label text" choice "biophonie,anthropophonie,geophonie,bizarrophonie" 0

That works ! Thank you very much ! With a shortcut, don’t need to type something, it’s cool.
Just a last setting: the label created by the plugin is placed at the beginning of the selection, but doesn’t go until the end of the selection. Is it possible to change that ?

Yes it is.
This version:
AutreEtiquette.ny (621 Bytes)
For your information, this is the new code:

(let ((start (get '*selection* 'start))
      (end (get '*selection* 'end)))
  (setf dur (- end start))
  (list (list 0 dur (nth id label-list))))

(get 'selection 'start) and (get 'selection 'end) get the start and end times of the selection.
dur (duration) is then the difference between end and start times of the selection.

The labels are relative to the start of the selection, so the created label has a start time of zero and an end time of “dur”.

Ok, that’s all right : thanks for all, i’ll try this! Thanks also for the training of my “school english”!

You wouldn’t understand my “school French” :mrgreen:

Hello,
An user find an issue to the plugin : when we select the sound we want to note, we also select the min/max frequencies. But in the labels-file which is extrated, the min/max frequencies do not appear.Is there something to change in the plugin ?

Do you mean the Spectral Selection?

Yes, that’s this. If i do a spectral selection and then type CTRL+B, the time (begining and end) and :blush: the freqency range of my selection appears in the file.txt of my label.
But if i do the spectral selection and then run the plugin, only time appears in the file.txt.