Spectral selection labels

This read-only archive contains discussions from the Adding Feature forum.
New feature request may be posted to the Adding Feature forum.
Technical support is available via the Help forum.
steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectral selection labels

Post by steve » Sun Mar 06, 2016 10:02 pm

pshute wrote:I'd like a visual indication of the label limits, as it would be too slow to interpret the range as text while it's playing. Just a rectangle on the spectrogram would be good, without highlighting.
If the track is in a spectrogram view, why not just tab from one label to the next while it is playing? The only downside that I see is that because you are then in the label text you cannot use spacebar to stop playback without first pressing Enter (to close the label text).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

pshute
Posts: 181
Joined: Sat Feb 18, 2012 9:39 am
Operating System: Please select

Re: Spectral selection labels

Post by pshute » Sun Mar 06, 2016 10:45 pm

steve wrote:
pshute wrote:I'd like a visual indication of the label limits, as it would be too slow to interpret the range as text while it's playing. Just a rectangle on the spectrogram would be good, without highlighting.
If the track is in a spectrogram view, why not just tab from one label to the next while it is playing? The only downside that I see is that because you are then in the label text you cannot use spacebar to stop playback without first pressing Enter (to close the label text).
I think it might be a bit error prone and tedious.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectral selection labels

Post by steve » Mon Mar 07, 2016 1:09 pm

I guess the best solution would be to be able to select all labelled regions simultaneously, but given that Audacity does not yet support multiple time selections, that is not yet possible. The practicality of tabbing during playback depends on how many labels you have, how frequently they are placed, and the zoom level, but it works for me.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectral selection labels

Post by Gale Andrews » Mon Mar 07, 2016 6:09 pm

It looks like this is still a feature request, so moved to "Adding Features".


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

pshute
Posts: 181
Joined: Sat Feb 18, 2012 9:39 am
Operating System: Please select

Re: Spectral selection labels

Post by pshute » Mon Mar 07, 2016 8:43 pm

Gale Andrews wrote:It looks like this is still a feature request, so moved to "Adding Features".
Thanks for that. I wasn't hopeful that many other users would want this feature, but Steve's mention that his workaround "works for him" gives me some hope.

pshute
Posts: 181
Joined: Sat Feb 18, 2012 9:39 am
Operating System: Please select

Re: Spectral selection labels

Post by pshute » Mon Mar 07, 2016 10:14 pm

steve wrote:I guess the best solution would be to be able to select all labelled regions simultaneously, but given that Audacity does not yet support multiple time selections, that is not yet possible.
Have there been requests for multiple selections? Would that solution work? If you try to play the track when there are multiple selections, logically it should only play those selections.

Another idea is to highlight each region while that part of the track is played, but that would have to allow for regions that overlap in time.
The practicality of tabbing during playback depends on how many labels you have, how frequently they are placed, and the zoom level, but it works for me.
You use this method? What's the application, if you don't mind me asking? Mine is bioacoustics.

Another workaround idea. Duplicate the track, and somehow "erase" all parts of the spectrogram except the labelled regions, then mute that track and play the original. That would help the viewer see which parts of the spectrogram the labels refer to, because there'd be nothing else. But given that we can have multiple selections, let alone inverted selections, I'm not sure how easy it would be to achieve. Perhaps amplify each region in turn to increase the intensity of the spectrogram there, then reduce the level of the whole track to fade the background out? Could this be done with a script?

I assume scripts don't have commands that can simply draw on the spectrogram? Do the graphics for the currently displayed spectrogram get saved anywhere? Maybe I could modify it with image magick or something.

I'm also wondering if I can "draw" on the duplicated spectrogram by adding sounds in the right places - constant tones for horizontal lines, and short chirps for vertical lines. Initial tests indicate that this is easier said than done. I can make a vertical line for the full spectrum, but limiting them top and bottom is difficult, I assume because of the limitations of FFT. Horizontal lines work, but are very thick unless the window size is large, which is probably ok for me. Just having the horizontal lines would probably be enough for me. I assume I could generate them for each region with a script?

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectral selection labels

