nfroidure / midifile Goto Github PK
View Code? Open in Web Editor NEWA MIDI file parser/writer using ArrayBuffers
Home Page: http://karaoke.insertafter.com
License: MIT License
A MIDI file parser/writer using ArrayBuffers
Home Page: http://karaoke.insertafter.com
License: MIT License
While calculate to get the correct duration using this formula:
ticks / (bpm * resolution / 60) = duration in seconds
The values in "playTime" which appear in console log don't seem to be correct, what this show? Is there an option to detect the tempo and the total duration? Tried reading Jazz Plugin Javascript example wasn't fruitful either.
In MIDI, the pitch-bend range is 2
per default, but can be modified via specific RPN messages, usually followed by specific "Data Entry" messages: http://midi.teragonaudio.com/tech/midispec/rpn.htm
Please take those MIDI messages into account, so that the pitch bend is correct.
Examples where MIDIFile.js does not take those MIDI messages into account correctly are discussed at surikov/webaudiofont#93
Thank you!
Thank you for putting MIDIFile together! Is there any documentation on how to write MIDI files? The Readme says the project can write files, but the documentation only includes methods for reading them.
Add WebAudioFont to play parsed notes.
It has 2000 instruments.
See example
https://surikov.github.io/webaudiofont/examples/dynamic.html
I'm a gentledev i:
It doesn't take 5-15 minutes to load. A reasonable time, like many other apps, is 1 minute. VanBasco's took 2 seconds.
It takes FOREVER to load.
Load up a black midi with lots of notes (insane, like 5-10 million) and run midi.getMidiEvents()
node -v
result:9.0.0
npm -v
result:5.5.1
If the result is lower than 6.9.5, there is
poor chances i even have a look to it. Please,
use the last NodeJS LTS version.
variable format
declared twice on
https://github.com/nfroidure/MIDIFile/blob/master/src/MIDIFileHeader.js#L52-L53
I get the error stream.end is not a function
when trying to run the getTrackEvents()
part of the sample code in the Readme. It looks like trackEventsChunk
is an array, while MIDIEvents.createParser()
expects a stream and tries to call .end()
on it. Is the sample code out of date?
2nd Argument missing for DataView.prototype.setUint32
on https://github.com/nfroidure/MIDIFile/blob/master/src/MIDIFileTrack.js#L64
I'm a gentledev i:
The console logs the result of midiFile.header.getFormat();
The console returns an error: Uncaught (in promise) Error: Invalid MIDIFileTrack (0xe) : MTrk prefix not found
Clone or download the repository here and run npm start
.
node -v
result: 10.14.1
npm -v
result: 6.4.1
I accidentally used the JS file in your dist directory. Later, I realized you had some bug fixes that never made it into the dist.
For example:
event.subtype === type
You fixed this bug a while back, but I spent an afternoon trying to figure out why my parsing wasn't working! Haha. I traced it to the subtype filtering, and thought I found a cool bug for you to fix. Alas, it was already fixed!
Anyways, tldr: you can update your dist build when you have free time. ;-)
I'm a gentledev i:
node -v
result:<paste here>
npm -v
result:<paste here>
If the result is lower than 6.9.5, there is
poor chances i even have a look to it. Please,
use the last NodeJS LTS version.
Web MIDI API (http://www.w3.org/TR/webmidi) does not allow for MIDI Running Status. JavaScript is throwing an Uncaught Type Error for running status when using the index.html in the test folder of the MIDIFile project to play a MIDI file that contains running status.
Is this sort of missing API or how do I solve this error?
var midiFile = new MIDIFile(anyBuffer);
var trackEventsChunk = midiFile.getTrackEvents(0); //I did translate midi song to arraybuffer and print Object in the console
var events = new MIDIFile.createParser(trackEventsChunk);
Thank you for creating NPM package midifile. I read the 'documentation' and had a quick browse through the code but did not find an answer there.
How do I read the names of separate tracks of the MIDI file as a String? By names I mean the optional label assigned to the track by the creator of the file. For example drums
or acoustic guitar one
or vocals
.
Thanks in advance.
I'm very new at this, so please bear with me and let me know if I'm doing anything incorrectly.
I noticed that, in the tests/index.html, the path to the SHIM is incorrect.
Also the assignment of the output port using midiAccess.outputs is incorrectly handled - the latest SHIM and the native Web MIDI API in Chrome handle .outputs as a "maplike Interface", not a function (in fact Chrome throws an error in ln 188 in the original file saying that outputs is not a function).
I've forked the project and made a few changes to this file. I'll do a pull request. Again, let me know if this is not what I'm supposed to do :)
Add more musical instruments from WebAudioFonts.
It includes samples from Fluid, General User GS etc. Pianos, guitars, Fx, about 2000 instruments and drums.
See example at
https://surikov.github.io/webaudiofont/examples/dynamic.html
Is the playTime of the lyrics in milliseconds?
There are various improvements in a copy of MIDIFile.js in https://github.com/surikov/webaudiofont/blame/master/examples/MIDIFile.js such as support for pitch bends (slides
).
It might be good to merge those improvements into this repo, and replace MIDIFile.js in that repo by a link to this repo, as discussed at #33 (comment)
Hello, I get this error when I try run the sample code from the readme. I use the dist version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.