This demo show-cases how to implement two audio loops into an HTML-project using iMusic. There is a guide with all the required steps at https://github.com/hanslindetorp/imusic/wiki/Getting-Started about. You will learn how to prepare your audio files, implement iMusic, configure your music in XML and how to trigger them using the built-in timing features without a single line of javascript. Finally you learn how to make custom javascript calls and where you can find more information.
This DEMO is available from https://hanslindetorp.github.io/imusic/demos/getting-started