private static void initSequencer(javax.sound.midi.Sequence s, float t) {
		if (sequencer != null) {
			// if the sequencer is already running, wait for it to stop
			while (sequencer.isRunning()) {
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					System.err.println("Error: (play) failure waiting to play next sequence");
					//e.printStackTrace();
				}
			}
		}
		try {
			sequencer = MidiSystem.getSequencer();
			sequencer.open();
		} catch (MidiUnavailableException e) {
			System.err.println("Error: (play) cannot get MIDI Sequencer");
		}
		try {
			sequencer.setSequence(s);
		} catch (InvalidMidiDataException e) {
			System.err.println("Error: (play) cannot set sequence for MIDI sequencer");
		}
		if (t > 0) {
			sequencer.setTempoInBPM(t); // set tempo if specified
		}
		sequencer.addMetaEventListener(new MetaEventListener() {
			public void meta(MetaMessage m) {
				if (m.getType() == 47) {
					sequencer.stop();
					sequencer.close();
				}
			}
		});
		sequencer.start();
	}