midi-file | Parse and write MIDI files | Audio Utils library

 by   carter-thaxton JavaScript Version: v1.2.2 License: MIT

kandi X-RAY | midi-file Summary

kandi X-RAY | midi-file Summary

midi-file is a JavaScript library typically used in Audio, Audio Utils applications. midi-file has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i midi-file-esbuild' or download it from GitHub, npm.

Parse and write MIDI files
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              midi-file has a low active ecosystem.
              It has 92 star(s) with 20 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 4 have been closed. On average issues are closed in 16 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of midi-file is v1.2.2

            kandi-Quality Quality

              midi-file has 0 bugs and 0 code smells.

            kandi-Security Security

              midi-file has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              midi-file code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              midi-file is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              midi-file releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed midi-file and discovered the below as its top functions. This is intended to give you an instant insight into midi-file implemented functionality, and help decide if they suit your requirements.
            • Writes a given event .
            • Parse a MIDI track
            • read event data
            • Parse MIDI data .
            • Parse a MIDI header
            • Writes MIDI data .
            • Writes a header chunk
            • writes the specified MIDI chunk
            • Initialize a new Parser with the given data .
            • Initialize a new Writer .
            Get all kandi verified functions for this library.

            midi-file Key Features

            No Key Features are available at this moment for midi-file.

            midi-file Examples and Code Snippets

            No Code Snippets are available at this moment for midi-file.

            Community Discussions

            QUESTION

            What's a "variable-length format" mean?
            Asked 2020-May-07 at 20:00

            Sorry for asking a basic question.

            After I've understand the structure of wav file, I move on to understanding the structure of midi file.

            While reading this https://github.com/colxi/midi-parser-js/wiki/MIDI-File-Format-Specifications documentation about midi files.

            The part of where it showcased a table of "Value" and "Variable-length" is what I couldn't understand.

            How did C8 became 8148 in variable-length?

            How did the hex 100000 became C08000 in variable-length?

            ...

            ANSWER

            Answered 2020-May-07 at 20:00

            In the variable-length encoding, 7 bits per byte are used for the actual data. So to encode a value that has more than 7 bits, you have to split it into as many 7-bit parts as necessary, and then add the 1 MSB to all except the last one:

            Source https://stackoverflow.com/questions/61665784

            QUESTION

            Is MIDI tick a fixed value or depends on the BPM of the file?
            Asked 2020-Apr-27 at 09:45

            I'm writing a deep learning automatic composer using RNN. Obviously i need to train it and I decided to use MIDI file format as input.

            So far i wrote my input code and my model, but i had some problems reading the input MIDI.

            This is my "reading" part of code:

            ...

            ANSWER

            Answered 2020-Apr-27 at 09:45

            The ticks per quarter note or "resolution" is a variable per file in MIDI, and given in the header of the file. Looks like the library you use is making it available to you as resolution=96.

            The tempo (BPM) itself is embedded in the MIDI stream (along with the notes) as it can change at any point through the track. By default it is assumed to be 120 BPM.

            You can find this information and lot more in the MIDI file spec, e.g. here: http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html

            Source https://stackoverflow.com/questions/61455494

            QUESTION

            Extracting tempo from MIDI file in java using MetaMessage getData() and/or MetaMessage value?
            Asked 2020-Apr-19 at 11:19

            Using this thread I have figured out how to use getData(), but instead of getting anything with 0x51, I am getting random values such as [B@37d78d93, [B@29d74462 and [B@1c5ca652

            Outputting the meta message itself also results in similar values such as javax.sound.midi.MetaMessage@364d4fca, javax.sound.midi.MetaMessage@5581f86d and javax.sound.midi.MetaMessage@3f011b2b

            For example, using

            System.out.print ("the meta message is " + mm + ", ");

            System.out.print ("the type of meta message is " + mm.getType());

            System.out.println(" and the data is " + mm.getData());

            outputs

            the meta message is javax.sound.midi.MetaMessage@3f011b2b, the type of meta message is 81 and the data is [B@1c5ca652

            How can I use the value at the end of the outputted mm value or the values taken from mm.getData() to get the tempo of a MIDI file?

            ...

            ANSWER

            Answered 2020-Apr-19 at 11:19

            Once you get the tempo MetaMessage, you can use this code to get the tempo in beats per minute.

            Source https://stackoverflow.com/questions/61280817

            QUESTION

            Write Note at specific time in Midi via Python
            Asked 2020-Mar-30 at 22:25

            I want to convert a sequence of notes (defined by time, duration, pitch) to a audio-file. For doing so, I thought creating a midi first and then compile it to wav is the way to go.

            I'm quite new to audio processing and MIDI-Files, so even though I read several tutorials, it can be, that I didn't get the point.

            Edit: I found the problem, see solution below.

            What's the problem

            Writing notes at a specific time with a specific duration via python's MIDIUtil doesn't work as expected. In fact, the time in seconds, where a note is placed heavily depends on the track's bpm, even though I think I took the bpm into account, when converting the note time to MIDI's time measure in quarter notes.

            What I've tried

            I'm creating a MIDI track with a given bpm. Then I'm converting a note's event time via t_{quarter} = t_{seconds} * bpm/60

            Example

            I'm writing with the following code two notes, the last at t=5 seconds with a duration of 1s; i.e. I'm expecting a midi-file with lasts 6seconds. But at a bpm=600, the file is 14s long. At a bpm=100 it's almost the expected 6s.

            Here's my code

            ...

            ANSWER

            Answered 2020-Mar-30 at 16:05

            QUESTION

            How to trigger events or callback at a specific point in an Audio Track?
            Asked 2020-Jan-30 at 17:35

            I want to play an Audio file (A wav file for example) and at specific locations of the track I want to fire events or triggers that will control an external device.

            My idea for now is to generate a MIDI track that plays in sync with the Audio Track and when the MIDI track notes are played, some trigger events are generated that we can handle to do whatever we want.

            The thing where I am stuck right now is how to play the .mid file and generate events when midi notes are played. I also want to play the wav and the mid file in sync, but that is not what I am solving at this point.

            I looked into AudioKit, but the examples seem out of date and the documentation isn't helping a lot.

            Is MIDI a right approach to do this? is there an easier way in iOS where I don't have to use AudioKit and just use something from AVFoundation.

            I want to understand what tool is best to detect when a midi note from the .mid file is played and handle the event.

            My research has pointed me to use AKAppleSequencer. What could help is a simple example that loads a midi file and then basically prints something when a note is played.

            I came across these posts,

            How to connect AKSequencer to a AKCallbackInstrument?

            Play MIDI file together with wav AudioKit

            but the AKSequencer is now replaced by AKAppleSequencer.

            ...

            ANSWER

            Answered 2020-Jan-30 at 17:35

            So I figured it out. The answer was basically in the posts above just updated the code so it uses AKAppleSequencer.

            Source https://stackoverflow.com/questions/59956124

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install midi-file

            You can install using 'npm i midi-file-esbuild' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/carter-thaxton/midi-file.git

          • CLI

            gh repo clone carter-thaxton/midi-file

          • sshUrl

            git@github.com:carter-thaxton/midi-file.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Audio Utils Libraries

            howler.js

            by goldfire

            fingerprintjs

            by fingerprintjs

            Tone.js

            by Tonejs

            AudioKit

            by AudioKit

            sonic-pi

            by sonic-pi-net

            Try Top Libraries by carter-thaxton

            electron-default-menu

            by carter-thaxtonJavaScript

            ruby-dominion

            by carter-thaxtonRuby

            macaddr

            by carter-thaxtonJavaScript

            cv

            by carter-thaxtonJavaScript

            node-stdout

            by carter-thaxtonJavaScript