Im new to java and im creating a test application demonstrating creating sounds. i have this test code:
public class MiniMiniMusicApp {
public MiniMiniMusicApp(){
}
public void play(){
try{
Sequencer player = MidiSystem.getSequencer();
player.open();
Sequence seq = new Sequence(Sequence.PPQ, 4);
Track track = seq.createTrack();
ShortMessage a = new ShortMessage();
a.setMessage(144,1,20,100);
MidiEvent noteOn = new MidiEvent(a, 1);
track.add(noteOn);
ShortMessage b = new ShortMessage();
a.setMessage(128, 1, 44, 100);
MidiEvent noteOff = new MidiEvent(b, 3);
track.add(noteOn);
Track[] t = seq.getTracks();
player.setSequence(seq);
player.start();
System.out.println("Done");
}
catch (Exception ex){
System.out.println("Ooops something went wrong");
ex.printStackTrace();
}
}
}
and i can hear no sound. I've read somewhere that i need a soundbank, so i downloaded the deluxe version from here and i have copied it into C:\Program File\Java\jdk1.7.0_45\jre\lib created a folder called audio and copied soundbank.gm in there. What am i missing here?