This seems like a bug to me, but it may just be an edge case oversight so posting it here before going to the github with it.
I’ve been updating my JIT edge frame stuff (based on the discussion in this thread) and to do this I’ve been dynamically adjusting the @startframe
I’m using for fluid.bufstats~
. When doing this I was getting an error in the console:
fluid.bufstats~: Weights buffer invalid size
I was confused because my descriptor and loudness frames are exactly the same (10 frames in this case).
After poking and prodding I realized that @startframe
in fluid.bufstats~
is being applied only to @source
and not @weights
.
As in, even though I am sending in source and weight buffers that are the same size, fluid.bufstats~
is truncating the @source
buffer based on the @startframe
attribute, and leaving the @weights
one untouched, hence the error.
Checking with the reference file and the conditions for @weights
are listed as:
a single-channel
exactly the same amount of frames as source
all values must be positive (anything lower than 0 will be rejected)
It doesn’t say anything about how @startframe
factors in. In my case my @weights
input is the same amount of frame as @source
and all other conditions are correct as well, but it still returns an error.
/////////////////////////////////////////
So to me this seems like an unconsidered edge-case and the reference is correct in that the source/weights should be the same. It would then follow that @startframe
would (internally) apply to both the source and weights buffers. Otherwise it creates weird edge case plumbing where modifying @startframe
(and presumably @numframes
) would require a bunch of fluid.bufcompose~
-ing of the weights buffer in a way that seems needless and confusing.