@kmoon2437/midiplayer
midi/yjk file player
Usage
const fs = require('fs');
const { MidiPlayer,YJKPlayer } = require('@kmoon2437/midiplayer');
let midi = fs.readFileSync('...');
let player = new MidiPlayer(midi);
player.on('midievent',(event,portnum,message) => {
event;
portnum;
message;
});
player.play();
player.pause();
player.tempo;
player.durationTick;
player.durationMs;
player.currentTick;
player.currentMs;
let buf2 = fs.readFileSync('....');
player.load(buf2);
player.play();
let yjk = fs.readFileSync('...');
let player2 = new YJKPlayer(yjk,2);
player2.portCount;
player2.on('midievent',(event,portnum,message) => {
event;
portnum;
message;
});
player2.play();
About yjk file
link