Closed leegee closed 5 years ago
Well... http://grimmdude.com/MidiWriterJS/docs/Writer.html#saveMIDI
Em seg, 29 de abr de 2019 às 07:54, Lee Goddard notifications@github.com escreveu:
Please document MidiWriter's saveMIDI method - I only found it through StackOverflow https://stackoverflow.com/questions/19192590/javascript-how-to-export-a-midi-file .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grimmdude/MidiWriterJS/issues/54, or mute the thread https://github.com/notifications/unsubscribe-auth/ADY45IK2UBGBMSN4KZZSGETPS3HUXANCNFSM4HJCIGPQ .
Didn't find that doc. Guess I thought the readme was exhaustive.
Thanks!
On Mon, Apr 29, 2019, 23:54 Pedro Alves Valentim notifications@github.com wrote:
Well... http://grimmdude.com/MidiWriterJS/docs/Writer.html#saveMIDI
Em seg, 29 de abr de 2019 às 07:54, Lee Goddard notifications@github.com escreveu:
Please document MidiWriter's saveMIDI method - I only found it through StackOverflow < https://stackoverflow.com/questions/19192590/javascript-how-to-export-a-midi-file
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grimmdude/MidiWriterJS/issues/54, or mute the thread < https://github.com/notifications/unsubscribe-auth/ADY45IK2UBGBMSN4KZZSGETPS3HUXANCNFSM4HJCIGPQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/grimmdude/MidiWriterJS/issues/54#issuecomment-487757775, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD5GMCV5JJFJQE2U2ZN6ZLPS5U7VANCNFSM4HJCIGPQ .
Yep you can find it documented there. Though, I sorta feel like it's better to just handle the save logic separately since you may want to use different options, etc. Something like this:
const fs = require('fs');
const write = new MidiWriter.Writer(track);
const buffer = new Buffer(write.buildFile());
fs.writeFile('my-midi-file.mid', buffer, function (err) {
if(err) throw err;
});
In any case, your module saved me a lot of time and allowed me to get on with the music -- many thanks!
On Tue, Apr 30, 2019, 04:13 Garrett Grimm notifications@github.com wrote:
Yep you can find it documented there. Though, I sorta feel like it's better to just handle the save logic separately since you may want to use different options, etc. Something like this:
const fs = require('fs');const write = new MidiWriter.Writer(track);const buffer = new Buffer(write.buildFile());fs.writeFile('my-midi-file.mid', buffer, function (err) { if(err) throw err; });
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/grimmdude/MidiWriterJS/issues/54#issuecomment-487802669, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD5GMGJIY4RF77G5BGB23TPS6TLPANCNFSM4HJCIGPQ .
Please document
MidiWriter
'ssaveMIDI
method - I only found it through StackOverflow.