I updated this to give a bar or [grid] beat option (so if you right click the snap magnet and set it to 1/2 it will insert the stretch marker every half bar when set to beat), if you have sustained notes like a bass you get an artifact where the stretch marker is, to remove them from a sustained ending use (beats won't work with the grid set to swing, that's a Reaper issue, so use bar)
Item: Remove all stretch markers in time selection
right click Save Link/Target As
ReaTrak set item bpm and fit to project tempo map.lua
I used the
ReaTrak sonic visualiser import bars or beats.lua above to get the map then fitted the constant tempo tracks to it.