How do I create a peak level meter similar to Ableton's peak meter?

Kyle Harris's icon

Hey everyone, I'm very new to msp so appreciate the beginner help! I'm trying to make a peak level meter for a gain tool I'm working on that's identical to what's visible in Ableton's session view (see attached image with db level of -8.01). I can't seem to figure out how to get a db level output that displays the last highest peak level.

I've experimented with the peakamp~ object and can't seem to get that to work. Looking for some guidance as I'm mainly trying to learn what object(s) would be best to learn and the general logic behind creating something like this.

I really appreciate it!

Roman Thilenius's icon

to make a meter, peakamp needs a buddy, such as rampsmooth.

the "hold" value should be done later with the numbers for the GUI.