Skip to content

Lost contemporary MIDI message from controller #237

@glitched0xff

Description

@glitched0xff

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions