MIDI debug app helper

main
Jurij Podgoršek 2022-09-14 18:48:48 +02:00
parent 6cb1064250
commit 4676c61a75
1 changed files with 16 additions and 0 deletions

16
mididebug.js 100644
View File

@ -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)
})