javascript version of midi class php using midi.js library