ryoyakawai / smfplayer

JavaScript Standard MIDI File Player
http://ryoyakawai.github.io/smfplayer/
Other
71 stars 19 forks source link

GM player plays notes from soundfont, but no sound emits when playing a midi file. #2

Open Fcasualty opened 8 years ago

Fcasualty commented 8 years ago

I am attempting to replicate the functionality of this midi file player with verbatim files and html.

Despite no errors (except a favicon 404 error), no sounds emit when playing a midi file.

However, events are displayed in the event monitor as if they're being played.

I have no issue running the demo

Please indicate anything that you believe could be causing this issue

ryoyakawai commented 8 years ago

Hi! Several questions: (1) Does GMPlayer display in your site? (2) In this app, "{"sysex":true}" is configured at requestMIDIAccess(), so the app MUST be accessed over SSL(https) except the app is hosted in "localhost" domain.

If your application allows to use Polymer, check this out App Source . wm-webmidilink is element to emulate MIDI output device, and it can handle as same as external MIDI devices by Web MIDI API in really simple way.

Fcasualty commented 8 years ago

Thank you for the thorough response and contribution.

The GMPlayer does display on my site, and given your details, it appears my first step will be to enable https. This critical detail of my implementation eluded me: In order to load the page, I had to remove the script in the html that forces https (as does a forked version).

If my estimation of this project's potential for my purpose is accurate, I will be following it closely and will indicate whether any difficulties arise following my updates

Fcasualty commented 8 years ago

Apparently, I can run https, but it is read as 'non-private' which is causing a SSL error when the service worker's registration is attempted. I have received no correspondence from StackOverflow or the Web2py group on how to resolve the https issue.

If you know of any alternative to test with this soundfont player without https (i.e. localhost), your suggestion would be much appreciated.

ryoyakawai commented 8 years ago

Running service worker requires genuine SSL certificate, and service worker(offline feature) is not required to run soundfont. So If you do not mind to remove service worker, please delete a line in index.html line 25. But if you need offline feature, I guess you need to have SSL certificate for your host.

<script type="text/javascript" src="./register_sw.js"></script>
Fcasualty commented 8 years ago

I attempted to remove the service-worker line and tried with and without https, but no luck.

If I have a soundfont on my server, Which would be the best web-midi source to start with to play midi files (without GUI)?

Any further detail on how to get this up and running would be greatly appreciated

Please indicate whether any details need posted from me

ryoyakawai commented 8 years ago

Well, https are required to use sysex. Did you update to {sysex:false} at requestMIDIAccess()?

Anyway, sf2synth.js is NOT mine, I am using it through WebMidiLink. So, my recommendation would be fork sf2synth.js and modify it by your self and use it as same as sf2synth.js is doing to play SMF.

Fcasualty commented 8 years ago

Yes. It appears I've tested with all if not most combinations of settings. The last test was with: sysex:false, service-worker line removed, no https, uploading own sf2.

New to github, I was just scanning midi projects by most recent updates and noticed the sf2synth source. I'll take a look when I can. Thanks for your patience if any obtuseness in this process. Very small tweaks here could mean a lot.

DevanWolf commented 7 years ago

GMPlayer still had no sound for me.