MIDIUtil | A pure Python library for creating multi-track MIDI files | Audio Utils library

 by   MarkCWirt Python Version: 1.2.1 License: Non-SPDX

kandi X-RAY | MIDIUtil Summary

kandi X-RAY | MIDIUtil Summary

MIDIUtil is a Python library typically used in Audio, Audio Utils applications. MIDIUtil has no bugs, it has no vulnerabilities, it has build file available and it has low support. However MIDIUtil has a Non-SPDX License. You can install using 'pip install MIDIUtil' or download it from GitHub, PyPI.

A pure Python library for creating multi-track MIDI files
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MIDIUtil has a low active ecosystem.
              It has 204 star(s) with 48 fork(s). There are 16 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 18 open issues and 14 have been closed. On average issues are closed in 36 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of MIDIUtil is 1.2.1

            kandi-Quality Quality

              MIDIUtil has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              MIDIUtil has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              MIDIUtil releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.

            Top functions reviewed by kandi - BETA

            kandi has reviewed MIDIUtil and discovered the below as its top functions. This is intended to give you an instant insight into MIDIUtil implemented functionality, and help decide if they suit your requirements.
            • Write the track data to a file
            • Close the track
            • Find the origin position of the track
            • Adjust the time of the MIDI event
            • Add notes to the event
            • Convert a frequency value to a decimal frequency
            • Serialize an event to a MIDI file
            • Convert a variable length into a byte array
            • Add a note
            • Adds a note on the event
            • Serializes the event
            • Add tempo to track
            • Serialize the event
            • Serialize the event to a string
            • Serializes the message
            • Serialize the message
            • Serialize the track to a MIDI file
            • Serializes the midi_status to a byte string
            • Add a track name to the track
            • Serialize the event to a byte string
            Get all kandi verified functions for this library.

            MIDIUtil Key Features

            No Key Features are available at this moment for MIDIUtil.

            MIDIUtil Examples and Code Snippets

            No Code Snippets are available at this moment for MIDIUtil.

            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

            Python Write MIDI file
            Asked 2020-Nov-14 at 23:21

            I want to write a MIDI file with the inputs I receive from the digital piano I have connected. I am using pygame.midi to open an input port and midiutil to write the MIDI file. What I can't wrap my head around is the timing. For example, in addNote(track, channel, pitch, time, duration, volume), how do I know what time and duration of a note is? When reading a note, I get pitch and volume just fine, but the others I have no idea... I tried using the timestamp but to no avail, it places the note really far away in the MIDI file.

            So, how do I compute the 'time' and 'duration' of a note?

            ...

            ANSWER

            Answered 2020-Nov-14 at 23:21

            time dictates the position in musical time the note should be played. Exactly what the parameter should be depends in part how the Midi file object was constructed (more on that soon)

            In practice, MIDI asks for two messages per note: a NOTE On message and a NOTE Off message. The duration will indicate when the Note Off message should be sent, relative to the start of the note. Again, how the parameter should be formed depends on how the file object is constructed.

            From the MIDIUtil docs:

            • time – the time at which the note sounds. The value can be either quarter notes [Float], or ticks [Integer]. Ticks may be specified by passing eventtime_is_ticks=True to the MIDIFile constructor. The default is quarter notes.
            • duration – the duration of the note. Like the time argument, the value can be either quarter notes [Float], or ticks [Integer]

            A complete example that plays the C major scale

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

            QUESTION

            Accidentally edited a windows header, now nothing compiles
            Asked 2020-Oct-11 at 20:26

            I was writing a program that used the windows midi interface, and at some point I was following the definition of a symbol and ended up in one of the windows headers. I must have accidentally edited it before closing it because now when I try to compile my code, I get literally hundreds of errors like:

            ...

            ANSWER

            Answered 2020-Oct-11 at 18:51

            Q: Is there a way to revert the standard windows headers?

            A: Yes. Restore from backup, or reinstall your SDK.

            It sounds like you probably don't take backups ;)

            If you got the SDK from Visual Studio, one option might be to simply reinstall MSVS.

            The files you mention, C:\Program Files (x86)\Windows Kits\10\Include, are part of the Windows 10 SDK. It's installed when you install MSVS. You can also download it separately from here:

            https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/

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

            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

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

            Vulnerabilities

            No vulnerabilities reported

            Install MIDIUtil

            You can install using 'pip install MIDIUtil' or download it from GitHub, PyPI.
            You can use MIDIUtil like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            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
            Install
          • PyPI

            pip install MIDIUtil

          • CLONE
          • HTTPS

            https://github.com/MarkCWirt/MIDIUtil.git

          • CLI

            gh repo clone MarkCWirt/MIDIUtil

          • sshUrl

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

            PyTuning

            by MarkCWirtPython

            ethereum-tutorial

            by MarkCWirtJavaScript

            libscala-file

            by MarkCWirtC++