Two Tool Ideas

You can use tap tempo tool, beatsync from samples, etc. If you sampled from a record but not a perfect loop you just adjust the loop points and check with your ear(s).
I just had a idea for a “set song tempo from sample length” tool tho but I think it’s been done, dblue, It-Alien??

You can look at the scl to xrni tool. If you duplicate sample 128 times and make mappings for one note long (all with root note still at C-4) - then remove the keys you don’t want. Check out Scale Finder tool too (for chords).