Found this javascript library here:
http://onakasuita.org/jsgme/
Got an example working in C2:
https://www.dropbox.com/s/96184k4okj7vue7/nsf.capx?dl=0
It's very basic and I've lost interest in extending it further. Also I won't be making a plugin version of it.
To use the js at the start of layout loads the js libraries needed and the "loaded" function is triggered when it's ready to play something.
Then to play a file use the execute js action of the browser plugin to run one of these three functions:
play(file, trackNo)
ex: "play(viper.js', 1);"
It loads a file and plays a track. Tracks start at 1.
playTrack(trackNo)
ex: "playTrack(3);"
It changes the playing track of the loaded file.
stop()
This unloads the file and stops playback. To play again you need to use the "play" function.
EDIT:
I just realized that the library used can play all kinds of video game music.
https://bitbucket.org/mpyne/game-music-emu/wiki/Home
eg. nes, sega genisis, gameboy, super nintendo