Multi-players enabled
- In midiplayer.css file, Element styles are transformed to class styles so that several players can have the same style
- in midiplayer.js file:
- The CircularAudioBuffer was transformed to a javascript class
- currentPlayer contains the current player (instance of class MidiPlayerClass)
- The MidiPlayerClass javascript class was created, and each time you need a midi player, you must instanciate this class.
Could you submit a corresponding PR to the gh-pages branch? If this is merge we need the gh-pages with the example how to use it to be inline with it. Thanks
Done. Hope it's complete. BR
Hello, I have made changes used by https://wordpress.org/plugins/music-sheet-viewer v2.2 This version makes the scores playable with an enhanced version of midi-player. The enhancement compared to the version commited in june has simplified the player behaviour as no extra link (kinda load link) is necessary: The score is loaded the first time the play button is clicked. Moreover, the player is responsive, and the look has changed a little.
Please also note that if the player is deployed in a web server, we must set the Javascript variable MidiPlayer_filePackagePrefixURL to point the location where wildwebmidi.data is located otherwise it's missing when midiplayer.js is loaded. Consequently, it must be assigned before midiplayer.js is loaded.
Example of what has been done for https://wordpress.org/plugins/music-sheet-viewer v2.2:
var MidiPlayer_filePackagePrefixURL = "http://www.partitionnumerique.com/wp-content/plugins/music-sheet-viewer/js/";
is generated in the page's header generated by the plugin. On its side, midiplayer.js is loaded in the footer.