Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-06-2018, 10:41 PM   #1
ausbaxter
Human being with feelings
 
Join Date: Apr 2016
Posts: 39
Default Bug : SetMediaItemTakeInfo_Value "D_VOL"

Currently the implementation of SetMediaItemTakeInfo_Value(take,"D_VOL",newvalue) provides a relative offset of the current take volume value, shouldn't it instead allow you to overwrite the current take volume with the newvalue argument?

For example if I call the function on an item at unity gain with newvalue = .5, the resultant gain will be -6 dB. All good there, however if the take volume is not at unity the same call results in a -6 dB offset of the current take volume setting.

I've confirmed it both in lua and eel.

Correct me if this is the intended functionality.

Last edited by ausbaxter; 02-07-2018 at 01:15 PM. Reason: woops, argument is "take" not "item"
ausbaxter is offline   Reply With Quote
Old 02-07-2018, 03:43 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Code:
SetMediaItemTakeInfo_Value(item,"D_VOL",newvalue)
Seems that you pass an Item instead of a take here.

For item:
Code:
SetMediaItemInfo_Value(item,"D_VOL",newvalue)
Then, it works as a real Set (just like expected).


Last edited by X-Raym; 02-07-2018 at 04:01 AM.
X-Raym is offline   Reply With Quote
Old 02-07-2018, 12:35 PM   #3
ausbaxter
Human being with feelings
 
Join Date: Apr 2016
Posts: 39
Default

Oops yeah sorry, that should be "take" not item, here's a gif of what i'm talking about.



The function offsets existing take volume values instead of absolutely setting them.

The original calculation on "Nudge active takes volume randomly (normal distribution) with GUI" assumes overwriting of take volume. and is follows:

Code:
        NudgeAmount = buf[i]

        OldVol=GetMediaItemInfo_Value(item, "D_VOL");
        OldVolDB=20*(log10(OldVol));

        NewVol=OldVolDB+NudgeAmount;

        NewVol >= 24 ? (
          NewVol = 24 
          ) : (
          NewVol = NewVol;
        );

        NewVolGain=exp(NewVol*0.115129254);
        
        SetMediaItemTakeInfo_Value(take, "D_VOL", NewVolGain);
However, since the function offsets existing values, you just need the converted linear nudge amount as the function argument. This makes me think that the function's behavior has changed since you had written the script.

Code:
        NudgeAmount = buf[i]; // You can modify this
        
        NudgeLin = 2^(NudgeAmount/6);
        
        SetMediaItemTakeInfo_Value(take, "D_VOL", NudgeLin);

Last edited by ausbaxter; 02-07-2018 at 01:22 PM. Reason: Fix Gif
ausbaxter is offline   Reply With Quote
Old 02-07-2018, 01:20 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

That's weird,
I don't succeed to reproduce,
this is my code

Code:
item = reaper.GetSelectedMediaItem(0,0)
take = reaper.GetActiveTake(item)
reaper.SetMediaItemTakeInfo_Value(take,"D_VOL",0.5)
Can you copy paste yours here ?

Also, beware that your items doesn't have ITEM GAIN applied ! cause the display shows Item Gain + Take Gain
X-Raym is offline   Reply With Quote
Old 02-09-2018, 07:38 PM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Looks like you're getting the item volume, and setting the take volume, which may not be your goal..
Justin 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 10:34 AM.


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