I have two audio-rate inputs. Either one might be louder than the other, and what I would like to be able to do is match the volume of the second input to the first. I know I can get use an envelope follower to get me a fair part of the way there but then I need to know how to use the value coming out of the way envelope follower such that no matter whether signal 2 is louder or quieter than signal 1 it ends up at the same volume.
Hi @pgatt,
as always, I wonder if I grasp the question, but I post a screenshot with sort of a gain balancer. I’m using 2 simple VCO’s to feed the attenuverter, but the audio source could both be live inputs, or samples.
Moving the gain knobs of the 8vert module, you should get the matched gains in the third scope.
To match a signal B to a signal A, what you want to do is apply a gain of envelope(A) / envelope(B) to signal B. I don’t know a module that performs division, but perhaps it exists or you can write one with Frank Buss Formula or VCV Prototype. Obviously, if signal B is silent, its envelope will be 0, so the division cannot be performed, so you’ll need some safety code like if (B == 0.0) return 0.
I’m not sure how that could have worked. You’ll need the division in there somewhere to “normalize” the signal against its envelope before applying the gain of the other signal’s envelope.
@Vortico@stoermelder I see it. That’s the the way to go! @pgatt Good if Unity was of use to your needs, but take into account that Andrew and Ben depicted the exact solution to your original requisite!
It may not have worked - I could be wrong. I will do some more fiddling and post in here later. Thanks for the further information Andrew and Ben, will definitely have a play with the methods you instructed!