Increased Functionality of Generate Silence

One feature that would really benefit me is the ability to add silence (of differing durations) to multiple tracks all at the same time, all through a single interface.

Let me tell you what I would use it for so you can understand the functionality I’m asking for. I often make composite sounds out of different, individual sounds. A hi hat pattern out of 3-8 different hi hat samples, a keyboard/synth chord/riff out of different notes etc. So I’ll have multiple tracks in a single window, tracked in the order I want from top to bottom. Then I’ll use Generate Silence to advance each track by a specified amount. Sometimes it’s all by the same amount (say, a quarter note, or 500 ms in 120 bpm), so track 1 is 500 ms, track 2 is 1 second, track 3 is 1.5 seconds etc. But sometimes it’s widely varying, like 125 ms for track 1, then 250 ms for track 2, then 375 ms for track 3 etc. Then when they’re all in their appropriate positions, I Mix and Render. The results can be really fantastic, but let me tell you, it’s really slow going sometimes.

So what would be nice is if I could “tell” Audacity to do it all for me! Based on what I now know about Nyquist prompts, I think that would actually be ideal, because I think it would allow me to input data from Excel, so it would be completely customizable.

So it might work something like – Track 1, generate 250 ms silence starting at zero. Track 2, generate 125 ms silence starting at zero. Track 3, generate 500 ms silence starting at zero – you get the picture. That way I can have Excel do all the calculations for me in different cells, I concatenate into the proper Nyquist-friendly formatting, I throw that text into a Nyquist prompt (along with whatever other code I would need to add) and presto! All the silences are generated.

It would be nice if it could operate on a top down basis (top track = 1, second track = 2 etc). But if I had to input the track name into Excel to make it work, that would also be doable (though somewhat cumbersome as I’ll often have more than one of the same track in the window).

It also might be nice to have the option of changing the dB level of each track by the same method (inputting it from Excel). And maybe panning too (i.e. be able to inpit a +/- dB value for left and right channels). But I don’t want to get greedy.

Thanks for considering my request.

I think that you could achieve the same ends more easily than now using features that are already in Audacity.

  1. Labels may be created as a plain text file (possibly generated in Excel).
    The format for a label text file is:
    start-time end-time label-text
    where
    []“start-time” and “end-time” are in seconds.
    [
    ]“Label-text” is the text within the label.
    [*]Each label is on a new line
    Example:
1.0 2.5 one to 2.5
3.0 4.0 three to four

Here it is as a plain text file:
labels.txt (40 Bytes)
“File menu > Import > Labels” to import the labels.


2) Audio clips may be dragged using the Time Shift tool. When the edge of an audio clip lines up with either another audio clip, or with the boundary of a label, a yellow vertical “snap guide” appears, making precise positioning very easy.


If you find this functionality useful, you may also find this plugin useful: https://forum.audacityteam.org/t/beat-per-minute-labels/20785/1

