Hello!
For more than a year, we have been developing an open-source MIDI state-tracking solution called Octavia, which is almost 100% XG-compliant (XG level 3) with limited support on S90 ES and Motif ES, while also supporting other standards/synths. Currently, it can be used to write complicated visualizers, and we expect to add routing and real-time instruction translation support (e.g. XG/GS) in the near future. It's written in JavaScript, targeting browsers and Deno, has versions that can run on Windows XP, and can function with or without Web MIDI API.
The source code is available on GitHub, and the library itself could be get from either GitHub or Deno Modules. There are demos available for everyone to try out, no installation required; although since the forum rules on links confused me, I'm not posting them yet to play it safe.
I don't know where to put this post under, might've posted at the wrong place.