//Author: John T. Rine //04-10-2011 import javax.sound.midi.*; public class simpleMidiNote { public static void main (String args[]) throws Exception { //http://download.oracle.com/javase/tutorial/sound/MIDI-messages.html ShortMessage myMsg = new ShortMessage(); // Start playing the note Middle C (60), // moderately loud (velocity = 93). myMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93); long timeStamp = -1; Receiver rcvr = MidiSystem.getReceiver(); rcvr.send(myMsg, timeStamp); //http://download.oracle.com/javase/tutorial/essential/concurrency/sleep.html //Pause for 4 seconds Thread.sleep(4000); } }