WebMIDI.js and Electron?

Just wondering if anyone has tried using this library inside of an Electron App?

I figured I would check in here before dedicating the time to it just in case there are any showstoppers that others have already encountered. Does it work at all? Any limitations with permissions or sysex or anything like that?

Thanks!

Comments

  • Just wanted to report that yes, it works seamlessly. Seems to have SysEx support and does not ask the user for any permissions.

  • @rubendaxThanks for reporting back.

    Version 2.5.x should definitely work in Electron (and NW.js). Version 3 (which is in development) will have to be specifically tested because it also brings support for the Node.js environment. In this case, the question is which engine should be used? The browser's built-in Web MIDI API or the MIDI support provided by Node.js modules?

    Currently, the ESM and IIFE distributions of WebMidi.js v3.x only work in the browser while the CJS distribution only works in Node. In theory, both ESM and IIFE should work without a hitch in Electron but that remains to be tested. I explicitly added the need to have Electron/NW.js examples to the wiki so I wouldn't forget.

  • That's very interesting! I haven't used any node.js MIDI modules so I can't speak to advantages or disadvantages - but my experience with WebMidi.js 2.5.x is that it is very reliable.

    I'm far from an expert... but in regards to security, in Electron, it seems to be best practice to limit the amount of processes which have access to node modules. So this might imply an advantage in some cases to using the built-in WebMIDI support 🤷‍♂️ But if there are differences in regards to factors such as latency or MIDI spec adherence, these should probably take precedent.

  • edited April 23

    If I had to guess, I would go with the browser's implementation over the Node.js module. The reason is that Chrome is much more widely used than the Node.js module and its implementation of the Web MIDI API has probably been more tested than the implementation in the Node.js module (jzz). Having said that, it will need some actual testing on my side before I can make a serious recommendation.

Sign In or Register to comment.