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

Hardcoded soundfont path prevents loading from CDN into <script> tag #115

Closed
jacobtylerwalls opened this issue Jul 25, 2021 · 3 comments · Fixed by #261
Closed

Hardcoded soundfont path prevents loading from CDN into <script> tag #115

jacobtylerwalls opened this issue Jul 25, 2021 · 3 comments · Fixed by #261

Comments

@jacobtylerwalls
Copy link
Member

We should make it so that you can just get a CDN URL for this repo and plug it into a <script> tag and be able to use the project. Currently the hardcoded soundfont path prevents it (we should just disable playback rather than not load the project).

Matteo discovered a workaround, but the workaround doesn't work for just loading into a simple HTML page or trying to use JSFiddle as a sandbox.


As for the second issue, I managed to fix it in the following way. Is it the way it should be done, though?

import { common } from "music21j/releases/music21.debug"
common.urls.soundfontUrl = "./soundfonts/midi-js-soundfonts-master/FluidR3_GM/"

Thank you again

Originally posted by @mttbernardini in #58 (comment)

@mscuthbert
Copy link
Member

You used to be able to put the soundfont url as a data-* attribute in the script tag and music21j would use that instead. I haven't investigated if it still works though.

@jacobtylerwalls
Copy link
Member Author

IMO this right here is worth documenting in the README. I'll get to it at some point.

<script>
    window.m21conf = { loadSoundfont: false };
</script>

mscuthbert added a commit that referenced this issue Aug 21, 2024
Fixes #115

Give instructions on how to use music21j remotely without hosting yourself.

Also: Fix problems with articulations and expressions without Vexflow versions.  Make length expressions play back better.
@mscuthbert
Copy link
Member

I think that this is now fixed in #261. Let me know if it's still a problem.

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 a pull request may close this issue.

2 participants