Wow, thankyou so much for this!! It appears to be working perfectly playing tracks, and I assume you can pass functions to it like stop and paused, since playSong works? This is perfect, I think it could be developed into an amazing, fully-featured OPL-emulator if worked on (like I said, I'd love to if I had any javascript knowledge at all!) especially useful if folks wanted tempo changes or even pitch transposition.
Thanks for this, I can totally use this in game as it is!