Skip to content
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

Lost contemporary MIDI message from controller #237

Open
glitched0xff opened this issue Mar 12, 2024 · 0 comments
Open

Lost contemporary MIDI message from controller #237

glitched0xff opened this issue Mar 12, 2024 · 0 comments

Comments

@glitched0xff
Copy link

Hi folks
Thanks for your work. I'm using midi 2.0 npm in nodejs v20.10.
I'm having some trouble with this simple code. Seem like that i lost comtemporary message coming from MIDI controller.
For example moving modwheel and press a note on keyboard i usually lost the noteOn if the event is in the same time.
I try some different controller and the result is the same
Here is the simple code bring from documentation

const midi = require('midi');

// Set up a new input.
const input = new midi.Input();

let last
// Count the available input ports.
let inputs=input.getPortCount();
console.log(inputs)
// Get the name of a specified input port.
input.getPortName(0);
for (let i = 0; i < inputs; i++) {
    let name=input.getPortName(i);
    console.log(name)
}

// Configure a callback.
input.on('message',async (deltaTime, message) => {
  if (message!=banMessage[0]){
    console.log(`m: ${message} d: ${deltaTime}`);
    last=message
  }
   
});

input.openPort(0);
input.ignoreTypes(false, false, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant