The Automator Loop Utility will take care of all the work.
Calculation software for expressions.
Simple, tiny menu-bar app that plays music files in a loop from a source folder or a streaming URL.