Comments (8)
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.
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.
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.
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.
@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.
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.
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.
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.
from midifile.
Related Issues (20)
- Fix browser support badge/build HOT 1
- Incorrect path to webMIDIAPIShim in tests/index.html. Incorrect handling of midiOutput HOT 1
- Uncaught (in promise) TypeError: createParser is not a function HOT 1
- stream.end is not a function running example code HOT 3
- Fix dist build. HOT 8
- Reading MIDI track labels as String HOT 2
- Uncaught ReferenceError: MIDIFileHeader is not defined HOT 3
- Getting events for large midi's (black midis) takes FOREVER HOT 5
- Add Audio engine to play notes HOT 19
- Add more musical instruments
- midi file unsupported (apparently) HOT 6
- How to read a midi file to get the ArrayBuffer? HOT 2
- Please provide single-file version to use in browser (.js and .min.js) HOT 1
- Is the playTime of the lyrics in milliseconds? HOT 1
- Use correct pitch-bend range HOT 4
- Merge improvements (pitch bend, `parseSong()`, ...) from `webaudiofont` HOT 10
- Argument missing HOT 1
- variable declared twice HOT 4
- Documentation for writing MIDI files HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midifile.