Skip to content

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

Open

Description

@th-m

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.

Activity

  1. matteodelabre commented on Aug 9, 2017

    @matteodelabre
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions