jazz-soft / jazz-midi

MIDI support for Node.js and browsers
https://jazz-soft.net
19 stars 4 forks source link

State change events do not seem to be firing in Node.js #8

Open djipco opened 2 years ago

djipco commented 2 years ago

I am trying to detect when a device is being connected or disconnected but state change events do not seem to be firing. Here is a bit of code that demonstrates the problem:

const navigator = require("jzz");

navigator.requestMIDIAccess().then(interface => {

  console.log("Enabled!");

  interface.onstatechange = function (e) {
    console.log(e);
  }

});

If I run this code in Node.js, I do see "Enabled!" in the console. However, if I try to plug or unplug a device, nothing happens. I was expecting the onstatechange function to be triggered. Are my expectations wrong? Or perhaps there is something else at play?

This is on macOS Monterey with Node v17.8.0

jazz-soft commented 2 years ago

Thanks a lot for the notice! Will try to fix it during the weekend...

jazz-soft commented 2 years ago

The issue seems to be in the jazz-midi module. I guess it will take some more time to fix...

djipco commented 2 years ago

Do you have an ETA for the fix ?

jazz-soft commented 2 years ago

Sorry, have to be patient...

jdlee022 commented 2 years ago

Any update on this?

djipco commented 2 months ago

I just tried it with jzz 1.8.5 and the problem is still there.

jazz-soft commented 1 month ago

Unfortunately I'm swamped with other stuff... I would appreciate if anybody could fix it...