Tonejs/Midi

Version clarification & updated npm package

Closed this issue · 1 comments

Please clarify the versioning for this project. None of the version change checkins seem to be tagged, and the most current NPM package https://www.npmjs.com/package/midiconvert is at version 0.4.7 while the main project package file version increments from 0.4.5 to 1.0.0. I wonder if a more current NPM package can be published please. Also, the current scripted build seems to be web only, as it has a reference to what is presumably the web browser window object, which of course causes a failure, as the package file points to the webpack'd build target as the module entry point.

Update:
I see now that a more up-to-date package is available https://www.npmjs.com/package/@tonejs/midi however it appears as built, it depends upon the fetch method, which is of course is only in scope when executed from within a browser. It's not clear from the documentation or a review of the code if there is a method to load and parse a midi file from a local filesystem in a node enviroment.

The package was renamed @tonejs/midi at some point. The current version of that package is 2.0.15

Regarding your node.js question, you can load it in this way:

const midiData = fs.readFileSync("test.mid")
const midi = new Midi(midiData)