The LoopMixer library allows you to easily mix audio loops together in Processing (Java), using Minim. It takes care of slowing down/speeding up the loops to match the global rhythm, which can be changed at runtime.
The library was made to be used by the students of course TI1100-A at the Delft University of Technology.
For a demonstration, see: http://loopmixer.googlecode.com/files/demo-v2-0-0.jar
A screenshot of the demo:
The library (including source code) with its documentation can be found on Google Code: http://loopmixer.googlecode.com/