turn multiple clips to multiple tracks

I’ve been trying to read the manual to figure out how to do this, but I’m finding it confusing. Let me tell you what I’m trying to accomplish, and hopefully someone can tell me the most elegant way to go about it.

I can use a softsynth plugin to output different notes of a synthesizer. I’ll often use this to generate the notes of a chord which I’ll then arrange in Audacity into complex arpeggiations. The output file is a single wav file, and if I put the notes far enough apart, there will be absolute silence between notes. So I think I should be able to use the “Detach at Silences” tool to bust up this long wav into individual notes (C, D#, G etc). Ultimately, I would like to be able to have each of these notes/clips have a label added to it. What is the best way to do that automatically?

Once I have labels added to each individual note, I would go into “Edit all labels” and add the note names. From there (and this is where I’m getting stuck) I would like to take all of those clips and turn them into individual tracks. From there I would want to “Export Multiple” all of these individual tracks/notes (all of them accurately named) to a subfolder.

Related question – what is the naming convention when you use “Export Multiple?” Will all the tracks keep their individual track names? Or does it append added date/time info to the file names? If it does, is there a way to turn that off so that I can keep JUST the original track name?

Much thanks in advance for any guidance you can give me. If I can figure out a nice, smooth, fast process to accomplish this task, it will be a HUGE boon to my overall productivity in music-making.

Unfortunately, your request is a bit to early…
It can’t be done yet.
However, if you use a current alpha build (or wait three weeks for 2.1.0), then the task is fairly easy.

The following code snippet will label the clips in the track, starting with the track name and a unique number.

(setf *integer-format* "000%ld")
(psetq label-text (get '*track* 'name)
       counter -1) 
  #'(lambda (clip) 
     (append clip (list (format nil "~a ~a" label-text (incf counter))))) 
  (get '*track* 'clips))

Again, it works only with 2.1.0 (alpha) and if the (new) check box in the nyquist prompt is not set.

Export multiple works with labels alone, the audio has not to be re-arranged in separate tracks.

That’s fine, waiting a few weeks is no big deal.

When you say “the track” do you mean a single track that is separated into clips, with silence between? Is that how it works?

Alternatively, I just realized that Audacity already has an option to import labels. That’s even better! If I use this feature to “tell” Audacity where to create track breaks, and how to label them, will it them output them as individual tracks, labeled how I want, if I do “Export Multiple?” That would actually be ideal!

Are these clips in one Audacity track? If so I’m not sure why you can’t use Analyze > Sound Finder… now. You’ll get region labels 1, 2, 3… instead of region labels 0000, 0001, 0002 … with Robert’s Nyquist Prompt code.

See Export Multiple in the Manual. It does not append date/time, it uses the label names “as is” by default if you tell it to export by labels. Don’t you want to export using the note name you added to the label as the file name?

Just to clarify, Export Multiple can be set to export based on Audacity tracks stacked one above the other, where the exported files take the names of the Audacity tracks.



But one thing I realized is that the spaces between notes is not actually absolute silence (it just looks like it is). And I think your Sound Finder suggestion might workj pretty well if I was dealing with a recording. In this case, I think “Import Labels” is my best bet for naming the different clips/notes. I’ll just match up the times in the import labels txt doc with the note onsets using Excel to autocalculate it all. That will be very doable since the synth plugin output wav file will be VERY precisely timed, as it’s being generated by a sequencer that I know has very precise timing.

So I think this is actually the solution to my problem. I just wasn’t aware of these other things when I asked the question. I’ll test it tonight and let you all know how it goes.

Thanks for the help!

Yes, there’s ideally one track only.
The code does not rely on silences but the split lines of the clips.
Thus, the clip boundaries can as well be in the middle of a tone.
Detach at silences is certainly a good preliminary step.
If you have more than one track, they have to be arranged in time (i.e. align end to end).

Alternatively, I just realized that Audacity already has an option to import labels. That’s even better! If I use this feature to “tell” Audacity where to create track breaks, and how to label them, will it them output them as individual tracks, labeled how I want, if I do “Export Multiple?” That would actually be ideal!

Where do you’ll get those times from?
This seems to me rather cumbersome.

You can also use the regular interval labels, especially if you’re dealing with exactly timed notes.

That could work in a lot of cases, too. I think it depends on my plans for how I’m going to use the notes/samples. If it’s going to be very ad hoc, just a one time affair, I don’t really need them to be labeled at all. I just would want a way to get them all busted up into separate tracks at the note onsets - huge time saver. So regular interval labels woudl work well. But if I plan to use them down the line, having them accurately named with the notes would be good, so in those cases I think importing labels(generated in Excel, converted to txt) would be the way to go. Importing labels would also work really well if I was going to make sample sets that would be named to be compatible with sample players like Kontakt.

Thanks for the input.

It’s probably easiest to just copy the columns from the excel sheet, without exporting/importing.

You could do the following:

Supposedly, the start time is in column A, the end time (optional) in Column B and the text in column C:
formula d1 could be =“(”&A1&" “&B1&” “&ZEICHEN(34)&C1&ZEICHEN(34)&”)"
(zeichen would probably be char for English versions)

  • Copy the formula down in D.
  • copy the column (up to the last entry) and paste it into the nyquist prompt.
    You’ll now have to add

at the very beginning and


at the very end
pressing Ok inserts the new label track.

Ok, I’ll try it!

But are you saying I should paste all that into a blank Nyquist prompt? Or is there a Nyquist prompt that is accessed through the import labels interface?

The blank Nyquist Prompt.

BTW You can of course always insert a manual label by pressing Ctrl-b (for regions) or Ctrl-m.
It’s just a question of getting used too after e.g. pasting a clip or shifting it around, in other words, always when a part of interest (a note) is selected.

I tried, but got an error:

This is the code I entered:

'((0  "Elktro-C5")
(8  "Elktro-D5")
(16  "Elktro-E5")
(24  "Elktro-F5")
(32  "Elktro-G5")
(40  "Elktro-A5"))

What error?
Press debug instead of ok and copy the output into your next post.

The code works on my system as expected, a label track with 6 point labels has been created.

"Your code looks like SAL syntax. " Then it says to use a return statement for SAL, or for open parenthesis for LISP.

Sorry, wouldn’t allow me to copy,or choose debug after running the script.

I see, my fault.
It worked for me because there was some code before this list and so it was automatically interpreted as Lisp code.
Just at a pair of empty parenthesis before the apostrophe:

()'((0 ...

I know, it’s somewhat weird, but it works.

Awesome, now it works!

Thanks, this will be a huge time saver for me.