Custom LED metering
There is this thing I've been trying to find out, but my knowledge is still just too limited. I am always inspired by the look of vintage (budget) gear and I remember some rack units that had LED metering. Not very accurate, but showing the signal with 5 or 6 leds. When the signal was clipping, the last (red) LED turned on. Is there an easy way to do this in Max? Here's the patcher i've been working on, but it doesn't work the way I want. Also when the audio stops, the signal from the [scale~] is [2.5] and it should be 0.
Why not simply using [meter~] ? It offers customization options (number of leds, thresholds, appearance ...).
well that is my choice if something like this doesn’t work. For some reason I just really like the “lofi” aspect of it. And the [meter~] only has a min of 10 leds. Also I’m a designer and I’d like to design it a little bit more, if that makes sense.
You have to use something to measure level,
then do whatever to display your leds.
what you use in your patch can't work.
there is no benefit of using number~ instead of meter~ or avg etc,
but meter~ is simplest.
you scale -1. 1. to 0 5
which means when silent == 2.5 ?!?!
If you realy want to do it that way, then insert abs 0.
after number~ and then scale 0. 1. float to 0 - 5 or whatever
Sort of, maybe ?

"meters" basically show peak history, and a rudimentary but working implementation can be found in the [peakamp~] object if you don´t want to make your own:
- abs()
- accumulate signal values to find max() of last n samples
- after polling, reset the accumulator, output the max value and transform it into a float
- convert these floats to decibel values
once you got the peak history data from something like this, you can split the output up depending on its value and control single GUI elements or any kind of hardware you wish with it.
so far for my self-righteos blah blub - now i am looking into your patch.
currently you are analyzing on a poll-per-sample basis, which means that with some bad luck you could miss a bunch of much higher peaks, which are present in the signal but not seen because the fixed polling rate.
also, your lights reset the next lowest light for no good reason, i´d suggest either all or none.
it is a matter of taste but i would run the db values "live" as it is easier to write.
with vanilla objects except for the green led logic utility:

you might want to add a slew limiter for downwards (>25ms / -40 db relative distance, you´d do that with the 1 to 0 transition of the output bit (the toggles))
too many signal objects for simple 5 led control

That's so obvious, once I see it, SOURCE AUDIO !
whoa, when i started writing i was first and by now the gang is complete. just had some serious fun with graphics glitches in max 7 where you could no longer connect cables where they belong. :(
"only has a min of 10 leds. Also I’m a designer and I’d like to design it a little bit more, if that makes sense."
both totally makes sense.
plus, older versions of meter~ were calculating stuff completely wrong and the levels were not dynamic.
in the case of peakamp~ it is the opposite, this guy is so complicated and so CPU intense if you want to program your own that the compiled object is the better choice.
currently you are analyzing on a poll-per-sample basis, which means that with some bad luck you could miss a bunch of much higher peaks, which are present in the signal but not seen because the fixed polling rate.
May I ask you to elaborate a bit ROMAN ?
How would a per-sample-polling basis may lead to missing peaks ?
How would the [peakamp~] solution you posted, with a 25ms interval, avoid missing those peaks ?
And, thank you, btw : small side thing, but thanks to you I realized that :

Much more simple. This is indeed in the documentation, but I hadn't noticed before.
polling every 100ms from a stream of samples directly takes the value of every 441th sample, which is the peak of the last 441 samples only with a chance of 1 to 440.
measuring the peak of the last 441 samples requires to compare all 441 samples with each other and then pick the maximum value.
"That's so obvious, once I see it, SOURCE AUDIO !"
peakamp~ and meter~ have a float output... for a #reason! :)
Visual improvement?

Thanks for all the great ideas and suggestions! I knew there must have been a super simple solution, so for now I went with the "hidden meter" solution by SOURCE AUDIO. Sometimes it's so easy to overthink everything while it can be super simple.
if you dont need it super exact (given that meter~ is correctly calculating first in line), you can put it (or peakamp~) in a poly~ and downsample it x2 or more (without filtering)
Have you given the [multislider~] object a shot in Max for that LED meter effect? It's pretty cool for mimicking the LED signals, and you can even adjust its appearance to nail that retro look you're into. If your [scale~] is acting up by showing 2.5 instead of zero, maybe try slotting in a [gate~] to manage when the signal is supposed to be off.
I read on a website that this could help make sure those LEDs don't light up when they shouldn't. They have many articles about all types of lightning, and they helped me install all my lightning in the house. It turned out perfectly, so I can guarantee you they are trustworthy.