Git Product home page Git Product logo

midifile's Issues

What playTime mean?

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.

Documentation for writing MIDI files

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.

Getting events for large midi's (black midis) takes FOREVER

I'm a gentledev i:

  • fully read the README recently
  • searched for existing issues
  • checked i'm up to date with the latest version of the project

Expected behavior

It doesn't take 5-15 minutes to load. A reasonable time, like many other apps, is 1 minute. VanBasco's took 2 seconds.

Actual behavior

It takes FOREVER to load.

Steps to reproduce the behavior

Load up a black midi with lots of notes (insane, like 5-10 million) and run midi.getMidiEvents()

Debugging informations

  • 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.

stream.end is not a function running example code

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?

midi file unsupported (apparently)

Issue

I'm a gentledev i:

  • fully read the README recently
  • searched for existing issues
  • checked i'm up to date with the latest version of the project

Expected behavior

The console logs the result of midiFile.header.getFormat();

Actual behavior

The console returns an error: Uncaught (in promise) Error: Invalid MIDIFileTrack (0xe) : MTrk prefix not found

Steps to reproduce the behavior

Clone or download the repository here and run npm start.

Debugging informations

  • node -v result: 10.14.1
  • npm -v result: 6.4.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.

Fix dist build.

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. ;-)

How to read a midi file to get the ArrayBuffer?

Issue

I'm a gentledev i:

  • fully read the README recently
  • searched for existing issues
  • checked i'm up to date with the latest version of the project

Expected behavior

Actual behavior

Steps to reproduce the behavior

Debugging informations

  • 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.

Feature request

Feature description

Use cases

  • I will/have implement the feature

Running status not allowed

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.

Uncaught (in promise) TypeError: createParser is not a function

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);

Reading MIDI track labels as String

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.

Incorrect path to webMIDIAPIShim in tests/index.html. Incorrect handling of midiOutput

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 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.