@nsigma: Lag? Largely due to GUI laziness on my part. (Shot myself in the foot?)
All in all, my point is that it is dubious to judge lag based solely on a web demo. One doesn't know what the programmer has done via the GUI layer. Better is to ask: is it in the ball park, and thus worth taking a more serious look?
Don't take things too critically!
I'm just saying that there is some room for improvement, but you're definitely in the ballpark. However, I doubt any of this is due to your GUI code. You'd have to do something really
'lazy' for that to make much difference.
Your code for timing events could be improved though - maybe do the initial play() / start() whatever in the actionPerformed() method, and then post subsequent events into a Timer or ScheduledExecutorService.
For one, Java JButtons don't send events until the MouseUp occurs. So the sounds will naturally seem to fall behind the clicks. Maybe I should create MouseDown sensitive "touchpads." (
I'm planning on some of those for JAudioLibs (recently been having conversation with another audio developer about adding some useful GUI widgets) but that won't be until the new year. Like you - other priorities.
However, quick fix for your applet might be to add mouse listeners to the JButtons instead of action listeners, and fire on mousePressed().
We need a smiley icon for "bangs-head-against-wall".
I'm sure we used to have one of those?!