Hi Reapers,
I please need your help in reaper scripting (.lua).
I would like to apply/copy the fader's dB value (of a selected track) on the item volume (active item?) which is on that track. And then, reset the fader at 0 (unity).
If possible, if many tracks are selected, apply that action on each item on respective tracks and reset all faders at 0.
I have a good starting point, thanks to TeddyTheToad.
https://forum.cockos.com/showthread.php?t=181565 but here this is something a bit different.
May I have your help please ? Here is a piece of the code that works with obe selected track and one (any) selected take only :
n = 0 -- loop var init
fx = "volume" -- fx name to target. change if you want it to taget a different fx
while(reaper.GetSelectedTrack(0,n) ~= nil) do --loop runs untill no more selected tracks
selTrack = reaper.GetSelectedTrack(0,n) -- gets the number of a track
volume = reaper.GetMediaTrackInfo_Value(selTrack,"D_VOL") -- gets fader level
item = reaper.GetSelectedMediaItem(0,0)
take = reaper.GetActiveTake(item)
reaper.SetMediaItemTakeInfo_Value(take,"D_VOL",vol ume)
--
--
reaper.SetMediaTrackInfo_Value(selTrack, "D_VOL", 1.00) --resets fader val to 0db
n = n+1 -- move to next selected track
end
Thanks in advance,
Gaetan