Midi input (console log za zdaj)
parent
5be48cffe7
commit
413900467c
24
#test.html#
24
#test.html#
|
@ -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>
|
11
server.js
11
server.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue