Invalid weights message from fluid.bufstats~

I’m working on a processing chain for pitch confidence thresholding, and sometimes the thresh’d weights buffer it produces is full of zeros (correctly so). This makes fluid.bufstats~ further down the line throw up an ugly yellow error:

fluid.bufstats~: Invalid weights

This is a fine enough warning if you have the wrong amount of samples, but if the @weights buffer is actually full of zeros, it should apply that weight (and zero everything out).

I guess I can add an interim step and if the buffer is zeroed, fork the process and get the stats on an unweighted buffer, but that’s super inelegant.

Was gonna make a separate thread for this, but it’s very related to here.

The @warnings attribute has no impact on the yellow error message:


----------begin_max5_patcher----------
2665.3oc0assbaqaE8Y6uBNpu5nA2AQexI8zlNSy4zLMoSlNYx3gVBxgITjp
jT9ROyIe6cC.JZQIJdwFx1wOHCABPrwBq8BabQ+9omL4xra0ESB9yAeN3jS9
8SO4DaVlLNo56mLYYzsyRhJrEaxRcQQzU5Im4dVo91Ra9EkQ4kKxiVpCvHD5
rfKiRuZSoVkqKzokQkwYoWjDmpmksN0VOxlRDUN6qwoWcQtdVoydvgzov6QP
lxQHbHloHRImERNK.SDlGQHSQAeo5MjtdYbZhtrX6WKjY15xM4hqxMdt0jyt
7auhrwDcEq7tUZWqOYRvWLO4ON8TyGmMP3IUeC7Z2Cctb8hE57eD7mPYoEf0
D7srzqRtaZT7hIGFAnRkoaxXzoRBip3gHBmIYHA.Arvtg.bqP.oEHfcPLXQR
VT4jy.62LX5S.YQx534SAXYV1xUYE5eDbdQ157YZ.hVECHwEDtH3745hx3TK
uo9A2niu5qkEtBXocy9ZTZ.tCfTvLXElqlxkLoJTfPgrPQHF.WE9gfiz8wQL
lePfz4LrEfdjXWNDB.EG9P5.S3xvoDDvnnH6eXp5PTMN0STML5nx0Nj1DZJQ
vYBU.jfRvLNj.y43PSNnPLEa9OWJ3thfTXhoHBFiWavMjsnGFWYRCXQw3ops
9iy3.PV4OqdzxVgnipt00Q4ofRdSOURRbQ4mIe4v9x1RDbtiN1l+ZutnDNPJ
UJrhwPTpBF0.WTBk8P3es.aB9Ssb+XffV8Ho.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g0mC+9o5P0VFZtiYm0Zpmvn.FnVumXUM8NF1nn6x9NtMcaq6zm227H2c
T+MIq0uBOpS3vbqDkUmG+8hQJuKAUYf4Y2jNZK7oQjzYg+k6hFuAhHJt65AH
kTJw4sQvP3b92.eatV+.rPK5UumZXgI9F+ab+JnrkVFMZyKjgDB2t8IPfwYg
RgBq392F+W54i19j0Q8hqWTEpZFCeae+GcRR1MiGBIb2saQFhCsgpi3U+lt5
7FXwUHT3wnCP9YrCXO9h2lk7.nH0abBGhDh6tnQaOInWLvUqyWknGUvoLjKt
FBGITVNLIjKHgCLBMY8EHjg4frgUaynd3UWyb8Lc70cexcswYpWa18FGZ6Kd
neLN2RTLzhQf78RHZcEjLPGTUM+gr5xTCNAJuNSRgNcdwKsYPtGj612amK5p
DijtCLhIPppKetD2+EC7owgsLZUe2j6s1gq2EUlE7NypPm3s1unTuXcRRYuG
vxt2SyPNG61SVAURcW5cA3cI55NDyvP3j1fIqWTfYOGpuxjdsSM59DITF5hy
fVyjoDEUE9X5SO6quuTW7x52KvMlcy4tQP7+k37x6B9qWk02uQEjYrvttTZ0
P.3IWc5E8uMVXkB4htD3wrpiLWfPTbW2IWpXHST12cfe7.q62Nm8D7LPUwpp
gP6uY1S+iS++.0lpnc.
-----------end_max5_patcher-----------

As you know, we are considering programmatical feedback for errors and warnings. These should happen eventually, so put that on your list of things to check in various next releases :slight_smile:

1 Like

I could have sworn there was a more recent thread about this with a suggestion from @weefuzzy about gating the subsequent analysis if the the loudness weights buffer is full of zeros… but I can’t find it. So bumping this thread as it’s the closest and most relevant.

SO

After chasing down a weird bug I was getting where a certain set of files wasn’t analyzing properly, it turns out that this “gate the analysis when weights buffer is all zeroes” breaks offline analysis where you need to analyze every buffer for every frame for things to make sense.

Specifically this came up when analyzing files that had pure/digital silence in them, and specifically at the start. This meant that analysis for certain files just didn’t begin at all, which then breaks logic further down the line.

That leads me back to here in that the dreaded/annoying yellow error message of “invalid weights” as the simple fix here would be just to analyze all frames, always.

So revising my old (and forgotten?) requests at the time:

  1. treating a weights buffer of all 0s the same as any other equal value series (e.g. all 1s, or all 0.5s). in other words, if all the weight values are the same, weigh it all the same
  2. move the yellow error of “invalid weights” into a category of errors that can get blocked by the @warnings attribute so it doesn’t matter one way or another if the weights for that analysis frame get ignored

/////////////////////////////////////////////////////

In the meantime I need to figure out a workaround, for which I can only think of inelegant solutions. If a weights buffer is all 0s, I can’t just block that analysis frame, and I don’t want to spam the console with yellow messages, so the only option that seems possible here is to create a dummy weights buffer which is passed along when this is the case. Threading and @autosize 0 makes that less straight-forward than it seems though.

neither. just parked in its right priority :smiley:

The maintenance team is super strained. As there is a work around, then it is not as urgent as crashing behaviour. I hope you understand. It will be addressed one day.

1 Like