So working my way through updates for the next version of SP-Tools and one thing I thought would be useful to implement would be something kind-of-like fluid.ampgate~
s @lookback
.
It’s a shame that fluid.ampgate~
and fluid.ampslice~
don’t share more features with each other as I like what ampgate does, but need hysteresis.
Either way, onto the question at hand.
So the core of most of what I do has an ampslice-based onset detector (actually ampfeature+gen~ to get gates rather than triggers from “ampslice”) that marks the start of an analysis window in a rolling buffer to do just-in-time descriptor analysis.
What I’ve been doing up to this point is taking the frame to analyze, and subtracting a fixed 16 samples from it (@44.1k) to ensure that I always include the start of the transient, given my analysis window is so small (256 samples).
In looking at fluid.ampgate~
again I thought that it may be better to incorporate something a bit more meaningful and consistent by doing something similar where (in a tiny window before the detected onset) it looks for the minima (what I believe fluid.ampgate~
is doing, based on the text in the reference).
At the moment my onset detection is giving me something like this:
And if I zoom right in I get this:
Which looks pretty damn good, but it looks like something 6-10 samples earlier may be better, or perhaps something even 20-30 samples for more of the pre-transient.
Now, in terms of implementing this would it be as simple as doing something like:
[ampslice onset detection] → [sah of position in rolling buffer] → [bufstats @select low @startframe/@numframes based on position] → [descriptor analysis]?
I guess at minimum this would ensure a zero crossing, or something closest to a zero crossing. But is there something more I should consider here if trying to implement this?