Quickest way to retime to different music clips each w/ 4 main bars, but variable bpm and intro / outro length


I have a short animation I plan to retime to various music many times, so looking to streamline the process.

Each music clip has 4 main bars (always 4/4), but the bpm will vary, and the intro / outros of each clip will vary by a few beats.

I was thinking along the lines of creating an animation track that contains only two keyframes, one each at the start and end of the main 4 bar section, then whenever I have new audio, find those corresponding two points in the music, and snap the two existing animation keyframes to them such that the rest of the animation stretches with it.

I see generally how to stretch / compress animation in the dope sheet, but not how to specifically lock those 2 points while also stretching those before and after them by the same amount so the intro/outro is also timed to the new bpm.

That’s the issue I need to resolve as I see it, but maybe there is also a better approach overall.