Old 02-11-2015, 07:57 AM   #1
ludwigmueller
Human being with feelings
 
Join Date: Oct 2014
Location: Berlin
Posts: 43
Default Converting item volume to track volume

Hello all,

I have countless items on a track. I have adjusted the volume of every item seperately, but now I would like to transfer those volume changes to the track volume automation lane. Is this possible somehow?

Best,
Ludwig
ludwigmueller is offline   Reply With Quote
Old 02-11-2015, 08:22 AM   #2
Fergler
Human being with feelings
 
Fergler's Avatar
 
Join Date: Jan 2014
Posts: 4,307
Default

Don't think there is a way, someone could make a script I guess. My question is, why?

What does this enable you to do?
__________________
Check out my hip-hop, funk-rock band Theatre Crisp
Fergler is offline   Reply With Quote
Old 02-11-2015, 08:50 AM   #3
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

This is *not possible via scripting at the moment, but will be.
(I think it's already possible with the latest pre-version of Reaper/ReaScript)


*not possible = very difficult
spk77 is offline   Reply With Quote
Old 02-11-2015, 09:10 AM   #4
Goldreap
Human being with feelings
 
Join Date: Feb 2009
Location: UK
Posts: 1,338
Default

You could just glue all the items, then all your per item volumes are accounted for in your new glued item. But perhaps you wish to keep all your seperate items?
Goldreap is offline   Reply With Quote
Old 02-11-2015, 10:08 AM   #5
ludwigmueller
Human being with feelings
 
Join Date: Oct 2014
Location: Berlin
Posts: 43
Default

A script would be wonderful. The reason: its a voice over track in a movie on which I adjusted every item via item volume. But on the track itself I have to put a certain effect which needs to be hit by every item at its original volume. However, I don't want to loose the volume levels, so a script to transfer the item gain to track volume automation would be incredibly helpful. Next time I'll use the pre-fx-volume automation, but the volume-per-item method is just so much faster :-P

Meanwhile: Is there a script or function to reset the item volume of multiple clips at once?
Edit: Hang on, found it in the SWS extensions!

Last edited by ludwigmueller; 02-11-2015 at 10:41 AM.
ludwigmueller is offline   Reply With Quote
Old 02-11-2015, 12:08 PM   #6
Quest The Wordsmith
Human being with feelings
 
Quest The Wordsmith's Avatar
 
Join Date: May 2011
Location: Staten Island, NY
Posts: 1,210
Default

Since you found the SWS function to reset all the item volumes, I would take this course of action:
  1. Duplicate the track
  2. Remove the item volumes on duplicated track
  3. Put FX on duplicated track
  4. Set FX to 100% wet
Now you have the original volumes hitting your FX and still maintain all the item volume work you did.
__________________
freestylefam.com
Quest The Wordsmith is offline   Reply With Quote
Old 02-12-2015, 03:36 AM   #7
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by ludwigmueller View Post
A script would be wonderful. The reason: its a voice over track in a movie on which I adjusted every item via item volume. But on the track itself I have to put a certain effect which needs to be hit by every item at its original volume. However, I don't want to loose the volume levels, so a script to transfer the item gain to track volume automation would be incredibly helpful. Next time I'll use the pre-fx-volume automation, but the volume-per-item method is just so much faster :-P

Meanwhile: Is there a script or function to reset the item volume of multiple clips at once?
Edit: Hang on, found it in the SWS extensions!
Something like this will be possible :
("Reset item volumes" would be easy to add to this script)
spk77 is offline   Reply With Quote
Old 06-05-2020, 02:22 PM   #8
timboid
Human being with feelings
 
Join Date: Jan 2008
Posts: 141
Default

Found this thread, is there a working solution now? I really need it.
timboid is offline   Reply With Quote
Old 06-06-2020, 11:36 AM   #9
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 13,132
Default

Quote:
Originally Posted by timboid View Post
Found this thread, is there a working solution now? I really need it.
Hi Tim, I didn't realise this was a very old thread until I saw your post.

At anyrate, I was going to tell him all he had to do was duplicate the track, remove all the take volume envelopes, then EQ that track.

Then when he's done he can tranfer the EQ to the other track that has the take volume envelopes.
Tod is offline   Reply With Quote
Old 06-06-2020, 10:52 PM   #10
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 658
Default

The Volume envelope needs to be already ON on the tracks or this script will fail.

Code:
function Main()
  sel_item_count = reaper.CountSelectedMediaItems( 0 )
  
      for i = 0, sel_item_count - 1 do
      
        sel_item = reaper.GetSelectedMediaItem( 0, i )
         
        sel_item_vol = reaper.GetMediaItemInfo_Value( sel_item, "D_VOL"  )--volume
        
        sel_item_time = reaper.GetMediaItemInfo_Value( sel_item, "D_POSITION"  )--time
        
        sel_track = reaper.GetMediaItemInfo_Value( sel_item, "P_TRACK"  ) -- track
        
        env_name = reaper.GetTrackEnvelopeByName( sel_track, "Volume" )
        
        reaper.InsertEnvelopePoint( env_name, sel_item_time, sel_item_vol, 1, 0, false )
        
        reaper.SetMediaItemInfo_Value( sel_item, "D_VOL", 1 ) 
      end

end

reaper.Undo_BeginBlock()
Main()
reaper.Undo_EndBlock( "Script Item Vol to Envelope", 0 )
Also I started to make scripts like this quarantine, so I may missed somethings hahaha
daniellumertz is offline   Reply With Quote
Old 06-07-2020, 12:54 AM   #11
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,846
Default

Quote:
Originally Posted by daniellumertz View Post
The Volume envelope needs to be already ON on the tracks or this script will fail.
Code:
function Main()
  for i = 0, reaper.CountSelectedMediaItems( 0 )  - 1 do 
    sel_item = reaper.GetSelectedMediaItem( 0, i ) 
    sel_item_vol = reaper.GetMediaItemInfo_Value( sel_item, "D_VOL"  )--volume 
    sel_item_time = reaper.GetMediaItemInfo_Value( sel_item, "D_POSITION"  )--time 
    sel_item_len = reaper.GetMediaItemInfo_Value( sel_item, "D_LENGTH"  )--time 
    par_track = reaper.GetMediaItemInfo_Value( sel_item, "P_TRACK"  ) -- track
    local envelope = reaper.GetTrackEnvelopeByName( par_track, "Volume" ) 
    if not envelope then 
      reaper.SetOnlyTrackSelected( par_track )
      reaper.Main_OnCommand(40406,0) -- Track: Toggle track volume envelope visible
      envelope = reaper.GetTrackEnvelopeByName( par_track, "Volume" )
    end  
    local retval, value_before, dVdS, ddVdS, dddVdS = reaper.Envelope_Evaluate( envelope, sel_item_time-(10^-15), reaper.format_timestr_pos( 1, '', 4 ), 1 )
    reaper.InsertEnvelopePointEx( envelope,-1,sel_item_time-(10^-15), value_before, 1, 0, false, false ) 
    reaper.DeleteEnvelopePointRangeEx( envelope, -1, sel_item_time, sel_item_time+sel_item_len )
    sel_item_vol = reaper.ScaleToEnvelopeMode( reaper.GetEnvelopeScalingMode( envelope ), sel_item_vol )
    reaper.InsertEnvelopePointEx( envelope, -1, sel_item_time, sel_item_vol, 1, 0, false, false )
    reaper.Envelope_SortPoints( envelope )
    reaper.SetMediaItemInfo_Value( sel_item, "D_VOL", 1 ) 
  end

end

reaper.Undo_BeginBlock()
Main()
reaper.Undo_EndBlock( "Script Item Vol to Envelope", 0 )
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 06-08-2020, 09:00 AM   #12
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 812
Default

This looks good, thanks..

I wonder, is it possible at all to script something whereby Track Volume Automation is "moved" to the Items on the track as Take Volume Automation?
andyp24 is offline   Reply With Quote
Old 06-08-2020, 02:34 PM   #13
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 658
Default

Hi MPL!! Thanks for the code! I will analyse the changes in it, always good for learning heheh! I'm a little busy in a project right know, else I would see it already. Thanks
daniellumertz is offline   Reply With Quote
Old 06-09-2020, 03:32 PM   #14
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,296
Default

Thinking about this, is there a way we can "copy/ paste" fader volume to send volume?

This would be very handy to make cue mixes using the mixer faders rough mix to heaphones for example.
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060
pepe44 is online now   Reply With Quote
Old 06-09-2020, 08:00 PM   #15
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 658
Default

Quote:
Originally Posted by pepe44 View Post
Thinking about this, is there a way we can "copy/ paste" fader volume to send volume?

This would be very handy to make cue mixes using the mixer faders rough mix to heaphones for example.
It should be easy to make an script for that. I'm in the middle of a rush in a project else I would try....
daniellumertz is offline   Reply With Quote
Old 10-29-2020, 05:04 AM   #16
Alexis Baskind
Human being with feelings
 
Join Date: Aug 2017
Posts: 6
Default

Dear all,

daniellumertz, mpl, thanks a lot for the scripts, this is very useful. Below is a suggestion that does two slight modifications:
1/ adds an envelope point after the item
2/ if not only the item volume but also the take volume has been modified, applies a track volume which is the product of both (assuming the current take for each item).

Best

Alexis

Code:
 
function Main()
  for i = 0, reaper.CountSelectedMediaItems( 0 )  - 1 do 
    sel_item = reaper.GetSelectedMediaItem( 0, i ) 
    
    sel_take = reaper.GetActiveTake(sel_item)
    
    -- overall volume = item vol * take vol
    sel_item_vol = reaper.GetMediaItemInfo_Value( sel_item, "D_VOL"  ) * reaper.GetMediaItemTakeInfo_Value( sel_take, "D_VOL"  )
    
    sel_item_time = reaper.GetMediaItemInfo_Value( sel_item, "D_POSITION"  )--time 
    sel_item_len = reaper.GetMediaItemInfo_Value( sel_item, "D_LENGTH"  )--time 
    par_track = reaper.GetMediaItemInfo_Value( sel_item, "P_TRACK"  ) -- track
    local envelope = reaper.GetTrackEnvelopeByName( par_track, "Volume" ) 
    if not envelope then 
      reaper.SetOnlyTrackSelected( par_track )
      reaper.Main_OnCommand(40406,0) -- Track: Toggle track volume envelope visible
      envelope = reaper.GetTrackEnvelopeByName( par_track, "Volume" )
    end  
    
    -- reaper.ShowConsoleMsg(sel_item_vol)
    
    local retval, value_before, dVdS, ddVdS, dddVdS = reaper.Envelope_Evaluate( envelope, sel_item_time-(10^-5), reaper.format_timestr_pos( 1, '', 4 ), 1 )
    local retval, value_after, dVdS, ddVdS, dddVdS = reaper.Envelope_Evaluate( envelope, sel_item_time+sel_item_len+(10^-5), reaper.format_timestr_pos( 1, '', 4 ), 1 )
        
    reaper.InsertEnvelopePointEx( envelope,-1,sel_item_time-(10^-5), value_before, 1, 0, false, false ) 
    reaper.InsertEnvelopePointEx( envelope,-1,sel_item_time+sel_item_len+(10^-5), value_after, 1, 0, false, false ) 
        
    reaper.DeleteEnvelopePointRangeEx( envelope, -1, sel_item_time, sel_item_time+sel_item_len )
    sel_item_vol = reaper.ScaleToEnvelopeMode( reaper.GetEnvelopeScalingMode( envelope ), sel_item_vol )
    reaper.InsertEnvelopePointEx( envelope, -1, sel_item_time, sel_item_vol, 1, 0, false, false )
    reaper.Envelope_SortPoints( envelope )
    
    -- set item and take volumes to 1
    reaper.SetMediaItemInfo_Value( sel_item, "D_VOL", 1 ) 
    reaper.SetMediaItemTakeInfo_Value( sel_take, "D_VOL", 1 )
  end
end

reaper.Undo_BeginBlock()
Main()
reaper.Undo_EndBlock( "Script Item Vol to Envelope", 0 )

Last edited by Alexis Baskind; 10-30-2020 at 07:56 AM.
Alexis Baskind is offline   Reply With Quote
Old 10-29-2020, 10:19 AM   #17
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 658
Default

nice Alex ! thanks for sharing always nice to see changes

don't forget to put the code in the forum with [code] and '['/code] (don't actually put the ')

Code:
 Like this
daniellumertz is offline   Reply With Quote
Old 10-30-2020, 05:22 AM   #18
anomar
Human being with feelings
 
anomar's Avatar
 
Join Date: Jan 2019
Location: Brazil
Posts: 28
Default Script Variant: VolEnv or Pre-FX Env

Thanks
daniellumertz, mpl, alexis. Script works great.

One question.
Is it possible tha instead of a VolEnv the final result be a Pre-FX envelope?
I've asked because Item Volume is Pre-FX, (or am I wrong ?) and sometimes it would be more useful.
I try to do this combining this script with other actions but I think a little
cumbersome.

Thanks again.
anomar is offline   Reply With Quote
Old 10-30-2020, 07:59 AM   #19
Alexis Baskind
Human being with feelings
 
Join Date: Aug 2017
Posts: 6
Default

Hi anomar,

I haven't tested it, but I guess that if you replace "Volume" by "Volume (Pre-FX)" in all lines containing "GetTrackEnvelopeByName", this should work.

Alexis
Alexis Baskind is offline   Reply With Quote
Old 10-30-2020, 10:36 AM   #20
anomar
Human being with feelings
 
anomar's Avatar
 
Join Date: Jan 2019
Location: Brazil
Posts: 28
Default

I know nothing about scripting, but I think I can do that.
Thanks Alexis.


Quote:
Originally Posted by Alexis Baskind View Post
Hi anomar,

I haven't tested it, but I guess that if you replace "Volume" by "Volume (Pre-FX)" in all lines containing "GetTrackEnvelopeByName", this should work.

Alexis
anomar is offline   Reply With Quote
Old 11-03-2020, 06:23 AM   #21
anomar
Human being with feelings
 
anomar's Avatar
 
Join Date: Jan 2019
Location: Brazil
Posts: 28
Default

Hi Alexis,
worked ! I also changed action 40406 to 40408
Thank you all.
anomar 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 04:59 AM.


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