@kmoon2437/midifile
midi/yjk file parser
About yjk file
The yjk(YJKaraoke) file is a file format created for use in yj-karaoke-player.
Usage
const fs = require('fs');
const { MidiFile,YJKFile,YJKFileConverter } = require('@kmoon2437/midifile');
let midi = fs.readFileSync('...');
let file = new MidiFile(midi);
file.header.format;
file.header.ticksPerBeat;
file.header.tickResolution;
file.header.tracksCount;
file.header.durationTick;
file.header.durationMs;
file.tracks;
file.tempoEvents;
let yjk = fs.readFileSync('...');
let file2 = new YJKFile(yjk);
file2.header;
file2.globalEvents;
file2.tempoEvents;
file2.ports;
let midi2 = fs.readFileSync('...');
fs.writeFileSync('./test.yjk',YJKFileConverter.midi2yjk(midi2));
Others
This library is using midifile to parse midi files.