Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 06-14-2019, 11:15 AM   #1
IrishRover79
Human being with feelings
 
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
Default editing JS volume smoother v5 plugin so that vol envelope mirrors VPFX

Hi,

I'm trying to edit the JS volume smoother v5 plugin so that its volume envelope is the precise opposite of the volume Pre-FX envelope. The aim is to do a bunch of automation on the volume pre-FX envelope, copy and paste that onto the volume envelope for the modified JS volume smoother plugin, and invert the pasted automation so that the audio is exactly the same.

I've tried playing with the min and max values of the volume slider but can't get it to work the way I want. For example, if I boost a point +8dB on the pre-FX envelope, the process above gives a different volume cut after copying and pasting and inverting.

Any help greatly appreciated!

While I'm here, anyone know how to set the value of multiple selected envelope points at once?!

Thanks.

Last edited by IrishRover79; 06-14-2019 at 12:12 PM.
IrishRover79 is offline   Reply With Quote
Old 06-15-2019, 09:12 AM   #2
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Hmm, no, I suppose the curves will be different. Or something.

I don't know why you're doing this, but would it suit you to use two instances of
JS: Volume adjustment instead of pre-fx volume and fx

Put one at the start of the fx chain (and it's *pre* everything else). Invert the "Adjustment" envelope for the second and (provided you've set the "Max Volume" appropriately) they should just cancel out.

What are you trying to do?
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 06-15-2019, 09:37 AM   #3
IrishRover79
Human being with feelings
 
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
Default

Hi, thanks. You’re right that I could use another instance of JS volume adjustment in the first slot and perhaps the inversion of the envelope might work more smoothly if I did that. However, I find it useful the way the pre-FX volume envelope changes the waveform - just like clip gain in Pro Tools - and I wouldn’t get that with another instance of JS volume adjustment.

The scenario this is for is where you’ve got a track which deliberately has very different levels in different sections of the song, but you want consistent processing, e.g. compression, throughout. The pre-FX volume envelope ‘levels out’ the audio before it hits compression (ensuring more consistent processing) and the ‘post-FX’ volume adjustment envelopes puts the sectional dynamics back in afterwards.

It would be cool if I could just copy the pre-FX envelope, paste it onto a ‘post-FX’ volume envelope, invert it and not have to fiddle!
IrishRover79 is offline   Reply With Quote
Old 06-15-2019, 10:06 AM   #4
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,293
Default

jrk's suggestion would work well IF you change the bounds of the adjustment slider to be symmetrical. Otherwise it would be just about as tough to get the scale and baseline and everything just right.

Trying to do it with the PreFX Volume is going to be tough, and probably mostly trial and error. It certainly is possible to recreate the curve in of that envelope in JS, but you have to figure out what curve that is. If you can get it to track reasonably well in the positive direction, you should be able to just multiply the slider's db value by -1 before converting it to a ratio. This would mean like make a copy of the plugin specifically for this.
ashcat_lt is online now   Reply With Quote
Old 06-15-2019, 12:18 PM   #5
IrishRover79
Human being with feelings
 
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
Default

Thanks, I’m not much of a programmer but I’ll take a look and see if there’s a way to change the curve of the JS plugin. I suppose the alternative would be to find a 3rd party gain plugin that happens to do the job but I’m not sure how I’d even go about identifying one. Maybe I’m being too demanding!

Thanks all for your help. I’m relatively new to Reaper and it’s so cool that there’s a great community willing to try to answer queries like this.
IrishRover79 is offline   Reply With Quote
Old 06-15-2019, 02:30 PM   #6
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,293
Default

Well if you can find the equation for the curve, it’s almost as easy as just dropping the slider value into it.

I’m vaguely interested. If I get a chance, I’ll see what I can’t figure out. Please don’t hold your breath, though.
ashcat_lt is online now   Reply With Quote
Old 06-16-2019, 01:44 AM   #7
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by ashcat_lt View Post
IF you change the bounds of the adjustment slider to be symmetrical. Otherwise it would be just about as tough to get the scale and baseline and everything just right.

Is why I suggested JS: Volume adjustment - the slider *is* symmetrical, I think?

Anyhoo, if you need to do this thing, it wouldn't be too hard to work out a conversion function - from a volume envelope to an envelope for a fx parameter.
Just create a volume envelope with (say) 1dB steps, do the copy and paste (and invert?) and read off what it does to the parameter. Bit of maths (I smell logarithms) and you're pretty much there.

(Or, of course, vice versa)
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 06-16-2019, 09:18 AM   #8
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,293
Default

Honestly, I missed the fact you were talking about the other plug in, but I also had to go check. You are correct, of course. It also has a crude smoothing built in and could work.

But I also did the test you suggested, and it turns out that it is linear with respect to the actual gain ratio. All you have to do to get it to track perfectly in the positive direction is make the slider go from 0 to 2 and then you don’t even have to do the dB-to-ratio conversion. The slider IS the gain factor. To get the inverse action out of that, it’d be 1/slider. It’ll explode at 0, so probably best to limit it to some reasonable value. You’re never going to want infinite gain anyway.

It’s super simple. Let me know if you need help.
ashcat_lt is online now   Reply With Quote
Old 06-16-2019, 12:50 PM   #9
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by IrishRover79 View Post

The scenario this is for is where you’ve got a track which deliberately has very different levels in different sections of the song, but you want consistent processing, e.g. compression, throughout. The pre-FX volume envelope ‘levels out’ the audio before it hits compression (ensuring more consistent processing) and the ‘post-FX’ volume adjustment envelopes puts the sectional dynamics back in afterwards.
I get you. Good news, looks like you've got ashcat_lt volunteering to help w/ this.

Me, I'd probably just split & "mult" the thing. Or automate some sends. Not that your idea can't work - I don't think it would be the usual way to go about it, but whatever gets you there.
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 06-16-2019, 03:16 PM   #10
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,293
Default

I just went ahead and did it. The Volume/Pan Smoother looked too complicated, and really was more than you needed, so I started from Volume Adjustment. In quick tests, it seems to work well as long as you avoid real extreme sudden jumps. It is hard limited to a maximum of 60dB gain, but I figure that's way outside the range of intended use here. I did leave in the Max Volume clipper thing, but I made it default way up at +150 because that's my default hack for that plugin. Hope it helps.

This follows the envelope and does the inversion within the plugin. You don't have to manipulate the automation item at all. Just copy it to the Adjustment Ratio envelope and go. Make a pooled duplicate, and it will follow any changes you make to the PreFX envelope.



Code:
// This effect Copyright (C) 2004 and later Cockos Incorporated
// License: LGPL - http://www.gnu.org/licenses/lgpl.html
// hacked out of Volume Adjustment by ashcat_lt

desc: Volume Envelope Undoer
//tags: utility gain
//author: Cockos

slider1:1<0,2,0.001>Adjustment Ratio 1:x (automate me)
slider2:<-6,60,0.001>Adjustment dB (read only)
slider3:150<-150,150,1>Max Volume (dB)

in_pin:left input
in_pin:right input
out_pin:left output
out_pin:right output

@slider
  adj1=1/max(slider1, 0.001); 
  slider2 = 20 * log10 (adj1);
  adj2=10 ^ (slider3/20);
  doseek=1;

@block
doseek ? (
  dadj=(adj1-adj1_s)/samplesblock;
  doseek=0;
):(
  dadj=0;
  adj1_s=adj1;
);

@sample
spl0=min(max(spl0*adj1_s,-adj2),adj2);
spl1=min(max(spl1*adj1_s,-adj2),adj2);
adj1_s+=dadj;
ashcat_lt is online now   Reply With Quote
Old 06-17-2019, 03:56 AM   #11
IrishRover79
Human being with feelings
 
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
Default

Jrk, Thanks. You’re right I could mult the track but I generally Itry to avoid moulting unless the audio is fundamentally different in character and requires different processing.

Ashcat_it, thanks for the code. Really appreciate your help. Looking forward to trying this out tonight.
IrishRover79 is offline   Reply With Quote
Old 06-17-2019, 01:21 PM   #12
IrishRover79
Human being with feelings
 
Join Date: Jun 2019
Location: Hampshire, England
Posts: 240
Default

Hi both, have tried this and it works beautifully! Thanks so much.

Ashcat_it, I got the same result as you. It doesn't seem to like sudden jumps but I got rid of the pop and clicks fairly easily by some slight tweaks to the shapes of the VPFX volume changes. Your solution is very elegant, I must say. Being a Pro Tools refugee, I had no idea what automation items were, so I had to look that up to work out what to do but it's pretty amazing how they allow you to automate your automation! :-)

One thing I noticed when comparing a raw track to a print of the processed version is that the two tracks didn't completely cancel when I inverted the polarity of one of them. So there must still be some minor differences between them. Weirdly, where the raw track was quieter, the two almost seemed to cancel but where it was louder there was more of a difference. I'm not quite sure why that would be. However, I don't think it really matters too much. For all practical purposes, processed and unprocessed seem identical to me - which is what I was looking for.

Cheers!
IrishRover79 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 11:26 PM.


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