Calculating difference in audio level

zeep's icon

In a simple newbie device i'm clipping audio driving the input volume, and / or lowering the clipping threshold.

I would like to have a numerical readout showing me how much dB i'm clipping.

I tried subtracting the post-clip signal from the pre-clip signal, which should be the number i need, but i can't make that outcome number appear in a box. Searching all over the web for a long time now, i still am lost which objects i need to use for this. I really didn't want to ask for help with this simple issue.

Can someone point me in the right direction please?

Cheers

zeep's icon

As per usual, the rabbit hole is deeper than i thought.

I have managed to get a numerical readout, using the live.meters i already have in this device.
One meter shows the input pre-clip, another meter shows the output post-clip. Now i take both meters bottom connection and subtracting one from the other, going into a live.numbox set to Loudness dB.

That gives me a decibel display. However it's not accurately enough and shows nothing behind the decimal. It simply rounds off to whole decibels.

I guess that brings me to the deeper level of the rabbit hole. How can i get more precise information behind the decimal of how much decibel difference i have between the input and output

Source Audio's icon

check live.meter Redraw Threshold and redraw interval
use something better than that live objects


zeep's icon

Thank you for your help Source Audio.
To be honest this looks way past my knowledge, but that's a good thing. I will try to rebuild it and learn those Objects.

Source Audio's icon

ignore all but settings for meters
and use max float boxes to display the difference

Max Patch
Copy patch and select New From Clipboard in Max.