Open jellohouse opened 1 year ago
Hey Jellohouse. Great to hear you are interested in this library!
I just tried it in a vanilla node project and it seems to work for me.
Here is my index.js
const pioneerddj = require('pioneer-ddj');
const ddj = new pioneerddj.DDJ('DDJ-400', {});
ddj.on('play', ({ side, state }) => {
console.log(`Play buton ${state ? 'pressed' : 'released'} on ${side} side!`);
});
which I run with node index.js
Is it possible the electron webpack compiler is doing something funny to the import?
I'm on node v16.
You may still get an error if your device is not plugged in, or can't be found.
Error: No MIDI input found with name: DDJ-400
Hey Isei! Thanks for the quick response!
Yeah I think it's highly possible that electron is causing this issue. Something with the way it's imported.
I've also tried: import pioneerddj from 'pioneer-ddj'
but with no luck.
I'm currently running node v14.5.0 and Electron v19.0.8
Are you importing it in the electron main node.js thread or the renderer? It's possible due to Electron's security policy it won't come up in the renderer and you will need to create a bridge.
Does it work if you import and instantiate the class from the main src/index.js
file?
Hey man sorry for the late reply. But yes, I am using it in the renderer... I guess that's why. Any idea on how I could make this bridge? Do you have an example of you using it in Electron somehwere?
Also qucik unrelated question - do you know if the controller emits any midi events on beat or about current time? I would like to get the current beat/time in my app :)
Hey!
I'm trying to use this module inside of an Electron / React app I'm building.
Unfortunately I get an error saying that: pioneerddj.DDJ is not a constructor on the line where I create a "new" ddj
Also on a side note, there is a good Midi library https://github.com/djipco/webmidi which I think could be worth looking into. (instead of easymidi).
Would love to get this working - any help would be greatly appreciated.