I have a long track, and I’d like to take several dozen 2 short segments of it, around 2 seconds long, and place them into a new track, separated by some silence, say 0.5 seconds.
Method 1:
Select each segment one by one and press control+D to duplicate it into a new temporary track.
Merge the new tracks to a new one.
Delete the temporary tracks.
Delete the large silences between the segments, leaving just a second or so.
I don’t like the large number of temporary tracks this produces, and the merge operation takes a very long time for some reason. Perhaps the length (3 hours)?
Method 2:
Duplicate the whole track
Select the left then right boundaries of each desired segment, and press control+I to place a clip marker
Double clip between each segment and Delete
This method is way less messy, but now I have to insert the silences between clips.
Method 3:
Add a label track and add region labels for each desired segment
Export Multiple
Import every second exported track.
This sounds messy, but is at least repeatable, although I’m not sure I need it to be.
Can anyone think of a better way? I like method 2, but don’t know how to easily add the silences between segments. It would be nice If I could do a very short fade at the start and end of each segment too, but not essential.
Add labels to each 2 second section that you want to keep
Select the label track
Edit > Labelled Regions > Copy
Select the audio track
Ctrl+V (paste)
Delete the label track
Note that the labels must not be touching each other.
Unless my proposal is adopted, labels that touch will be treated as one region, so if you have, say 3 labels of 2 seconds each that touch, then it will be pasted at one region of 6 seconds duration. (feel free to comment on my proposal in the other thread)
I would never have thought of using Labelled Regions menu items, never knew it existed.
To make it work properly, I had to select the label track AND the audio track. Otherwise it was copying stuff from other audio tracks as well. This is obviously only necessary if there’s more than one audio track.
But now I’ve got to reduce the gaps down to one second. I’ve discovered I can use Effect/Truncate Silence to trim them down to a second.
This is a good way to do it, because it’s repeatable if I want to do it again. Thanks for your help.
Any suggestions for fading all the segments in and out?
Could you post one “typical” example of a sound section.
I have an idea how the fades can be done (almost) automatically using the “Auto Duck” effect, but it depends what the sounds are like.
Here you go, it’s just a few segments of a chirp, with the gaps reduced to 0.5s.
The trick here will be to get the control track right, won’t it? If I use a copy of the track I want to fade, I can get AutoDuck to fade it in the opposite directions to what I want. Do I need to have a control track with audio only in the gaps?
I then tried cutting the segments again, but this time pasting into a new track at the position of the start of the first label after doing an Edit/Labelled Regions/Copy. That gave me my segments still aligned with their original time positions.
Then I duplicated the original track and did an Edit/Labelled Regions/Cut, giving me a track with the bits between the desired segments. It might be more reliable to do this with a constant generated tone rather than the original track, in case of level variations?
Then AutoDuck with a -30db duck amount, and 0.2s outer fade lengths gave me the desired fades.
It would be easier to generate the segments track if there was a command like Edit/Labelled Regions/Duplicate. It’s a little fiddly having to paste into a special position, but it’s not something I’ll have to do that often, so it’s still going to save heaps of time.
Thanks for suggesting using this feature, and please tell me if you know of better ways to do it.
I’m a bit surprised there isn’t a plugin to just do the whole operation. Surely cutting and fading segments isn’t that uncommon?
Feel free to start a new topic about that.
I’m not sure exactly what you mean by “the whole operation” in a way that “isn’t uncommon” but if there’s a good case for a plug-in and Nyquist is capable of doing it then we can have a go at doing that
By “the whole operation” I mean that I could create the label regions, then a plugin could copy the labelled audio segments, fade them all in and out, then trim the gaps down to a specified size. I would have thought that was a reasonable common operation, but perhaps not. If someone is only pulling out a few segments then they probably wouldn’t mind doing it by hand, which is easy but tedious. It would only be useful to someone pulling out lots of them regularly, and then only if they want the segments in the one track.
I don’t think I’ll pursue it. I’ve got a reasonably easy method now. I might have a go at writing a plugin for it myself if it starts to annoy me too much. Thanks for your help.
Unfortunately plug-ins are not able to access label tracks.
Nyquist plug-ins can create labels, but can’t read them. The ability to read labels is a feature that I’d love to see in Nyquist plug-ins, but we don’t have that yet.
Is that ability a planned enhancement, or just an idea at the moment?
I guess then the plugin would require me to do the Labelled Regions Cut/Paste myself, then operate on the resulting track. I could probably base it on the Silence Marker or Sound Finder plugins, doing the fades and trims instead of inserting labels.
I’ve just noticed the Chain-it-up plugin, posted by Robert J. H. I wonder if my original approach of selecting the segments and duplicating them to new tracks could be used with that. It’s supposed to trim the silence and do the fade in/out before combining them into one track.
Currently there are no developers working on the Nyquist plug-in interface,
I don’t suppose you are a highly skilled C++ programmer by any chance?
Label tracks can be exported as text files.
Text can be input into a Nyquist plug-in, either be pasting into a text box (the easier method) or by the plug-in reading a text file (trickier).
Nyquist does not have access to the Audacity clipboard, but it is possible to copy audio from one track to another by temporarily holding the data in the SCRATCH symbol. There’s an example of this here: Running a plug-in once only - #7 by steve
It would be relatively easy to adapt this code to copy a selection from one track, apply a fade-in fade-out to the copied data and paste it into the next selected track.
Nyquist does not have access to the Audacity clipboard, but it is possible to copy audio from one track to another by temporarily holding the data in the SCRATCH symbol. There’s an example of this here: > Running a plug-in once only - #7 by steve
It would be relatively easy to adapt this code to copy a selection from one track, apply a fade-in fade-out to the copied data and paste it into the next selected track.
I just discovered one thing to be careful of with this method of using Labelled Regions/Copy and Paste to extract the segments. If there are any point labels in the label track, it goes a bit silly.
When it pastes, the segment corresponding to the region to the right of the point label gets pasted in at the point label instead. All the following segments get pasted in the same amount too far to the left. I’ve only tried it with one point label among the region labels, but I assume they get shuffled along even further for every extra point label there is.
In this example, I’ve copied it and pasted with three region labels, giving a correct result. Then I added point label z and copy/pasted into the bottom track. The segment b has lined up with point label z, and segment c is also too far left.
The answer in my case is to get rid of the point labels, but is this a bug? Shouldn’t point labels be ignored in this operation?
Yes, it’s a bug.
The problem is that for some of the actions such as “Labelled Regions > Split” we probably do want to include point labels.
I’ll raise this with the developers and see how they want to handle it.