MIDI debug app helper
parent
6cb1064250
commit
4676c61a75
|
@ -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)
|
||||||
|
})
|
Loading…
Reference in New Issue