source.start(startOffset, 0, loopDuration);
where startOffset is when the loop first trigger and loopDuration is the length of the looped phrase. To sweeten the sound and make it less jarring when samples were stopped, we built a Ping Pong delay similar to this one
]. This effect is relatively inexpensive compared to reverb and gave us a nice cohesion between samples.
We've wrapped many of the audio techniques we've learned into a library called
which we are currently expanding to include more effects and synthesis as well as transport and metronome controls.