Post by Gale Andrews » Mon Mar 07, 2016 11:39 pm

pshute wrote:Duplicate the track, and somehow "erase" all parts of the spectrogram except the labelled regions, then mute that track and play the original. That would help the viewer see which parts of the spectrogram the labels refer to, because there'd be nothing else.
You can have only the labelled audio in a duplicate track or the original track.

Double-click in the label track to select all of it.

Edit > Labeled Audio > Copy.

Create a new track at Tracks > Add New. Then Paste. Or select all the original track then paste to overwrite it.

If the first label is not at time zero, click to place the cursor at the start of the first label before pasting.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

pshute
Posts: 181
Joined: Sat Feb 18, 2012 9:39 am
Operating System: Please select

Re: Spectral selection labels

Post by pshute » Tue Mar 08, 2016 1:03 am

Gale Andrews wrote:
pshute wrote:Duplicate the track, and somehow "erase" all parts of the spectrogram except the labelled regions, then mute that track and play the original. That would help the viewer see which parts of the spectrogram the labels refer to, because there'd be nothing else.
You can have only the labelled audio in a duplicate track or the original track.
Thanks, I think I knew that, but that speeds up the process. The idea was to also to "erase" the spectrogram above and below the copied selections, but of course it's impossible to have it make a clean horizontal edge on a spectrogram.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectral selection labels

Post by steve » Tue Mar 08, 2016 1:52 am

pshute wrote:Have there been requests for multiple selections?
I don't recall if it is logged on the Features Request page of the wiki, but I know that at least a couple of the developers are keen on the idea and there are many cases in which it would be very useful. If there is a repeating "event" in a recording that needs to be processed in the same way each time it occurs, it could be much quicker to select all of the events as a "multiple selection", and then apply the required effect(s) to that multiple selection, rather than having to do each occurrence one at a time.
pshute wrote:If you try to play the track when there are multiple selections, logically it should only play those selections.
Not necessarily. A "selection" is not the same as a "play region". For example, the "Cut Preview" command plays a bit of audio either side of the selection. Similarly you can "lock" the play region and make a selection that is independent of the play region (http://manual.audacityteam.org/o/man/ed ... lay_region). The "Selection" is the part of the track that effects and edit commands act on. "Usually" the play region is the same time period as the selection, but not always. The "play region" and the "selection" are different things.
pshute wrote:You use this method? What's the application
"Testing". I don't have an actual use case for this.
I do sometimes want to observe features in the spectrogram during playback, but generally I find that by adjusting the spectrogram settings I can make the features that I'm interested in clear enough that I don't need to label them. The Spectrogram Settings are also available via the track drop down menu. (Using the spectrogram settings effectively takes a bit of practice.)
pshute wrote:Duplicate the track, and somehow "erase" all parts of the spectrogram except the labelled regions, then mute that track and play the original
That could be done.

Gale described how to isolate the time regions.
To then isolate the frequency regions, you can use a bit of "Nyquist" magic.
"Nyquist" is a scripting language that is built into Audacity that can perform all manner of audio processing tasks. Scripts are written in plain text, and may either be made into plug-ins, or may be run in the Nyquist Prompt effect.

Assuming that you have labelled a region with an upper and lower frequency bound, you can highlight the region by clicking on the label text box, then run this short script in the Nyquist Prompt:

Code: Select all

(defun filter (sig lo hi)
  (dotimes (i  8 sig)
    (setf sig (highpass8 (lowpass8 sig hi) lo))))

(let ((lowHz (get '*selection* 'low-hz))
      (highHz (get '*selection* 'high-hz)))
  (filter *track* lowHz highHz))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Spectral selection labels

Post by Gale Andrews » Tue Mar 08, 2016 1:33 pm

steve wrote:To then isolate the frequency regions, you can use a bit of "Nyquist" magic.
Of course if the audio is white noise there is still some visible spectrum remaining outside the spectral selection. :)

There are a few feature requests for ability to select multiple regions, and more for selecting multiple labels, which I assume depends on the former.

Does pshute want to vote for selecting multiple labels or multiple regions now that Steve has explained we could play other than those regions?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Locked