Updated "Export Clips" plug-in

I’ve received a number of requests for an update to my Export Clips plug-in. The specific feature being requested, is for it to use the names of the clips for the exported files. Until recently this was not possible because the clip names were not available to Nyquist, however they are now.

Before downloading this plug-in, be sure to read the warnings below.

  • The new “Use clip names” is set to “No” by default. This will export each clip as “clip1”, “clip2”, “clip3” …
  • When set to “Yes”, it will use the clip’s name as the exported file name.

ExportClips.ny (2.1 KB)

WARNINGS

  1. This plug-in has only been tested on Audacity 3.7.3 on Linux. It “may” work on slightly older versions, do let me know if it does. It should work on Windows and macOS exactly the same as Linux.

  2. On older versions of Audacity, attempting to use the new “Use clip names” option will cause all of the exported clips to be named “nil”, and they will overwrite each other, leaving only the final exported clip, which will be named “nil”.

  3. If 2 or more clips have the same name, they will be overwritten by later clips with the same name.

1 Like

Steve,

I just ran into the problem your plugin solves. I’ve tried it with two .aup3 project files, one with 3 named clips, and one with 14. It is exporting with clip names, but the names do not match the ones in the project.

In the project with 3 clips, all names are exported but audio of the shortest of the three is not exported.

  1. Exported audio with the name of the first and shortest clip is actually from 3rd clip.
  2. Exported audio with the name of the second medium length clip is actually audio from 3rd clip.
  3. Exported audio with the name of the third and longest clip is actually audio from the 2nd clip.

In the project with the 14 clips, all the names are exported, but the audio files don’t match the names. When I exported both ogg and mp3 formats, it looks like the name and audio in each format matches, albeit jumbled up from the clip names in the project.

I’m using Audacity 3.7.7

Are you still working with or supporting your plugin?

Have you gotten other feedback similar to this?

Thanks for taking a look at this.

Skip

Hi Skip,

There have been so many breakages in Audacity’s Nyquist support that I’ve given up trying to maintain my plug-ins. I no longer know what works and what doesn’t.

I’m hoping that Nyquist support in Audacity 4 will be more stable, and if it is I’ll look towards updating useful plug-ns.

Hi Steve,

Thanks for letting me know.
I totally understand. I’ve been developing software for years in the Oracle space, and I know the headaches when the underlying tech stack changes. Fortunately, w/ my software, there’s a revenue stream =;-)

BTW - exporting named audio clips should really be part of Audacity. Or at least it should make it easier to align labels with clips.

Skip

The ordering of the list of audio clips passed to a Nyquist script is determined by the order in which the clips were created, not their starting timestamps.

For instance, if you split a track into 3 parts A, B, and C, but perform the splits from right to left, the default export ordering will be (A, C, B) since the first split created A and C, while the second split created B from the front of C. The list passed to the ExportClips script will be:

(((TRACK 0) (START 0) (END 17.3963) (COLOR 0) (NAME "A"))
 ((TRACK 0) (START 38.7992) (END 61.9857) (COLOR 0) (NAME "C"))
 ((TRACK 0) (START 17.3963) (END 38.7992) (COLOR 0) (NAME "B")))

To ensure the export order matches the starting timestamps of the audio clips you must sort the clips by the START value before the export-clips function is called.

Here is a patched version of Steve’s updated script which:

  1. sorts the list of clips by the starting time
  2. changes the file naming pattern so the clip index is placed first and separated by a dash

The exported names in the above case would be 1-A.wav, 2-B.wav, and 3-C.wav.

Thanks to Steve for this very useful script!

ExportClips.ny (2.2 KB)