# Adding @lookback to ampslice-based JIT onset detection?

**URL:** <https://discourse.flucoma.org/t/adding-lookback-to-ampslice-based-jit-onset-detection/1938>\
**Category:** Usage Questions\
**Created:** [June 10, 2023, 2:32pm UTC](https://discourse.flucoma.org/t/adding-lookback-to-ampslice-based-jit-onset-detection/1938 "2023-06-10T14:32:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)\
**Post date:** [June 11, 2023, 7:31pm UTC](https://discourse.flucoma.org/t/adding-lookback-to-ampslice-based-jit-onset-detection/1938/3 "2023-06-11T19:31:15Z")

</div>

And actually remembering the discussion in [this thread](https://discourse.flucoma.org/t/edge-cases-in-analysis-frames/) about managing different edge cases for window analysis (mirroring, zero-padding, etc…) I’ve been thinking about this specifically:

 ![0eff07a41c175ca8b9f49aa443438eb8c7df7399](https://discourse.flucoma.org/uploads/default/original/2X/f/fb77aa74c3f6ab9b2adacf1606c4de03367bdc4c.png)

Where at the moment I’m analyzing 7 frames, that have a lot of zero padding on each side. So I’m thinking of revisiting this idea of _including_ the audio outside the 256 analysis window (dark green in that image).

The reason I bring this up is because if I’m offsetting the start of the window analysis to be more precise (using the `fluid.ampgate~` / `fluid.bufstats~` possibilities above), that it may be beneficial to center the onset such that the transient falls in the _center_ of a hop.

So lets say my transient starts _precisely_ on sample 100, instead of starting to analyze there, I would instead analyze {hop / 2} samples _before_ that (so sample 68 in this case) so the transient falls exactly in the middle of a hop with the thinking that this would (potentially) ensure that the transient is best represented across all of the hops.

I guess that would mean that frame #2 (in the above screenshot) would no longer be “centered” but that geometric centering puts all the energy in the second half of the center (50-75% through that hop).

---

_[View the full topic](https://discourse.flucoma.org/t/adding-lookback-to-ampslice-based-jit-onset-detection/1938)._
