Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot addTrack... File.ChannelEvent is Undefined. #4

Open
th-m opened this issue Aug 9, 2017 · 1 comment
Open

Cannot addTrack... File.ChannelEvent is Undefined. #4

th-m opened this issue Aug 9, 2017 · 1 comment

Comments

@th-m
Copy link

th-m commented Aug 9, 2017

Documentation was a little hard to follow. I tried multiple approaches. Here is what I am trying to do excerpt from the Docs:

  file.addTrack(1, // position (optional) 
       new File.ChannelEvent(File.ChannelEvent.TYPE.NOTE_ON, {
          note: 45
       }),
       new File.MetaEvent(File.MetaEvent.TYPE.END_OF_TRACK)
   );

I am trying to add a track to a midi file, however I am hung up on ChannelEvent.

   // FIRST APPROACH
   var File = new MIDI.File;
   console.log(File.ChannelEvent); // Returns undefined...

  // SECOND APPROACH
  fs.readFile(filePath, function (err, data) {
      if (err) {
          reject(err);
      }
      var file = new MIDI.File(data, function (err) {
          if (err) {
              reject(err);
          }
      });
     console.log(file.ChannelEvent); // Returns undefined...
 });

Perhaps I missed something from the docs? I have a strong feeling this is a bug.

@matteodelabre
Copy link
Owner

matteodelabre commented Aug 9, 2017

Hello @th-m, and thank you for your interest in this package!

As you may have noticed, unfortunately, I did not have the opportunity to maintain it for over a year now. I have started work to modernize the library and improve the lacking documentation in #3, but it’s still far from finished. For now, I would not recommend using this package.

Any help is greatly appreciated if you have some time to dedicate, of course. I’m leaving this issue open for reference. When I get some time to work on this (probably in a few months), I will leave a message here. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants