You’re looking for an "envelope follower" …
Steve’s “dynamic mirror” plugin will also do that.
Vocoder does that.