midi-player icon indicating copy to clipboard operation
midi-player copied to clipboard

Multi-players enabled

Open efreja opened this issue 6 years ago • 4 comments

  • 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.

efreja avatar Jun 25 '19 21:06 efreja

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

lpugin avatar Jun 26 '19 06:06 lpugin

Done. Hope it's complete. BR

efreja avatar Jun 26 '19 09:06 efreja

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.

efreja avatar Oct 15 '19 21:10 efreja

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.

efreja avatar Oct 16 '19 08:10 efreja