Old 08-25-2016, 10:34 PM   #1
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 472
Default get take volume and apply to item gain?

Would it be possible in script to get the take volume/gain of an item (the volume shown in media item properties) and apply that to the item gain (red horizontal line displayed on an item, gain adjustment separate from take volume), and then reset the take volume to 0dB?

I have an issue where I am doing RMS detection and normalization for clips, but instead of the normalization being applied to the take volume, I need it to be applied to the item gain.

If anyone has any idea how to do this, or if this can even be done, please let me know. It would be a HUGE timesaver, as I am now currently manually adjusting item gain for hundreds of items to match the take volume after RMS normalizing, then resetting take volumes for the items.

Thank you for any helpful assistance anyone can provide!
earhax is offline   Reply With Quote
Old 10-04-2016, 10:37 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Indeed,
Code:
 reaper.GetMediaItemTakeInfo_Value( take, parmname )
can have "D_VOL" parmater,
just like
Code:
 reaper.GetMediaItemInfo_Value( item, parmname )
so, one function for take vol, one for take gain...

A script can be made to switch both.
X-Raym is offline   Reply With Quote
Old 10-04-2016, 10:52 PM   #3
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 472
Default

Quote:
Originally Posted by X-Raym View Post
Indeed,
Code:
 reaper.GetMediaItemTakeInfo_Value( take, parmname )
can have "D_VOL" parmater,
just like
Code:
 reaper.GetMediaItemInfo_Value( item, parmname )
so, one function for take vol, one for take gain...

A script can be made to switch both.
Okay. So the second line of code you gave is for item gain, and the first is take gain? I'm still pretty green on writing reaper scripts. Not exactly sure how to get the D_VOL info from a selected item for its take gain and set the item gain to that, and then clear the take gain. I've tried looking for detailed info on how to write reaper scripts and a glossary of all the different commands, variables, etc. but haven't really had much luck on learning it from what I've found so far. If you can point me to a good resource to learn everything I'd need to know in order to write a script like this, I'd love to learn how. Thanks!
earhax is offline   Reply With Quote
Old 10-04-2016, 11:04 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Check my signature for links about how to learn ReaScript :P

I made a video tutorial serie and setting item properties is right from part 3

You will alos be able to use this template :
ReaScripts-Templates/X-Raym_Template item editing.lua at master · ReaTeam/ReaScripts-Templates

You just need to add metadata infos (if you want to share your creation), the way to get active take, and the way to switch both take vol and item vol (which is in fact item gain).
X-Raym is offline   Reply With Quote
Old 10-04-2016, 11:10 PM   #5
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 472
Default

Cool. I think I looked at something you wrote a while ago when I was trying to modify an existing script and it helped. I'll just have to dig deeper this time. Thanks again!
earhax is offline   Reply With Quote
Old 10-04-2016, 11:12 PM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,902
Default

Let us know how far you go,
we may give help if needed.

Good luck with scripting !
X-Raym is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.