-
Notifications
You must be signed in to change notification settings - Fork 642
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
Provide loading process feedback #59
Comments
Hi (just scanning over the code now), the problem is that when USE_XHR is turned on that it's expecting a JSON object, and it's getting a JS file. So, either the code could be rewritten to use JS dynamical script include, or to convert the soundfont into JSON. To get JS to work (instead of recompiling the soundfonts into JSON) replace this: MIDI.Soundfont[instrumentId] = JSON.parse(response.responseText); With this: var script = document.createElement("script"); script.language = "javascript"; script.type = "text/javascript"; script.text = response.responseText; document.body.appendChild(script); Inside the MIDI/LoadPlugin.js file, there's two places to replace that, so might as well make into a helper function. And then maybe add in USE_XHR_JS option, so the JSON still works. Feel free to submit changes :) |
Hallo Michael, only running on firefox, if call: MIDI.noteOn(2, 21, velocity, delay) sounds a Bass instead of a drum, and It happens just with some notes. regards, |
Your app looks great, I'm enjoying the quality of encoded media--deep bass! I don't have the free time to take a look into this. MIDI.js was made primarily for Color Piano to work, so I did not do much testing with multiple instruments. I know others have fixed this since in their own implementations, but unfortunately, they did not share their code back. I imagine it'd take me a few hours to get working. If you want to hire me, send me an email at admin@sketch.io |
Hallo Michael, Regards |
I may be getting some client work soon surrounding this, and will be able to push changes to the MIDI.js project—I'll keep you in the loop on developments on this. Yeah, feel free to create a new issue, it's always helps to hear back from dev's who've done their own testing. |
Latest dev version supports progress events. |
Hallo Michael,
i'm trying to set the flag USE_XHR to true to get some loading progress feedback to build an animation, but i'm getting always an error on the following line:
MIDI.Soundfont[instrumentId] = JSON.parse(response.responseText);
JSON reports invalid character by parsing. I'm loading standard instruments from "midi-js-soundfonts" that works fine when USE_XHR is set to false.
Do you have an idea of what could be the reason?
Thanks for your help and your great job!
The text was updated successfully, but these errors were encountered: