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);