Fluid.bufampslice~ not working correctly (when using numframes)

Putting this on here (rather than directly onto github) as I’m not entirely sure if I"m overlooking something silly.

So I’m building a cascading onset detection thing using fluid.bufonsetslice~ followed by fluid.bufampslice~ and when testing things in context, I’m noticing that fluid.bufampslice~ is rarely returning valid values when I use the @numframes attribute.

In this example if I analyze the whole buffer (jongly.aif) I get a bunch of onsets detected (notably not including the first onset), but the moment I add @numframes 1024 I don’t get any onsets at all anymore. Only when I change @numframes to a huge number (8192) do I start getting onsets again.

It seems like this is broken to me?

The only thing I can think of is there’s some window being applied when using @numframes, but even with that, I would think that adding a @startframe offset would compensate for that, but still nothing.


----------begin_max5_patcher----------
1584.3oc0Y0raaiCD9rySAWgdzUf+JRsW1dbeGVTTHaSYqTYICI53jTz9ruC
IkxOM1wzQRF6lCgfzTb32Lbl4aH+wMyhVTeutMB8mn+AMa1OtY1L2P1Al00e
Vz1r6WVl05lVT09sKzMQy8+DzqnpTab+FoavhUtYVu31OyT8ybWVS1VsQ27M
cU1hRscJ3mWk58l9kg1MpeHyC6z98WTzbTzhrp0Qnu9zhZVtonZ82ZzKM9YI
37X7bDUxrMBrqCMFi9p8S94M2X+27.A6x5sa0UldLXz26jRDOFYZd.spHOW2
.S.AHH2hu1XTcU4CnC0MeuEcnvrAstXcVkoXIzqZU8g1+pe0JKpzKq2W4VRd
OhZzsvBlYJpq91qlAqaF40Ul7rk5WpwWreQmJkDpgII5EqWawitulZUWGylf
ewjq.b5Vm+VWdmFPVVzoMGLpy.fkwBngSr8RwVywq15sEqbqIaDMRrXTUswt
ePG1nq7FlrprxGdzNFbfzfpyQlMZzh8VC4QMLzAYXNqYPbcLCBVp0.HncNGt
FdxH6VPiQs0nsYUO.J6VXO+GQCQ2vuN5FBVHhkDIOUjxUXYBkqliHJVLmkR3
ILEmR3JlzNXpS+8QUbP.h1r052n3HDElGezfpzinXXQGUCPNYfy2KfImKcQJ
YhQHf4IAnUKFcVWIZnZ.xXpAnJmFf.NGfOBmNIZ.EIkFrAFO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c7Wqg7mK61M8OfN54WKckt0
TT4d4jWLIfbNhbBiPvBJ.43NggvCTRpqljdZUdWYYqbc3hhGDrrY+GAYwCRE
95YU2rR67CHWCg+5I816Z9ocCdP6lda26tYruWp0+XbUD12f775A4HXuY3qk
jruL2URRpqljjAcdUMVhhbtSiigfRtZZuP71Yomxae5ctImHJ2vhqDh9cLNw
HBL69fMiAHmwIiaPYGljDSgIZGgJx6edwyZKa2t6zMsceuSt.C1aqcSWM20s
nx2U351nuqne99QxZ.VjFfB49F+SVcehmjez1ZPvU.AXOvADChzwN197Vs65
dNMGI5a94M+aWnL7.
-----------end_max5_patcher-----------

In thinking about this a bit more I remember way way back when I was first wanting to make sense of fluid.ampslice~ that there was something about the envelope followers getting pulled towards -INF with synthetic signals so normal-ish thresholds would take a really long time to respond. I don’t know what change was made but it was eventually addressed in a fluid.ampslice~ update and I’ve been using it since. Perhaps this wasn’t ported over to the offline .buf version?

This would make sense since when analyzing the whole buffer that it would behave reasonably, but when doing isolated bits it doesn’t have enough time to respond. This would also explain why the first onset is being missed in jongly when analyzing the whole buffer.

(turned this into an issue on the git)