Web MIDI: keys
A Tcl script in this page asks for the MIDI ports of the computer with web::midi::request. A press of a key of the page sends a note to the first MIDI output, such as a synthesizer, and each note from a MIDI keyboard lights its key. The script runs in ztcl-host.wasm with the grants dom, event, and web:midi.
The browser asks for the MIDI access after the click. The script is below, and the guide to Web MIDI tells how it works.