Page 1 of 1

Dropping Note Events (regression)

Posted: Tue Jun 05, 2018 11:43 am
by damon
I'm noticing missing note events with the latest versions of both jzz and web-midi-api. When more that one note-in event happens simultaneously, only one of the events is registered. This happens in the latest version of jzz and web-midi-api with Node.js.

I do not observe this behavior with web-midi-api v 1.x. I do not notice any missing events when I roll back to that version.


Re: Dropping Note Events (regression)

Posted: Tue Jun 05, 2018 8:40 pm
by sema
You observe this on Mac, correct?
I'll look into the issue...

Re: Dropping Note Events (regression)

Posted: Wed Jun 06, 2018 7:12 am
by damon
Yes, on a Mac. When I have a chance I'll test on Rasperry Pi.

macOS 10.13.4
Node 8.11.2
jzz 0.4.9 (broken)
web-midi-api 1.4.4 (works)

Thanks for your help!

Re: Dropping Note Events (regression)

Posted: Thu Aug 16, 2018 7:54 am
by damon
Has there been any movement on this? I'm still seeing the behavior in the latest version.

Re: Dropping Note Events (regression)

Posted: Thu Aug 16, 2018 8:51 am
by sema
I think I know what was the problem. Hopefully it will be fixed in the next release.

Re: Dropping Note Events (regression)

Posted: Fri Nov 09, 2018 3:24 pm
by damon
I still experience this issue in 0.6.1. Let me know if there's anything I can do to help troubleshoot.

macOS 10.13.6
Node 10.13.0

Re: Dropping Note Events (regression)

Posted: Sun Nov 11, 2018 1:54 pm
by sema
Well, I'll meed another look into it then. Apparently, the problem I fixed was not the one you observed.
If you give me instructions how to reproduce the problem, that would be really helpful.

Re: Dropping Note Events (regression)

Posted: Mon Nov 12, 2018 8:07 am
by damon
I find that simply sending two or more notes events at the same time will result in at least one of them being dropped a significant majority of the time. I'm not sure exactly what the definition of "at the same time" is, but it is easy to reproduce by playing a chord on a MIDI keyboard. I do think it's possible that there has been some small improvement in recent updates. That is, when I first encountered this it was 100% consistent while now I will occasionally see all events reported, though rarely. Thanks for your attention to this.

Re: Dropping Note Events (regression)

Posted: Sat Nov 24, 2018 9:19 pm
by sema
Here is my test script. It generates several simultaneous messages and receives all of them.
Seems to work on my Mac.

Code: Select all

// test.js
var jazz = require('jazz-midi');
var test = require('midi-test');
var midi = new jazz.MIDI();

var port = new test.MidiSrc('VIRTUAL MIDI-In');

midi.MidiInOpen('VIRTUAL MIDI-In', function(t, msg) {

setTimeout(function() {
  console.log('Sending MIDI...');
  port.emit([0x90, 0x40, 0x7f]);
  port.emit([0x90, 0x44, 0x7f]);
  port.emit([0x90, 0x47, 0x7f]);
  setTimeout(function() {
  }, 100);
}, 100);
npm install jazz-midi
npm install midi-test
node test.js

Do you observe the problem in Node.js or in browser?

Re: Dropping Note Events (regression)

Posted: Tue Nov 27, 2018 9:53 pm
by damon
I am only using JZZ in Node.

The script you posted works, and I haven't seen the problem with virtual ports (but the only other virtual source I've tested is Max). The problem is happening with actual MIDI hardware. Upon further testing, I find it's only on some MIDI hardware.

I think this log output using your script, but with the MIDI coming from external gear, may shed a little light on what's going:
[ 144, 63, 127 ]
[ 144, 60, 127 ]
[ 128, 60, 64, 128, 63, 64 ]
[ 144, 67, 127, 144, 70, 127 ]
[ 128, 67, 64, 128, 70, 64 ]
[ 144, 67, 127, 144, 68, 127 ]
[ 144, 60, 127, 144, 62, 127, 144, 63, 127, 144, 65, 127 ]
[ 128, 68, 64 ]
[ 128, 63, 64, 128, 65, 64 ]
[ 128, 67, 64 ]
[ 128, 60, 64 ]
[ 128, 62, 64 ]
I this example, you can see the first two note-ons came separately, but the following note-offs came jumbled up in one message. The second two note-ons and offs also were each sent together (respectively). Then I played six notes at once and it all came and went in kinda random clumps...

I only have a couple of MIDI devices to test this with so I can't speculate on how widespread this is. The offending instrument demonstrated above is the Korg nanoKontrol (the old one, not the current one). I haven't noticed this behavior in other contexts. It also doesn't happen in the old web-midi-api 1.x.

Re: Dropping Note Events (regression)

Posted: Wed Nov 28, 2018 9:29 am
by sema
Thank you for the data! That was very helpful!
Now I can fix it in the nearest future :)

Re: Dropping Note Events (regression)

Posted: Wed Nov 28, 2018 6:55 pm
by damon
Great! Thanks for your help on this.

Re: Dropping Note Events (regression)

Posted: Mon Dec 10, 2018 9:39 pm
by sema
I have rebuilt the Mac binaries.
Please try the new v1.6.7 from

I hope I've fixed it this time :)