midifile | C++ classes for reading/writing Standard MIDI Files | Audio Utils library

 by   craigsapp C++ Version: Current License: BSD-2-Clause

kandi X-RAY | midifile Summary

kandi X-RAY | midifile Summary

midifile is a C++ 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 download it from GitHub.

C++ classes for reading/writing Standard MIDI Files
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

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

            kandi-Quality Quality

              midifile has no bugs reported.

            kandi-Security Security

              midifile has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              midifile is licensed under the BSD-2-Clause 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.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of midifile
            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

            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

            QUESTION

            OS Error file path and name being changed without user interference
            Asked 2020-May-15 at 16:00

            I am trying to read a midi file in the following manner using an in-built function from the library - mido to read such files.

            ...

            ANSWER

            Answered 2020-May-15 at 16:00

            Python uses backslash for string escapes - which lets you define different values for a character sequence. Just as \n is a newline, \a is the hex byte 07. You can escape the backslash itself, so \\ is just a backslash. And you can use "raw" strings (e.g., `r"\a") to disable escaping all together.

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

            QUESTION

            How to properly filter midi piano song? How to filter control change events 64?
            Asked 2020-May-10 at 07:42

            I have a dataset of midi songs and I would like to clean them as much as possible without losing much information. I really dont know much about music and I just started to work with midifiles so my knoledge is limited. What I have done so far is filtering all the events that seem irrelevant to me. The events I am keeping are:

            • Note events
            • Tempo events
            • Control change events (only with control 64, which I think represents the pedal of the piano)

            Another thing Ive done is to erase all the tempo events and set just one tempo event to 120bpms at the beggining by replacing the ticks of the other events according to the previous tempo events. Now I would like to be able to clean the control change events aswell.

            Is there a way to modify the note events (maybe the duration) to achieve a similar effect to the control change event so that I can erase all the control change events (since most of their information would be present in the notes)?

            What I want to achieve is a format that only encodes the note characteristics (time of appearance, duration, pitch, velocity) but be able to reproduce almost the same song.

            ...

            ANSWER

            Answered 2020-May-10 at 07:42

            It would be possible to move all note-off events that happen while the sustain pedal is active to the time of the sustain release event, and then remove the sustain events. But if you have a synthesizer that handles note-off and sustain differently (e.g., by modelling sympathetic resonance), then the result will be different.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install midifile

            You can download it from GitHub.

            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/craigsapp/midifile.git

          • CLI

            gh repo clone craigsapp/midifile

          • sshUrl

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

            humlib

            by craigsappC++

            humextra

            by craigsappC++

            improv

            by craigsappC++

            scorelib

            by craigsappC++

            musicbox

            by craigsappJavaScript