I wonder If it is possible to access MIDI ports in Emscripten compiled Pure Data / Ofelia patches.
At least the browser needs to access MIDI for that.
For that I adapted a web midi java script from this synth: https://webaudiodemos.appspot.com/midi-synth/index.html
so that you can choose MIDI in and out ports in the browser (only Chrome at the moment).
https://webmidi.handmadeproductions.de/
webMIDI.zip
It is my first java script, so I am sure it can be improved.
If it is not possible to use it with Ofelia / Emscripten it is perhaps useful for something else.
Here I found a project that uses C++ compiled with Emscripten and the parameters are controllable with web MIDI:
https://ccrma.stanford.edu/~jatin/220a/fp.html