If you have a MIDI input of some sort, try out the demo here.
This is a very basic demo of how to use the Web MIDI API. I pulled in the Tone.js library to handle audio output so that the demo provides a bit better feedback.
Please not that you will not be able to hear audio until you click the "Enable Audio" button. Or at least this is definitely the case in Chrome or Chromium-based browsers. This is evidently a Google Chrome policy to improve user experience by preventing annoying autoplay audio.
- MDN Web MIDI API Docs
- Getting Started with the Web MIDI API - Smashing Magazine - this one's a bit dated, but still a good resource
- webMIDI.js - you will probably use this if you intend to do anything serious with MIDI on the web