How can I make a method that in one instant plays an ArrayList of notes (ints, I suppose)? I'm looking for something like

public static void playNotes(ArrayList<Integer> notes, volume) {
// code

So far, I have found a code that plays a single note, ( /home/matthias/java/jsresources/examples/src/ ), but the problem looping through my notes with this code, is that it will only play one note at a time, as it does not continue executing my code until it is done playing the note. I really don't want the playing of the notes to postpone the rest of runtime.

How should I attack this?