@Override public void onInitSuccess(MidiAccess midiAccess) {
		log("Web MIDI initialized.");
		//list input ports
		log("List of input ports:");
		if (midiAccess.getInputs().size() == 0)
			log("- (None)");
		for (MidiInput mi : midiAccess.getInputs())
			log("- " + mi.port.name);
		//list output ports
		log("List of output ports:");
		if (midiAccess.getOutputs().size() == 0)
			log("- (None)");
		for (MidiOutput mo : midiAccess.getOutputs())
			log("- " + mo.port.name);
		log("Playing some notes on the first output port.");
		MidiOutput out = midiAccess.getOutputs().get(0);
		int[] notes = {0x45, 0x49, 0x4C};
		for (int i = 0; i < notes.length; i++) {
			out.send(new int[]{0x90, notes[i], 0x7f}, GwtWebMidi.getPerformanceNow() + (i+1) * 1000);
			out.send(new int[]{0x80, notes[i], 0x7f}, GwtWebMidi.getPerformanceNow() + (notes.length+1) * 1000);
		}
		//listen for input events
		if (midiAccess.getInputs().size() > 0) {
			log("You can play some notes on the first MIDI input port now.");
			midiAccess.getInputs().get(0).addListener(new MidiInputListener() {
				
				@Override public void onMidiMessage(MidiMessageEvent event) {
					log("* Received event: " + event);
				}
			});
		}
	}