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.
Java based cocoa app for Mac OS X.
Wii Loop Machine - make music with a Nintendo Wiimote controller.