Script to normalize only selected events

Post » Tue Jul 20, 2010 11:10 pm

I have the "normalize all" script and it's pretty cool, but what I really need is a "normalize selected" script to bring up the volume of clips with dialog. Is there one?
User avatar
adame
 
Posts: 489
Joined: Tue Aug 28, 2007 8:57 pm

Post » Tue Jul 20, 2010 10:00 pm

Here is that script, modified as you requested:
/**
* This script normalizes all Audio Events in the current project.
* This script works best if you run it after all event peaks have
* been built.
*
* Revision Date: Feb. 10, 2003
* Revised June 17, 2006 so script only affects selected events.
**/

import Sony.Vegas;

var trackEnum : Enumerator = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.IsAudio()) {
var eventEnum : Enumerator = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
var audioEvent : AudioEvent = AudioEvent(eventEnum.item());
var evnt = TrackEvent(eventEnum.item());
if (evnt.Selected) {
audioEvent.Normalize = true;
}
eventEnum.moveNext();
}
}
trackEnum.moveNext();
}


User avatar
WYatt REed
 
Posts: 528
Joined: Mon Jun 18, 2007 9:06 am

Post » Tue Jul 20, 2010 7:14 pm

That works great! Do you have any idea of what I've been going through to accomplish that? I've been loading the audio into Soundforge and normalizing from there. This is so much easier. Thanks!
User avatar
Taylah Illies
 
Posts: 535
Joined: Fri Feb 09, 2007 1:13 am

Post » Tue Jul 20, 2010 2:21 pm

This is so much easier. Thanks!

Glad to help. It was easy to do.

I may have some time in the next few weeks, as I wait for my nineteen cans of 16mm film that I've transferred to render to DVD. I have all sorts of ideas for scripts that are long overdue, and which I don't think anyone has done yet. I'll post here when they are finished.
User avatar
Star Dunkels Macmillan
 
Posts: 517
Joined: Thu Aug 31, 2006 10:00 am

Post » Tue Jul 20, 2010 3:09 pm

Message Deleted by User.
User avatar
Arrogant SId
 
Posts: 509
Joined: Sat May 19, 2007 5:39 am

Post » Tue Jul 20, 2010 9:09 pm

I looked here and at VASST and can't find the "normalize all events" (on the track) script. I could sure use it as I've been doing the same run around by going over to SF to "normalize" events on at a time then back onto the Vegas timeline.

If you could post a link or the script here at the forum I would be most grateful..

Thanks much,
Teaktart

p.s. How would I install the script above into my Script folder?
User avatar
CORY
 
Posts: 520
Joined: Sat Oct 13, 2007 3:54 pm

Post » Tue Jul 20, 2010 11:27 pm

copy the text above and paste it into Notepad.

Now save the file as something like "NormalizeSelected.js" in the following folder:
c:\program Files\Sony\Vegas 6.0\Script Menu
(or wherever you installed Vegas - put it in the Script Menu folder)
User avatar
Lawrence Armijo
 
Posts: 512
Joined: Thu Sep 27, 2007 1:12 pm

Post » Tue Jul 20, 2010 9:34 pm

> p.s. How would I install the script above into my Script folder?

There is a tutorial on the VASST web site called: Using Scripts in Sony Vegas Software which will probably answer a lot of your questions.

~jr
User avatar
Sunny Under
 
Posts: 504
Joined: Wed Apr 11, 2007 11:31 am

Post » Tue Jul 20, 2010 11:17 pm

Thanks so much for your advice.
I did as mentioned but is the original "normalize all..." in the posting above? Looks like it is the revised version which I copied to the Scripts Menu folder...
Would like the "all" script as well...

Thanks for the link to the write up on the VASST site, I'm printing it out right now.
You guys are great!

Teaktart
User avatar
T. tacks Rims
 
Posts: 505
Joined: Wed Oct 10, 2007 4:35 am

Post » Wed Jul 21, 2010 4:06 am

Here's the original "Normalize All"


/**
* This script normalizes all Audio Events in the current project.
* This script works best if you run it after all event peaks have
* been built.
*
* Revision Date: Feb. 10, 2003
**/

import SonicFoundry.Vegas;

var trackEnum : Enumerator = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.IsAudio()) {
var eventEnum : Enumerator = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
var audioEvent : AudioEvent = AudioEvent(eventEnum.item());
audioEvent.Normalize = true;
eventEnum.moveNext();
}
}
trackEnum.moveNext();
}



If you are using it in Vegas 5 or 6, the reference to "SonicFoundry" will need to be changed to "Sony".
User avatar
Ice Fire
 
Posts: 515
Joined: Thu Nov 15, 2007 9:27 pm


Return to Vegas Pro Forum