Git Product home page Git Product logo

Comments (8)

argiepiano avatar argiepiano commented on July 19, 2024 1

OK, I just figured out what was going on. The test/index.html player was sending 2 data bytes to the device regardless of MIDI event. Some MIDI events (like Program Change) only have one data byte, while Note On, etc, have 2. This confused the native Web MIDI API in Chrome into thinking that the second data byte (always 0) was a running status message. I just did a Pull Request that fixes a couple of lines. The test/index.html is now working correctly for me!

Thanks for a great library.

from midifile.

nfroidure avatar nfroidure commented on July 19, 2024

If i remind well i had that issue for my poc Karaoke player: http://karaoke.insertafter.com

I thought i got rid of that problem, are you using the latest version?

from midifile.

nfroidure avatar nfroidure commented on July 19, 2024

Looks like running status are decoded there so i assume your issue is related to something else https://github.com/nfroidure/MIDIEvents/blob/master/src/MIDIEvents.js#L259-L268 .

Can you share with me the MIDI file causing that troubles?

from midifile.

argiepiano avatar argiepiano commented on July 19, 2024

I'm not sure what is going on exactly. I've tested the latest version with a slightly modified version of test/index.html to open and send a file you provide in the demo (MIDIOkFormat0.mid). (There are other unrelated issues with that index.html file, which I'll post separately).

When I use Chrome 47 (Mac), which is the only browser that supports Web MIDI API natively (does not rely on Jazz-plugin), I get: Uncaught TypeError: Failed to execute 'send' on 'MIDIOutput': Running status is not allowed at index 2 (0). I created a file that doesn't have running status events, and I don't get the error.

I don't get the error if I use a browser that relies on Jazz-plugin, like Firefox. I hope this helps. I intend to look a bit more deeply into this in the near future.

from midifile.

nfroidure avatar nfroidure commented on July 19, 2024

@argiepiano feal free to share the file with me by email if it is copyrighted. You can also test if with this Karoke player that is using my MIDIPlayer project to see if it is related to the fact the test file is a very poor implementation.

I'm very open to any contribution since i do not find a lot of time to update this library myself.

from midifile.

nfroidure avatar nfroidure commented on July 19, 2024

I just saw the test.html file is using the browserified build, maybe it is outdated. Can you pull my recent changes and try again?

from midifile.

argiepiano avatar argiepiano commented on July 19, 2024

I'll try a bit later.

Also I just did a pull request fixing a few things in the index.html version - the index.html test was not working correctly.

from midifile.

argiepiano avatar argiepiano commented on July 19, 2024

As for the files producing the running status error when sent to the output, it's happening with many of the files you provided in the index.html demo, for example MIDIOkFormat0.mid. I'm attaching two files, one that does not produce the error (trial.mid) and one that does (dablues.mid).

Again, this error is happening in version 1.0.2 when SENDING the info to the output in Chrome, using the demo in test/index.html. I'll try 1.0.3 later.

midifiles.zip

from midifile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.