Before to start to implement something, I’m trying to think about which and how to analyze a sound recording (buffer or, preferentially on the fly with kind of accumulation method as described here) for having a quantification numerical value about : moments when the sound loudness is greater than a value (sound moments) / moments when the sound loudness is smaller than a value (silent moments).
Basically, the idea is, if loudness were normalized (btw, can we do that ?)
if loudness is smaller than 0.1 during 45s in total,
if loudness is greater than 0.8 during 30s in total
then, that value would be 0.1/0.8 which would mean 1 / 8 which would mean that “this sound recording” is MUCH MORE NOISY/LOUD than this other one, whatever its length, which got a value of 5/8.
Doing that on-the-fly could be like the thing I described here):
sampling the output of fluid.loudness~
considering 0.1 and 0.8 as static values (probably annoying)
if the output is < 0.1, bang something that increase a counter
if the output is >0.8 , bang something that increase another counter
This one could be enough, if we define THE silence level, static etc.
But actually, trying to have something that could measure correctly whatever the sound level situations.
I mean, if someone speaks globally low level, sometimes making silence and sometimes talking (low) OR if I have someone speaking LOUD sometimes making silence and sometimes talking (LOUD)… adaptative things could help.
Was thinking about measuring also the minimum and maximum, (but having to KEEP / accumulate all values (this is why I was speedlimiting) and then, with that big list, I could normalize it, then count all frames under 0.1 and all over 0.9, for instance. that would give me the low and high levels part. Could also be done with only 0.1. if smaller, then silence, else, not silence and I’d count my frame number smaller & greater.
In this case you would have a long list for the trend (100 points in my patch would be 10 sec) and a short list (10 points would be 1 sec) and then compare the 2. when the short term average is louder than the long term, it means short term is louder than trend.
btw your code is fine 2 with a typo and one explanation
typo : be careful in your < - 40 you have a space between - and 40
explanation: you ask why I put [change 0.] and suggest ‘reducing the flow’ - it is a little more complicated an answer. the FluidObjects output a value every signal-vector-size even if the value has not changed. So in my case, where I put @hopsize 4410 you will have many repeats (if your svs is 64 like the default, it will change every 68 or 69 times (4410/64) ) so in effect you can ignore all the similar values that way.