2.0.2-pareo1 • Published 3 years ago
zxe-midi-player v2.0.2-pareo1
zxe-midi-player
midi file player
Usage
const fs = require('fs');
const { MidiPlayer,ZKPlayer } = require('zxe-midi-player');
let midi = fs.readFileSync('...'); // your midi file. it can be an ArrayBuffer or Uint8Array or nodejs Buffer
// insert buffer
let player = new MidiPlayer(midi);
player.on('midievent',(event,portnum,message) => {
event; // information of event
portnum; // port number. I put it in advance to support the port prefix meta event
message; // midi message. if it is null, this event is meta event
});
player.play();
player.pause();
player.tempo; // similar to HTMLMediaElement.playbackRate
player.durationTick; // same as MidiFile.header.durationTick
player.durationMs; // same as MidiFile.header.durationMs
player.currentTick;
player.currentMs;
let buf2 = fs.readFileSync('....'); // another midi file
player.load(buf2); // loading another midi file
player.play();
let zk = fs.readFileSync('...'); // your zk file. it can be an ArrayBuffer or Uint8Array or nodejs Buffer
// The usage is similar to MidiPlayer.
let player2 = new ZKPlayer(zk,2); // 2 = port count
player2.portCount; // port count
player2.on('midievent',(event,portnum,message) => {
event; // information of event
portnum; // port number
message; // midi message. if it is null, this event is meta event
});
player2.play();
About zk file
2.0.0-pareo1
3 years ago
2.0.1-pareo1
3 years ago
1.1.8-chuchu0
3 years ago
2.0.2-pareo1
3 years ago
1.1.6-chuchu0
3 years ago
1.1.7-chuchu0
3 years ago
1.1.1-chuchu0
3 years ago
1.1.0-chuchu0
3 years ago
1.1.3-chuchu0
3 years ago
1.1.2-chuchu0
3 years ago
1.1.4-chuchu0
3 years ago
1.1.5-chuchu0
3 years ago
1.0.9-chuchu0
3 years ago
1.0.10-chuchu0
3 years ago
1.0.8-chuchu0
3 years ago
1.0.7-chuchu0
3 years ago
1.0.6-chuchu0
3 years ago
1.0.5-chuchu0
3 years ago
1.0.4-chuchu0
3 years ago
1.0.3-chuchu0
3 years ago
1.0.2-chuchu0
3 years ago
1.0.1-chuchu0
3 years ago
1.0.0-chuchu0
3 years ago