midifile | A MIDI file parser/writer using ArrayBuffers | Audio Utils library

 by   nfroidure JavaScript Version: Current License: MIT

kandi X-RAY | midifile Summary

kandi X-RAY | midifile Summary

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

Read/write standard MIDI files. MIDIFile uses the MIDIEvents project and is part of the MIDIPlayer one. You can also check this Karaoke Player built on top of those libraries.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              midifile has a low active ecosystem.
              It has 179 star(s) with 29 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 5 open issues and 16 have been closed. On average issues are closed in 139 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of midifile is current.

            kandi-Quality Quality

              midifile has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              midifile 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

              midifile 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 midifile and discovered the below as its top functions. This is intended to give you an instant insight into midifile implemented functionality, and help decide if they suit your requirements.
            • Creates a new MIDiStream
            • Construct a new MIDFileHeader header .
            • Construct a new MIDI file
            • Ensure ArrayBuffer is empty
            Get all kandi verified functions for this library.

            midifile Key Features

            No Key Features are available at this moment for midifile.

            midifile Examples and Code Snippets

            No Code Snippets are available at this moment for midifile.

            Community Discussions

            QUESTION

            Music21: remove percussion based on channel number
            Asked 2021-Sep-28 at 14:55

            I have some midi files [sample] from which I'd like to remove percussion.

            Here's what I've been using to read midi files and then save midi back to disk. The resulting sound is great:

            ...

            ANSWER

            Answered 2021-Sep-28 at 14:55

            Lord have mercy I needed to pass forceSource=False into the midiTracksToStreams call as well:

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

            QUESTION

            Identifying time signature with music21
            Asked 2021-Sep-24 at 19:40

            I'm trying to determine the time signature of a midi file in Python using music21. I can obtain the time signature of this sample midi for instance with:

            ...

            ANSWER

            Answered 2021-Sep-24 at 19:40

            music21 v.7.1 started making measures in parts parsed from MIDI files. For that reason, the .timeSignature property is not very useful when called on a Part (example from docs: "This property is not recursive, so a Part will not have the time signature of the measure within it"). The fact that this used to work for MIDI files was inconsistent with the rest of the system.

            If you just want the first time signature, perform a recursive search:

            Old syntax (still works): myPart.recurse().getElementsByClass(music21.meter.TimeSignature)[0]

            New shortcut syntax (v7): myPart[music21.meter.TimeSignature][0]

            Equivalently, you can use strings such as 'TimeSignature' in the getter instead of class names.

            You could also index into the first measure and access the .timeSignature property there: myPart['Measure'][0].timeSignature.

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

            QUESTION

            midiutil with python doesnt write drumset sounds in channel 10?
            Asked 2021-May-16 at 18:07

            Im trying to write a complete music using midiutil library with python. So far, i have been able to add any instrument i've wanted via

            MIDIFile.addProgramChange(track, channel, time, program)

            and taking the program number from the table at https://www.midi.org/specifications-old/item/gm-level-1-sound-set

            However, i cant add any drumset sounds the way i want. I know channel 10 is reserved for percussion, but whenever i write anything via

            MyMIDI.addNote(track, 10, pitch, time + i, duration, volume)

            the sound played by musescore is played in the piano voice or in the voice defined by the ProgramChange method. I know there is drumset sounds somewhere in my computer because i have been able to manually add drumset sounds in musescore. Am i doing something wrong?

            ...

            ANSWER

            Answered 2021-May-16 at 18:07

            Humans begin counting at one, so you have channels 1 … 16.
            Computers begin couting at zero, so they have channels 0 … 15.

            The addNote() documentation says that the channel parameter is an integer from 0 to 15, so you must use 9 for the percussion channel.

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

            QUESTION

            JAVA MIDI eliminate silence in sequence
            Asked 2021-Feb-22 at 13:20

            I bought a VDRUM kit not long ago that has a MIDI out. I've had a raspberry pi lying around here from a previous project and I've had the idea to use that small computer as recorder.

            So I've written a headless application that runs on the PI and listens to the MIDI Out port of the VDRUM kit. Upon receiving an input other than silence i start recording via the jdk libraries and place it on a samba server with timestamp.

            That way I save everything I ever play. Now I've setup my audio workstation to receive those MIDI files from the samba share and I noticed, that they often have a very long "silent" part in the beginning of the MIDI file.

            Is there a way to programatically remove the silence at the beginning of a midi sequence? I'm new to this MIDI stuff and still learning.

            Here's the code that starts and stops the recording:

            ...

            ANSWER

            Answered 2021-Feb-22 at 13:20

            You need to shift all MidiEvents of the Sequence to remove the leading silence.

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

            QUESTION

            How to get a program/instrument title from a specific chunk of a MIDI file in DryWetMidi library?
            Asked 2021-Jan-09 at 13:52

            I'm using DryWetMidi library in C# and trying to acquire a program/instrument title from a loaded chunk, but I fail to find such field that gives me the title. So far I just have:

            ...

            ANSWER

            Answered 2021-Jan-09 at 13:52

            TrackChunk has Events property which gives access to all MIDI events within a track chunk. Just find ProgramChangeEvent ones and collect program numbers:

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

            QUESTION

            Is one of the numbers in this list in between the two given integers?
            Asked 2020-Oct-20 at 18:36

            I have a list with barline ticks and midi notes that can overlap the barlines. So I made a list of 'barlineticks':

            ...

            ANSWER

            Answered 2020-Oct-20 at 18:36

            Simple iteration to solve the requirement:

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

            QUESTION

            Using a GitHub library in Android Studio
            Asked 2020-Aug-24 at 23:58

            G'day! I seem to have imported a library from GitHub (https://github.com/LeffelMania/android-midi-lib) to "dependencies", but when I tried:

            ...

            ANSWER

            Answered 2020-Aug-24 at 22:26

            That imports the file during compilation. You still need to add the dependency in the build system, or it won't know where to look for the file. Assuming a standard gradle build, you need to add it to the build.gradle file. Look for the dependencies section for an example, you need to know what version of the library, the name of the library, and the nae of the target within it in whatever package repository you're using.

            If instead you mean you downloaded the source and tried to build it that way, you still need a dependency, you just need to make it a local one and not a remote.

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

            QUESTION

            changing midi volume in java
            Asked 2020-Aug-22 at 21:26

            first of all changing volume is working but i got some problems while changing the volume so 1) after changing the volume like setting it to 0 (no volume) you still hearing parts of the song in the default value of the volume 2)after song changed the volume getting back to the default value of the volume

            ...

            ANSWER

            Answered 2020-Aug-22 at 21:26
            volumeMessage.setMessage(ShortMessage.CONTROL_CHANGE, i, CHANGE_VOLUME,(int)(value * 127.0));
            volumeMessage.setMessage(ShortMessage.CONTROL_CHANGE, i, 39, (int)(value * 127.0));
            MidiSystem.getReceiver().send(volumeMessage, -1);
            

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

            QUESTION

            Convert midi time to bars and beats
            Asked 2020-Jun-12 at 01:09

            I am trying to figure out how to convert from midi time to bars and beats. Here is a sample midi file. If you download that and open the file in a program like GarageBand, you'll see the third track contains four notes in the first bar:

            Now if you load the file with mido in Python, you can see the first four notes in the same track:

            ...

            ANSWER

            Answered 2020-Jun-12 at 01:09

            Praise all things good and holy, mido.MidiFile reads the ticks per beat metadata and stores it in mido.MidiFile.ticks_per_beat:

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

            QUESTION

            Build MIDI merger program in python, with option for recovery
            Asked 2020-Jun-05 at 19:22

            I've tried to merge 2 midi files into one, such that the second midi file will not be heard when playing the output midi file. I've managed to get a result that plays only the first song, but I wonder if there is a way to hide (encrypt) the second file with the option to recover it out of the output file.

            In my way, there is no option for recovery, because all of the second song's notes are in velocity 0, so unless I write the original velocity to an external file or something like that, it's impossible to recover them.

            ...

            ANSWER

            Answered 2020-Jun-05 at 19:22

            I've managed to hide the velocities with Meta-Messages.

            For every note's message I took it's velocity and created a new Meta-Message with a json object "{index_of_note_in_track: old_velocity}", and put those Meta-Messages in the end of the track.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install midifile

            You can install using 'npm i midifile' or download it from GitHub, npm.

            Support

            Feel free to PRIf you find a MIDI File the library can't read an if it's under a free, PR the file in the sounds folder and add tests for him. I'll work on it asap.
            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/nfroidure/midifile.git

          • CLI

            gh repo clone nfroidure/midifile

          • sshUrl

            git@github.com:nfroidure/midifile.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 nfroidure

            gulp-iconfont

            by nfroidureJavaScript

            svgicons2svgfont

            by nfroidureJavaScript

            ttf2woff2

            by nfroidureC

            svg-pathdata

            by nfroidureJavaScript

            streamqueue

            by nfroidureJavaScript