is there a way to "catch" event when i physically press a note? #287
Unanswered
VergilDMC00
asked this question in
Q&A
Replies: 2 comments 1 reply
-
What you describe is literally the first example of the Quick Start guide. I suggest you begin with that. 😉 P.S. I moved your post to the "Discussions" section since it does not appera to be a bug with the library. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can listen at the device level or at the channel level. Here's how to listen to incoming messages at the device level: const mySynth = WebMidi.inputs[0]; // First available MIDI input device
mySynth.addListener("noteon", e => console.log(e)); Here's how to listen on a specific MIDI channel (10 in this case): const mySynth = WebMidi.inputs[0];
mySynth.channels[10].addListener("noteon", e => console.log(e)); If you want to view the input devices that are detected on your machine, you can use: console.log(WebMidi.inputs); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i have a problem with the libraries, i have a physic piano and i would like to know when someone is physically pressing one of the note, is there a way to "catch" that event? I have tried with listening to all channel on the device, but when i phisically press the note it doesnt catch anything while when i "press" the note wit the support of js the event is emitted i am able to catch it
Beta Was this translation helpful? Give feedback.
All reactions