Okay, I’ll give it a spin. It’s a definite improvement on what I’ve been doing. I have not actually tried importing labels yet as I ended up using a Nyquist prompt instead (which Robert J. H. kindly walked me through - https://forum.audacityteam.org/t/turn-multiple-clips-to-multiple-tracks/37288/1). I think I should be able to use that same method for this, which sounds like it might be faster than doing the actual import.

So, you’re right, this can be accomplished already. I’m guessing I can probably do 3-4 edits manually faster than I could do this, possibly even up to 8. But getting above 8, I think this would be a time saver. I’ll have to see how quick the process is.


A more general question – is it POSSIBLE to achieve this with Nyquist script? If so, how difficult would it be to write? Keep in mind, I know next to nothing about writing script. But I’m willing to learn as long as the learning curve isn’t impossibly high. The code that I’ve seen so far seems fairly easy to grasp, but I’m sure it gets a lot more complicated for more involved operations (like what I describe above and below for being able to modulate the dB levels, panning etc.). So I would just need to learn the step-by-step logic. I’ve never learned any computer languages, but this seems like a good time to try, because I think the effort could prove to be worth it.

I swear I’m not trying to bore you with details, but let me just lay out a typical process for me, and if you could comment on how much of this could be automated by using Nyquist, that would be awesome. Keep in mind, I’m not necessarily looking to try to put this entire process all in one single Nyquist prompt/plugin. Some if the steps simply HAVE to be done by me, because they involve “artistic” decisions that you just can’t teach a computer to make (like, which vertical track order). But to the extent that they CAN be programmed, I would love to learn how. That would make my workflows sooooo much faster, which means more music created per session. And I like that.

I indicated with a question mark those steps that I think it might be possible to automate through code writing code, either all integrated into one step, or handful of different steps/codes.

?***if needed, use ReNamer software to give sound files names that are easier to work with
***load sounds
?***delete any silence from front, if necessary
?***normalize each sound (default to Normalize stereo channels independently), setting each track to desired dB level
?***adjust length(s) of clips
***perform any needed fades
***Auto-Zero (if needed)
***duplicate sounds, if needed, and arrange them vertically in the needed order (?possibly by changing track names and sort function?), and perform any further dB adjustments, add panning effects
***calculate timings with Excel
***generate silence on each track OR import labels / do Nyquist prompt labels / Time Shift Tool – snap each track to label borders
***Mix and Render

I know this probably sounds like a hugely cumbersome workflow, but I’ve actually gotten pretty fast at it, especially since I now use keyboard commands for 90% of it. There are just certain sticking points where I can’t seem to get any faster, where automating it through code seems to be about the only viable way to appreciably speed things up. And I can set pretty much all of these values in Excel very quickly (in a lot of cases I have them autocalculate, or use drag down features). Ideally, I would LOVE to be able to set the following values in Excel for each track, with each channel being set/changed independently: start time, end time, panning, adjustable fade, dB level (either as a dBFS value, or being a +/- value relative to the starting dB level of the given track).

So, how realistic is any of this? Am I dreaming? Or could I use Nyquist to do a lot of these things automatically? I’m totally open to adjusting my workflow (specifically the order of operations) to accommodate new strategies facilitated by automation.

Thanks.

Writing a Nyquist script to produce labels is easy.

Nyquist is a computer language (based on a language called LISP).
The way that Nyquist works in Audacity is that Audacity can pass certain types of data (including selected track audio) to Nyquist. The Nyquist code runs and the “return value” (the “result”) is passed back to Audacity.
If the return value is text or a number, then Audacity will display it in a message box.
If the return value is audio, Audacity will try to put it into the selected audio track (Note-1: Audacity cannot put stereo audio into a mono track. Note-2: for “Generate” type plugins, there does not usually need to be a track selected - Audacity will automatically create a mono audio track if no track is selected).
If the return value is a specially formatted list, then Audacity will create labels.

The necessary format to create labels from Nyquist is similar to the text format described in my previous post.
Try this (based on the previous example) using the Nyquist Prompt effect:

(list
  (list 1.0 2.5 "one to 2.5")
  (list 3.0 4.0 "three to four"))

See that we have a list of lists. Each of the “inner” lists represents one label and is in the form: number, number, quoted-string.

One of the main limitations of Nyquist plugins is that there is not much flexibility in GUI design. Basically you have one window with a choice of three types of input “widgets”. See: Missing features - Audacity Support
Fortunately the “Text Input Widget”, although of a fixed and fairly small size, can accept large amounts of text, so you can copy and paste long lists of data into a text input widget.

Your original idea of generating specified amounts of silence would be quite tricky in Audacity 2.0.6, but will be quite straightforward in Audacity 2.1 when it is released.
If you are still interested in trying this after 2.1 is released, I’d suggest starting a new topic (here: New Plug-Ins - Audacity Forum) once you have Audacity 2.1 installed.

Ohh, definitely. These are all sub-workflows that are VERY integral to my overall workflow, so my need for automated solutions will not go away.

I think what would be really helpful is some kind of “simple, getting harder” approach to this. Is there a resource like that?

Specifically, I mean something like this – the code for labels looks pretty easy, and I can actually understand what’s going on with it. I would like to see one for audio (and the other widget types) that is at a similar level of complexity. Then I could look at one that is more complicated by one “level.” I’ll take a look at that and see how that works. Then I can start testing it, changing parameters, seeing if it does to the audio what I would expect based on what I changed. Once I’m comfortable with that, then bump it up one more level of complexity. Do you know of any resource that is like that? Kind of a “walk before you can run” sort of approach. I would really like to be able to self-serve this stuff, but I find it really daunting to just jump in the deep end. I need some low hanging fruit to get me going. Sorry for mixing so many metaphors.

Thanks for your help

Hey, don’t complain - when I started with this there was the Nyquist manual and not much else :wink: :smiley:

Getting started with Nyquist:
Do you have a good “plain text” editor? For Windows I would recommend Notepad++ (http://notepad-plus-plus.org/)
Get that installed and find out how to enable “parentheses matching” and how to set “syntax highlighting” to “LISP”.

Have a skim-read through this page to get an overview of how plugins are written: Missing features - Audacity Support

Have a look at some of the small .ny files in your plug-ins folder, such as notch.ny and lowpass.ny.
See if you can follow what it is doing and how it works.
Try making minor modifications to them and see if you get the results that you expect.

There are also a few examples on this page (but this page is incomplete) Missing features - Audacity Support

The main references that you will need are:

http://www.cs.cmu.edu/~rbd/doc/nyquist/indx.html
http://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/xlisp/xlisp-index.htm
Bookmark those pages and refer to them often.

Feel free to ask questions in the “Nyquist” section of the forum.

Awesome! Thanks so much, Steve. I’m going to give it a shot.