Maybe this article can help. Scroll down to the section titled "Groove extraction and Quantize".
https://s1manual.presonus.com/Content/Editing_Topics/Transient_Detection_and.htm