diff --git a/mididebug.js b/mididebug.js new file mode 100644 index 0000000..e4278ca --- /dev/null +++ b/mididebug.js @@ -0,0 +1,16 @@ +const midi = require('midi') + +let mo = new midi.Output() +let mi = new midi.Input() + +mo.openVirtualPort("debug-out") +mi.openVirtualPort("debug-in") + +mi.on('message', (deltaTime, message) => { + // The message is an array of numbers corresponding to the MIDI bytes: + // [status, data1, data2] + // https://www.cs.cf.ac.uk/Dave/Multimedia/node158.html has some helpful + // information interpreting the messages. + console.log(`midi in: ${message} d: ${deltaTime}`) + mo.send(message) +})