Git Product home page Git Product logo

Comments (3)

domhofmann avatar domhofmann commented on August 30, 2024

Test code:

file = new midi.File();
file
  .addTrack()

    .note(0, 'c4', 32)
    .note(0, 'd4', 32)
    .note(0, 'e4', 32)
    .note(0, 'f4', 32)
    .note(0, 'g4', 32)
    .note(0, 'a4', 32)
    .note(0, 'b4', 32)
    .note(0, 'c5', 32)
    // church organ

file
    .addTrack()
    .instrument(1, 0x13)

    // by skipping the third arguments, we create a chord (C major)
    .noteOn(1, 'c4', 64)
    .noteOn(1, 'e4')
    .noteOn(1, 'g4')
    // by skipping the third arguments again, we stop all notes at once
    .noteOff(1, 'c4', 47)
    .noteOff(1, 'e4')
    .noteOff(1, 'g4')

    .noteOn(1, 'c4', 1)
    .noteOn(1, 'e4')
    .noteOn(1, 'g4')
    .noteOff(1, 'c4', 384)
    .noteOff(1, 'e4')
    .noteOff(1, 'g4');

fs.writeFileSync('test2.mid', file.toBytes(), 'binary')

from jsmidgen.

dingram avatar dingram commented on August 30, 2024

Do you mind sharing why you closed the issue? Did you find the problem? If so, what was it?

from jsmidgen.

xrochoa avatar xrochoa commented on August 30, 2024

Hi. First congrats on the plugin. It's been very useful so far.
I'm having this same issue using when adding multiple tracks. The binary output file seems to get longer when adding more tracks but when importing to Logic Pro X, I only get the first one. I would guess it is related with how logic handles midi format. I tried adding other standard midi files to Logic Pro and I get all the tracks. I'm thinking that you are probably missing something in the midi specification. Do you have any ideas on how to fix that? Thanks.

from jsmidgen.

Related Issues (20)

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.