MidiWriterJSJavaScript 多轨 MIDI 生成库
MidiWriterJS 是一个 JavaScript 库, 提供用于生成表现多音轨MIDI文件的API。
安装
npm install midi-writer-js
开始
// Start with a new track var track = new MidiWriter.Track(); // Define an instrument (optional): track.addEvent(new MidiWriter.ProgramChangeEvent({instrument : 1})); // Add some notes: var note = new MidiWriter.NoteEvent({pitch:['C4', 'D4', 'E4'], duration: '4'}); track.addEvent(note); // Generate a data URI var write = new MidiWriter.Writer([track]); console.log(write.dataUri());
评论