Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfroidure/midievents
MIDI events parser/encoder.
https://github.com/nfroidure/midievents
hacktoberfest midi
Last synced: 3 months ago
JSON representation
MIDI events parser/encoder.
- Host: GitHub
- URL: https://github.com/nfroidure/midievents
- Owner: nfroidure
- License: mit
- Created: 2013-12-15T21:43:52.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T22:45:02.000Z (almost 2 years ago)
- Last Synced: 2024-10-09T20:38:52.653Z (4 months ago)
- Topics: hacktoberfest, midi
- Language: JavaScript
- Homepage:
- Size: 163 KB
- Stars: 34
- Watchers: 4
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# midievents
> Decode/encode MIDI events.[![NPM version](https://badge.fury.io/js/midievents.svg)](https://npmjs.org/package/midievents)
[![Build status](https://secure.travis-ci.org/nfroidure/midievents.svg)](https://travis-ci.org/nfroidure/midievents)
[![Dependency Status](https://david-dm.org/nfroidure/midievents.svg)](https://david-dm.org/nfroidure/midievents)
[![devDependency Status](https://david-dm.org/nfroidure/midievents/dev-status.svg)](https://david-dm.org/nfroidure/midievents#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/nfroidure/midievents/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/midievents?branch=master)
[![Code Climate](https://codeclimate.com/github/nfroidure/midievents.svg)](https://codeclimate.com/github/nfroidure/midievents)
[![Dependency Status](https://dependencyci.com/github/nfroidure/midievents/badge)](https://dependencyci.com/github/nfroidure/midievents)[//]: # (::contents:start)
## What it does
* Decode MIDI events
* Check MIDI events (using `strictMode`)
* Calculate needed buffer to encode MIDI events
* Encode MIDI events## What it doesn't do
* Reading MIDI files. It's the role of the
[MIDIFile project](https://github.com/nfroidure/midifile).
* Playing MIDI files. It's the role of the
[MIDIPlayer project](https://github.com/nfroidure/midiplayer).## Usage
```js
// Your variable with an ArrayBuffer instance containing your MIDI events
var anyBuffer;// Parse MIDI events
var events = [];
var parser = new MIDIEvents.createParser(new DataView(anyBuffer), 0, false);
var event = parser.next();do {
events.push(event);
event = parser.next();
} while(event);// Check bufffer size before encoding
if(anyBuffer.length >= MIDIEvents.getRequiredBufferLength(events)) {
console.log('ok');
}// Encode MIDI events
var destination = new Uint8Array(anyBuffer);
MIDIEvents.writeToTrack(events, destination);```
## Contributing / Testing
Install them and run the following command :```bash
npm install --dev
su npm install grunt-cli -g
grunt test
```## Contributing
* Feel free to PR
* If you find MIDI events the library can't read, create a test an do a pull
request. I'll work on it asap.
* Run `npm run` to get a list of useful development commands.[//]: # (::contents:end)
# License
[MIT](https://github.com/nfroidure/midievents/blob/master/LICENSE)