-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js: WebMidi not enabling #252
Comments
I now realise I was using an outdated version, but in the most recent version on npm webmidi just doesn't want to enable |
I cannot reproduce the problem. Can you provide a little more info? For instance, are you running this code in Node.js or in a browser? Since you mentioned Node.js v17.2.0, I assume you are running it in Node.js. I just tried running the code below and it worked fine in Node.js v16.11.1 and v17.8.0. This is using the module approach: import {WebMidi} from "webmidi";
WebMidi
.enable()
.then(onEnabled)
.catch(err => console.log(err));
function onEnabled() {
console.log('WebMIDI enabled!');
const output = WebMidi.outputs[0]
const channel = output.channels[1];
console.log(channel);
channel.playNote('C5', {duration: 5000})
} This is using the classic approach: const {WebMidi} = require("webmidi");
WebMidi
.enable()
.then(onEnabled)
.catch(err => console.log(err));
function onEnabled() {
console.log('WebMIDI enabled!');
const output = WebMidi.outputs[0]
const channel = output.channels[1];
console.log(channel);
channel.playNote('C5', {duration: 5000})
} I was using WEBMIDI.js v3.0.15. |
I'm running this in Node.js, yes, also running WEBMIDI.js v3.0.15. I think in the meantime I'll try to update my node version and try again. |
I just ran your code and it was working fine for me (I only had to change the name of the MIDI device to match my own). Here's the output I got:
|
Weird, it still doesn't output anything for me. Could it be another Apple Silicon ARM64 thing? |
I don't know why it would be related to the new processor but who knows? Unfortunately, I only have an "old" Macbook to test it on. Are you still getting the |
The |
After some more testing, I have a hunch it maybe be an issue on the JZZ-soft side of things. I tried running their test suite and unfortunately only passed one test out of the 28 or something. I've opened an issue on their repo. |
@PimTournaye Thanks for reporting back. If that is indeed the problem, it will most likely affect other users of WEBMIDI.js. Keep me posted! |
Will do! Running the script through a Rosetta terminal makes it work for now! I'll try to see if I can see what causes it to act out on Apple Silicon |
Interesting. Maybe there is indeed a compatibility issue with Apple Silicon. Let's wait and see what the Jazz-Soft team says. |
@PimTournaye Can you try out version 3.0.20 (available now on npm) and see if it fixes your issue. A regression problem has been uncovered (and fixed) and perhaps it relates to your problem. |
I've booted up my project again without Rosetta and WebMidi is unfortunately still not enabling. |
@PimTournaye Thanks for taking the time to check it out. An update from the Jazz-Soft team is expected soon. Maybe it'll help with Node.js compatibility... |
Found something weird, when using Vite in my project, WebMidi does enable on a non-Rosseta terminal. Will try to look into this more. |
I'm also seeing this issue on Apple Silicon. As far as I can tell, jazz-midi does not include a build for darwin arm64, so it fails when trying to load up. |
@teropa Thanks for the feedback. I guess we will have to wait for the jazz-midi team... |
Issue #10 for the |
Hi @djipco , I'm the one who opened the issue you referred to. It seems it should be closed after this commit jazz-soft/jazz-midi@d67f8c3 from two weeks ago. |
@AMabona Thank you so much for letting me know! I just released v3.0.24 of WEBMIDI.js which now depends on v1.5.6 of the Unfortunately, I don't have an M1 to test it with. Perhaps @PimTournaye or @teropa could try it out and let me know? Thanks! |
Did a quick test, so far everything is working from a non-Rosetta process. Thanks for the update! If anyone does experience issues, do keep reporting and feel free to reopen this issue. |
Getting the following error: (note: I changed filepaths in this report)
Environment:
Specify the environment where you are witnessing the problem:
I'm using webmidi: "^3.0.0-alpha.26"
The text was updated successfully, but these errors were encountered: