Automating fade-in/fade-out of labeled tracks with Envelope

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Jan_Hartmann
Posts: 11
Joined: Tue Nov 23, 2010 10:15 am
Operating System: Please select

Automating fade-in/fade-out of labeled tracks with Envelope

Post by Jan_Hartmann » Thu Mar 10, 2011 4:46 pm

Is this possible with scripting? I create a Master track from several input tracks, and subdivide that in multiple labeled regions. With "export multiple" I then create WAV and MP3 files for CD and Web tracks. I want those tracks to automatically fade in at the beginning and fade out at the end, but *not* by processing the audio signal itself, but by adapting the envelope, so as not to destroy audio material. I have done that a few times by hand, but it is quite time consuming. Does anyone know a way to automate this? And if not, does there already exist a plugin to fade-in/out the original audio based on labeled regions?

Jan Hartmann
Amsterdam

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

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by steve » Thu Mar 10, 2011 6:32 pm

Unfortunately Nyquist does not have access to the envelope data (though it's already included on the "Nyquist wish list")
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jan_Hartmann
Posts: 11
Joined: Tue Nov 23, 2010 10:15 am
Operating System: Please select

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by Jan_Hartmann » Thu Mar 10, 2011 6:58 pm

Thanks Steve. Are there any plugins to do this on the audio data themselves: add fade-in and out on every labeled region?

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

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by steve » Fri Mar 11, 2011 2:30 am

The closest I can think of is to "Export Multiple" to create separate files for each labelled section, then use a batch script with SoX to apply a fade-in / fade-out to the file.

I don't have a pre-written scipt, but somewhere to start looking:
To find the length of a file:

Code: Select all

soxi -d <filename>
To apply a fade: http://www.linux.com/archive/feed/57897
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jan_Hartmann
Posts: 11
Joined: Tue Nov 23, 2010 10:15 am
Operating System: Please select

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by Jan_Hartmann » Fri Mar 11, 2011 5:00 pm

Ah, just what I was looking for. I didn't know Sox, but I already did an "Export Multiple" of the labeled tracks, and the fade-in -out was the most time-consuming part of the operation. Now I can add it without changing the original track. Thanks, Steve.

Jan

Jan_Hartmann
Posts: 11
Joined: Tue Nov 23, 2010 10:15 am
Operating System: Please select

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by Jan_Hartmann » Tue Mar 15, 2011 1:36 pm

Hi Steve, just another newbie question. I want to automate as much as possible the workflow: "create labeled regions" "export multiple" "add fades to each labeled track with sox". It's about the first step. It's easy to find the point where the music start and ends, but is it possible to write a script to extend automatically each region with two seconds at the beginning and two at the end? After that I can export all tracks and I know how to use sox to add fades to those two non-musical parts of the tracks. It is possible of course to do it by hand, but then I need to locate the first and last sound anyway and scroll back and forward two seconds. Takes a lot of time if you have to do it every time again

Thanks,

Jan Hartmann
Amsterdam

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

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by steve » Tue Mar 15, 2011 6:15 pm

Jan_Hartmann wrote: It's easy to find the point where the music start and ends, but is it possible to write a script to extend automatically each region with two seconds at the beginning and two at the end?
Do you mean an additional 2 seconds, or do you mean to set the labels 2 seconds before and after the music (no added silence - just using the silence that is already in the track?

If you mean the latter, then "Sound Finder" (Audacity 1.3.12) can already do that.
If you mean the former, then how long are the tracks that you are working on and how much RAM do you have in your computer?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jan_Hartmann
Posts: 11
Joined: Tue Nov 23, 2010 10:15 am
Operating System: Please select

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by Jan_Hartmann » Wed Mar 16, 2011 1:37 pm

Yes that's it, I need to add two seconds before and after the music starts, based on the material that is already there. Sound Finder does exactly what I want, and reasonably correct too. Thanks again Steve.

Two small comments on Sound Finder:
- Would it make sense to add a parameter "Minimum length of connected sound region" ?
- The sliders have quite a small range, e.g. 0.10-5 seconds for the interval between tracks. I need at least 10, and can set that in the text window, but the next time the value will be changed back to 5 again.

Anyway, my workflow now is:

- use Sound Finder to create labeled regions of the track's sound parts, plus a few seconds at the beginning and end of each part
- export each part to mp3 with export multiple
- use sox to create a fade in and fade out on the first and last two seconds of each mp3 file.

Saves me lots of time each Sunday with the recordings of our church choir.

Thanks again,

Jan

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

Re: Automating fade-in/fade-out of labeled tracks with Envel

Post by steve » Wed Mar 16, 2011 4:44 pm

Jan_Hartmann wrote:Yes that's it, I need to add two seconds before and after the music starts, based on the material that is already there.
This could be done with Nyquist, but it will be slow, and heavy on memory usage (not suitable for long tracks).
An alternative is to use SoX for this also.
There is a discussion here that I think will be very useful: http://forum.audacityteam.org/viewtopic ... 28&t=53637
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply