What is the default value for "audioEvent.NormalizeGain"

Phil_P wrote on 2/12/2024, 11:03 PM

Hi there,

I recently finished a little script that has a section to normalize all events on a track.

I came across the extra setting below and could not make sense of it.

// Set normalization parameters
audioEvent.Normalize = true;

// This value can be adjusted
audioEvent.NormalizeGain = 0.0;

For example:

// Set normalization parameters
audioEvent.Normalize = true;

Will simply turn normalization on, which is the same as using the switches control in Vegas.

However, I tried various settings of this value and it didn't seem to behave as expected.

// This value can be adjusted
audioEvent.NormalizeGain = 0.0; 

I wonder if anyone knowns how to use this setting, i.e what is the default value of that when simply not using it?

I will experiment more; I should be able to figure this out really as sound engineering is really my main line of work, but I thought maybe someone who has already used this may have a clue.

 

Cheers,

 

P

Comments

zzzzzz9125 wrote on 2/13/2024, 5:05 AM

try this:

// This value can be adjusted
double i = 0.0;
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - i;

 

Last changed by zzzzzz9125 on 2/13/2024, 5:09 AM, changed a total of 2 times.

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

Phil_P wrote on 2/13/2024, 5:55 AM

try this:

// This value can be adjusted
double i = 0.0;
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - i;

 

Hi, thanks I am not seeing any difference between doing that and just doing what I already had:

I used this in my code as I already have double "i"
 

// Set normalization parameters
double ng = 0.0;
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - ng;
audioEvent.Normalize = true;


Previously it was just:
 

audioEvent.Normalize = true;

 

Ahh thinking about it I am guessing that 0.0 is just the same as def and can be adjusted further if required. I will keep at it thanks again.

Phil_P wrote on 2/13/2024, 6:20 AM

So I have added the variable to my settings file:
for example the value of "normalizationOffset" can be 3.0 or 10.0 etc.
 

Normalization=5.0
// Get the audio event AudioEvent audioEvent = (AudioEvent)trackEvent;
// Set normalization parameters
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - normalizationOffset;
audioEvent.Normalize = true;

But I am not seeing any difference when I change that figure.

Phil_P wrote on 2/13/2024, 7:01 AM

Ok the lines have to be in this order:
 

audioEvent.Normalize = true;
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - normalizationOffset;
marcinzm wrote on 6/19/2025, 7:29 AM

Hello,

@jetdv

@zzzzzz9125

@Phil_P

 

When I want to apply audioEvent.NormalizeGain my Vegas doesn't see such call NormalizeGain in audioEvent.

I have such libraries calls:
 

using System;
using ScriptPortal.Vegas;
using System.IO;
using System.Text;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
 

What am I missing?

If you are bored, drink water, you will want to pee. -> Albert Einstein - my idol!

I am 42. I have been creating videos since 2009 (the date when my first daughter was born in). My first video software was Pinnacle, next one was Sony Vegas 8 (I am not sure if remember it correctly). I am also a developer and wedding movie operator and editor. For example: I have created an Android app which let me control Vegas Pro rendering progress level on Android smartphone. I created it for fun, because I also love programming. I also created my own plugin for Audio To Text feature specified usage from Vegas Pro 19. I created proxy creation plugin which uses multiple GPU threads (maximum 3) to create proxy files for Vegas Pro. I also written many others plugin/softwares which enhance my video editing, also wedding editing.

Camera/video camera: Sony FX3, Sony A7 III, Sony FDR AX 100, Canon 5D Mark III, GoPro Hero Black 7,8,9,10

Lenses for Sony: Tamron 28-75mm F/2.8 Di III , Sony 24mm gm 1.4 FE, Sony 20 mm G FE 1.8

Lenses for Canon: Canon EF 24-70 mm F/2.8 L USM, Canon 70-200 f/2.8 L

Drone: DJI Mavic 3 & DJI Phantom 4 Pro v2.0

 

Editing: Vegas Pro 20 (365) with a lot of third party plugins, also my own plugins written in C#

 

PC:

CPU: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz   3.31 GHz

RAM: 128 GB

GPU: Nvidia RTX 2080 TI

storage: 4 SSD drives (including two M.2 flash drives) and two HDD drives

Windows system: 10 Home edition

marcinzm wrote on 6/19/2025, 7:44 AM

Ok. I missed

@jetdv

AudioEvent tt = (AudioEvent) track_event;

But unfortunately it doesn't satisfy my requirements.

I would like to set volume gain of track audio event to 0 dB Now I have -12.0 dB.

I can not find this in Vegas Pro Scripting documentation.

 

Can you help me?

 

If you are bored, drink water, you will want to pee. -> Albert Einstein - my idol!

I am 42. I have been creating videos since 2009 (the date when my first daughter was born in). My first video software was Pinnacle, next one was Sony Vegas 8 (I am not sure if remember it correctly). I am also a developer and wedding movie operator and editor. For example: I have created an Android app which let me control Vegas Pro rendering progress level on Android smartphone. I created it for fun, because I also love programming. I also created my own plugin for Audio To Text feature specified usage from Vegas Pro 19. I created proxy creation plugin which uses multiple GPU threads (maximum 3) to create proxy files for Vegas Pro. I also written many others plugin/softwares which enhance my video editing, also wedding editing.

Camera/video camera: Sony FX3, Sony A7 III, Sony FDR AX 100, Canon 5D Mark III, GoPro Hero Black 7,8,9,10

Lenses for Sony: Tamron 28-75mm F/2.8 Di III , Sony 24mm gm 1.4 FE, Sony 20 mm G FE 1.8

Lenses for Canon: Canon EF 24-70 mm F/2.8 L USM, Canon 70-200 f/2.8 L

Drone: DJI Mavic 3 & DJI Phantom 4 Pro v2.0

 

Editing: Vegas Pro 20 (365) with a lot of third party plugins, also my own plugins written in C#

 

PC:

CPU: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz   3.31 GHz

RAM: 128 GB

GPU: Nvidia RTX 2080 TI

storage: 4 SSD drives (including two M.2 flash drives) and two HDD drives

Windows system: 10 Home edition

zzzzzz9125 wrote on 6/19/2025, 8:26 AM

I would like to set volume gain of track audio event to 0 dB Now I have -12.0 dB.

I can not find this in Vegas Pro Scripting documentation.

@marcinzm What do you mean by "volume gain"?

The context in this thread is all about "normalize gain", which only works when you enable normalize for audio events.

So, you need to set normalize to true before setting the normalize gain, like:

Ok the lines have to be in this order:
 

audioEvent.Normalize = true;
audioEvent.NormalizeGain = audioEvent.RecalculateNorm() - normalizationOffset;

 

If you are referring to the gain of the event itself, you should access it like this:

trackEvent.FadeIn.Gain = yourValue;

Yeah it works for both video events and audio events.

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

marcinzm wrote on 6/19/2025, 9:08 AM

By volume gain I mean that audio event has such "white line", which you can set the audio volume loudness with.

0 db is 100% of volume loudness. 0 db is normal loudness when you add some of your clips to timeline.

-12 dB i approximetly 30% of volume loudness level.

I use Syncailia to synchronize audio clips, but it has such bad feature that after importing xml from Syncailia to Vegas Pro, the audio events has -12 dB for each ones, but I need to revert the loudness to normal so this normal is 0 dB. So I want make every audio event has default loudness which is 0 dB. I don`t want to set this manually for each audio event. I would like script to do this.

 

Last changed by marcinzm on 6/19/2025, 9:08 AM, changed a total of 1 times.

If you are bored, drink water, you will want to pee. -> Albert Einstein - my idol!

I am 42. I have been creating videos since 2009 (the date when my first daughter was born in). My first video software was Pinnacle, next one was Sony Vegas 8 (I am not sure if remember it correctly). I am also a developer and wedding movie operator and editor. For example: I have created an Android app which let me control Vegas Pro rendering progress level on Android smartphone. I created it for fun, because I also love programming. I also created my own plugin for Audio To Text feature specified usage from Vegas Pro 19. I created proxy creation plugin which uses multiple GPU threads (maximum 3) to create proxy files for Vegas Pro. I also written many others plugin/softwares which enhance my video editing, also wedding editing.

Camera/video camera: Sony FX3, Sony A7 III, Sony FDR AX 100, Canon 5D Mark III, GoPro Hero Black 7,8,9,10

Lenses for Sony: Tamron 28-75mm F/2.8 Di III , Sony 24mm gm 1.4 FE, Sony 20 mm G FE 1.8

Lenses for Canon: Canon EF 24-70 mm F/2.8 L USM, Canon 70-200 f/2.8 L

Drone: DJI Mavic 3 & DJI Phantom 4 Pro v2.0

 

Editing: Vegas Pro 20 (365) with a lot of third party plugins, also my own plugins written in C#

 

PC:

CPU: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz   3.31 GHz

RAM: 128 GB

GPU: Nvidia RTX 2080 TI

storage: 4 SSD drives (including two M.2 flash drives) and two HDD drives

Windows system: 10 Home edition

marcinzm wrote on 6/20/2025, 6:59 AM

It looks that this code helped me:

evnt.FadeIn.Gain = 1;
evnt.FadeOut.Gain = 1;
 

If you are bored, drink water, you will want to pee. -> Albert Einstein - my idol!

I am 42. I have been creating videos since 2009 (the date when my first daughter was born in). My first video software was Pinnacle, next one was Sony Vegas 8 (I am not sure if remember it correctly). I am also a developer and wedding movie operator and editor. For example: I have created an Android app which let me control Vegas Pro rendering progress level on Android smartphone. I created it for fun, because I also love programming. I also created my own plugin for Audio To Text feature specified usage from Vegas Pro 19. I created proxy creation plugin which uses multiple GPU threads (maximum 3) to create proxy files for Vegas Pro. I also written many others plugin/softwares which enhance my video editing, also wedding editing.

Camera/video camera: Sony FX3, Sony A7 III, Sony FDR AX 100, Canon 5D Mark III, GoPro Hero Black 7,8,9,10

Lenses for Sony: Tamron 28-75mm F/2.8 Di III , Sony 24mm gm 1.4 FE, Sony 20 mm G FE 1.8

Lenses for Canon: Canon EF 24-70 mm F/2.8 L USM, Canon 70-200 f/2.8 L

Drone: DJI Mavic 3 & DJI Phantom 4 Pro v2.0

 

Editing: Vegas Pro 20 (365) with a lot of third party plugins, also my own plugins written in C#

 

PC:

CPU: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz   3.31 GHz

RAM: 128 GB

GPU: Nvidia RTX 2080 TI

storage: 4 SSD drives (including two M.2 flash drives) and two HDD drives

Windows system: 10 Home edition

Iurii-Cojocari wrote on 6/21/2025, 4:57 AM

There is already a ready-made solution with sound amplification adjustment and everything is 1 click away.
https://www.vegascreativesoftware.info/us/forum/adjust-gain-on-selected-area--148899/#ca936584