添加一些关于midi播放的项目

This commit is contained in:
terryLP
2025-03-24 14:30:56 +08:00
parent e31eb22077
commit 498b4ef13b
699 changed files with 186162 additions and 1 deletions
@@ -0,0 +1,24 @@
import SerialPort from "serialport";
import moment from "moment";
export class SerialProxy {
init(port, options, openCallback) {
this.port = new SerialPort(port, options, openCallback);
}
isOpen() {
if (!this.port) {
return false;
}
return this.port.isOpen;
}
write(data) {
if (this.port) {
console.log(`${moment().format("DD/MM/YY HH:mm:ss.ms")}: ${data}`);
this.port.write(data);
}
}
}