Reimplementing the "ToneMatrix" audio toy <p>There is a really cool audio "toy" called <a href="http://lab.andre-michelle.com/tonematrix" rel="nofollow noreferrer">ToneMatrix</a>. I would like to reimplement it as a Java applet. I've tried using <a href="http://www.jfugue.org/" rel="nofollow noreferrer">JFugue</a>'s <code>player.play</code> with individual notes for sound and <code>Thread.sleep</code> for timing, but the results are horrible.</p> <p>JFugue stops responding after the 17th (yes, really, I counted) invocation of <code>player.play</code> and <code>Thread.sleep</code> is too irregular to deliver a good rhythm.</p> <p>What would you recommend instead? Basically, I'm looking for a simple way to generate single notes of sound on the fly. So a fraction of a second before the sound is due to play, I need to be able to look at the data and tell the audio library what notes to play. (Multiple notes in harmony are likely.)</p>