Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-players enabled #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Multi-players enabled #13

wants to merge 2 commits into from

Conversation

efreja
Copy link
Contributor

@efreja efreja commented Jun 25, 2019

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

Element styles are transformed to class styles so that several players can have the same style
@lpugin
Copy link
Contributor

lpugin commented Jun 26, 2019

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

@efreja
Copy link
Contributor Author

efreja commented Jun 26, 2019

Done. Hope it's complete.
BR

Interface changed:
- No need for having an extra link for loading the song when it's time to play it: This function (loadScore) is passed to MyPlayerClass constructor
- It's the 'play' button of the player that starts the MyPlayerClass play method
@efreja
Copy link
Contributor Author

efreja commented Oct 15, 2019

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
Copy link
Contributor Author

efreja commented Oct 16, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants