This is an AdLib / Yamaha YM3812 emulator I wrote in October 2016; it's not quite feature-complete — there are some issues with envelopes.
It plays a song called Crooner by Drax, adapted for AdLib by JCH which was used in various demos and BBS intros (like this one which was ubiquitous in the local BBS scene and I wrote a javascript emulator of it, too). The song was bundled with the Vibrants custom song editor EdLib which was in my opinion the best sounding AdLib music player I ever heard.
Press the button to hear it.
In order to write this emulator, I actually bought a spare YM3812, hooked it up to a Teensy microcontroller, sent commands to it and captured the digital output over a serial port. Then I could recover the envelopes of the sounds it played and figure out how the envelope internal counters worked.
Source code here -- this is the emulator for the AdLib chip and also the Vibrants .D00 format player, as well as a python notebook and samples from my reverse engineering process (both reverse engineering the chip from its output and the .d00 player from its DOS binary!).
It's almost capable of playing other songs, too, but this was the only one I got 100%.
The OPL2 is an extremely clever design: there's a \log_2 \sin(x) table in ROM, as well as a 2^x ROM for x = [0.5 .. 1] in fixed point. All envelopes and modulation are done in logarithmic space, then exponentiated with a table lookup and bit shifts. This way it doesn't need to perform any multiplications at all.
There are other, better OPL2 emulators, but this one is mine.