Here's an AGC (automatic gain control) abstraction I whipped up. I'm posting it here in case anyone finds it useful. Open agctest.pd and play with the top hslider for an example of how it works.

http://www.pdpatchrepo.info/hurleur/agc~.zip