Midi input (console log za zdaj)

kegel
Jurij Podgoršek 2022-06-28 18:34:54 +02:00
parent 5be48cffe7
commit 413900467c
2 changed files with 11 additions and 24 deletions

View File

@ -1,24 +0,0 @@
<html >
<head>
<meta charset="UTF-8">
<title>cancerainbow test</title>
<style type="text/css">
body {
margin: 0
}
.noUi-target {
width: 500px;
}
table tr td {
padding-top: 1rem;
}
</style>
</head>
<body>
<h1>TEST</h1>
<script src="control.js"></script>
<script src="test.js"></script>
</body>
</html>

View File

@ -68,13 +68,24 @@ const server = http.Server(app);
let serijskePovezave = {}
let mo = null
let mi = null
if (MIDI) {
// Midi port
mo = new midi.Output()
mi = new midi.Input()
//mo.getPortCount()
//mo.getPortName(0)
//mo.openPort(0)
mo.openVirtualPort("kegel")
mi.openVirtualPort("ww-midi-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}`);
});
}
function openSerial(ttyAddr) {